2013年5月28日 星期二

qwebirc 安裝

1. 下載 qwebirc,并解壓縮
http://qwebirc.org/download

2. 安裝所需套件
# apt-get install python python-twisted python-twisted-bin python-twisted-core python-twisted-runner python-twisted-names python-twisted-mail python-twisted-words python-twisted-web python-zope.interface python-openssl openjdk-6 mercurial

 3. 修改 qwebirc 設定
# cp config.py.example config.py
# vi config.py

4. 編譯
#python compile.py

5. 執行 (無錯誤訊息則成功)
# python run.py




Reference :
Installation - the qwebirc project

2013年5月23日 星期四

irssi 設定

添加网络
/NETWORK ADD -kicks 4 -msgs 1 -modes 4 -whois 1 freenode

添加服务器
/SERVER ADD -auto -network freenode irc.freenode.net

添加想要自动加入的频道
/CHANNEL ADD -auto #h4 freenode

保存聊天记录
/LOG OPEN -autoopen -targets #h4 ~/logs/irc-svn-%Y%m%d.log

/SET autolog ON
/SET autolog_path ~/.irssi/irclog/$tag/$0-%Y%m%d.log
/save

下載 theme
$ cd ~/.irssi
$ wget http://www.irssi.org/themefiles/greenbox.theme

下載 script
$ mkdir ~/.irssi/scripts/autorun
$ cd ~/.irssi/scripts/autorun
My Favorite Irssi Scripts | chrisjohnston.org

adv_windowlist.pl
autorun
auto_whois.pl
dccstat.pl
go.pl
hilightwin.pl
history_search.pl
len.pl
messages_bottom.pl
nickcolor.pl
nicklist.pl
openurl.pl
queryresume.pl
screen_away.pl
scriptassist.pl
trackbar.pl
trackbar-soliton.pl
trigger.pl
usercount.pl
window_switcher.pl
xchatnickcolor.pl

設定 theme
/set theme greenbox
/save
nicklist.pl
/script load autorun/nicklist.pl
/set nicklist_automode SCREEN

hilightwin.pl
/script load autorun/hilightwin.pl
/window new split
/window name hilight
/window size 6
/layout save

adv_windowlist.pl
/script load autorun/adv_windowlist.pl
/statusbar window remove act
/set awl_display_key $Q%K|%n$H$C$S
/set awl_block -15

usercount.pl
/script load autorun/usercount.pl
/statusbar window add usercount



Reference :
lzy's 543: 用 screen + irssi 上 irc 之鄉民版教學 (含Q&A)
IRC by IRSSI, with Big5/UTF-8 recode [JeffHung.Blog]

Setting Up IRSSI on a Debian Server

Windows XP 0x0000007E


irc no channel op

register user
/msg nickserv register YOURPASSWORD YOUREMAIL
if need change password ?
/msg NickServ SET nick PASSWORD oldpassword newpassword

create a channel (be a channel operator)
/j #test_channel 

register a channel
/msg ChanServ REGISTER #channel

list channel op users
/msg  chanserv access list #channel

recognize user
/msg NickServ IDENTIFY YOURPASSWORD 

chan op
/msg ChanServ ACCESS channel ADD nickname role
/msg ChanServ ACCESS #test_channel  ADD yan 10

auto identify
/NETWORK ADD -autosendcmd "/^msg NickServ IDENTIFY password;wait 2000" freenode




Reference :
ChanServ Commands - Foonetic
Serenity-IRC - ChanServ
Registering a channel on freenode | staffblog
IRC/Instructions - Meta

irssi auto-connect and auto-identify « boltblog 

2013年5月22日 星期三

hybserv Server Error: Server ID already exists.

hybserv error log
Thu May 23 13:28:47 2013 Connecting to 127.0.0.1[127.0.0.1] tcp/6667
Thu May 23 13:28:47 2013 Connected to 127.0.0.1 tcp/6667
Thu May 23 13:28:47 2013 Server Error: Server ID already exists.
Thu May 23 13:28:47 2013 Server Error: Closing Link: localhost (Server ID Exists)

hybserv success connect log
Thu May 23 13:39:05 2013 Opened log file successfully
Thu May 23 13:39:05 2013 Hybserv2 TS services version 1.9.4-release started
Thu May 23 13:39:05 2013 Databases loaded (0 registered nicknames, 0 registered channels, 0 memo entries)
Thu May 23 13:39:05 2013 Connecting to 127.0.0.1[127.0.0.1] tcp/6667
Thu May 23 13:39:05 2013 Connected to 127.0.0.1 tcp/6667
Thu May 23 13:39:05 2013 New Max Operator Count: 5


ircd-hybrid 的 server name 有重複到,把他改成不一樣的
# vi /etc/ircd-hybrid/ircd.conf
serverinfo {
        name = "example.com";
};

connect {
  name = "irc-services.example.com";
};

2013年5月21日 星期二

ircd-hybrid with ssl

$ mkdir hybrid
$ cd hybrid
$ apt-get source ircd-hybrid
# apt-get build-dep ircd-hybrid
# apt-get install openssl libssl-dev fakeroot
$ cd ircd-hybrid-*
$ USE_OPENSSL=1 fakeroot debian/rules binary
# dpkg -i ircd-hybrid_.ssl1_.deb





Reference :
Setting Up ircd-hybrid and hybserv services with SSL on Ubuntu - MarvelServ
ircd-hybrid with ssl_距离_百度空间

irc command

Connect
connect to a server
/connect irc_server_name

disconnects server
/disconnect irc_server_name

Channel
join to a channel
/j #channelname


leave channel
/wc
or
/part

Chat room
list windows
/window list

show user in channel
/who

set status in channel
/me waves hello

private chat with user
/msg user1 hello

change nickname
/nick user_2

Admin
login
/oper

Permissions
Gives channel ops to a user
/op user1

Removes channel ops from a user
/deop user1

Channel
set channel topic/topic Welcome to my channel

sets up a channel password

/mode #channel +k secret_password

Help
show help
/help

Hide join part messages
/ignore #channel MODES JOINS PARTS QUITS NICKS

or

/ignore -channels #channel1,#channel2,#channel3 * JOINS PARTS QUITS

no ignore
/unignore #channel MODES JOINS PARTS QUITS NICKS




Reference :
#Beginner - IRC Commands, the Basics
irc channel administration - Public: Concord Software Projects - Confluence
freenode: using the network 

2013年5月16日 星期四

linux iw create virtual wireless network interface

create virtual interface
# iw dev interface add type [mesh_id ] [4addr on|off] [flags *]

or

# iw phy interface add type [mesh_id ] [4addr on|off] [flags *]


The field is where you define what sort of interface you're creating. It is one of:




Reference :
Wireless Utilities - OpenWrt Wiki

vif - Linux Wireless

2013年5月14日 星期二

# vi /etc/passwd
:%s/\(\(:.\{-}\)\{4}\)/\1 /

在第四個 : 後面加上空格




Reference :
Vim中的非贪婪匹配 | 湖间小筑

2013年5月13日 星期一

Linux Gnu Screen / tmux shortcuts


screen tmux
list session $ screen -ls $ tmux ls
attach session $ screen -r $ tmux a -t [target-session]
detach $ screen -d [host.tty]
[Ctrl+a] d
[Ctrl+b] d
new window [Ctrl+a] c [Ctrl+b] c
close window [Ctrl+a] k [Ctrl+b] &
list window [Ctrl+a] " [Ctrl+b] w
name window [Ctrl+a] A [Ctrl+b] ,
help [Ctrl+a] ? [Ctrl+b] ?
move window :number [0-9]
jump prev window [Ctrl+a] p [Ctrl+a] p
jump next window [Ctrl+a] n [Ctrl+a] n
jump window [Ctrl+a] [0-9] [Ctrl+b] [0-9]
split window (vertical) [Ctrl+a] S [Ctrl+b] "
split window (horizontal)
[Ctrl+b] %
jump panel
[Ctrl-a] tab 就可以切到下面的視窗,
[Ctrl-a] Ctrl-a 下面的視窗就可以到處切換,
[Ctrl-a] Q 就將分割的視窗關掉,
[Ctrl+b] [Up, Down, Left, Right]
resize panel
[Ctrl+b] [Alt + [Up, Down, Left, Right]]
set window title [Ctrl-a] :title window_name [Ctrl+b] ,
set session name [Ctrl-a] :sessionname the_session_name [Ctrl+b] $



























Reference :
screen 教學 | Tsung's Blog
tmux shortcuts & cheatsheet

2013年5月8日 星期三

Enterprise Miner 4.3 may not be used with this license.

ERROR: This installation is licensed for Enterprise Miner for Desktop.
Enterprise Miner 4.3 may not be used with this license.
Enterprise Miner 5.2 or later should be used with this license


Start ► Programs ► SAS ► Enterprise Miner ► Enterprise Miner.




Reference :

git push to google code fatal: remote error: Invalid username/password.

fatal: remote error: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings


確認設定的帳號是一模一樣的
$ git config -l
remote.origin.url=https://username@code.google.com/p/my_project/
$ cat ~/.netrc
machine code.google.com login username password ABCDEFGHIJ

2013年5月7日 星期二

Show progress during dd copy

tty 1
$ dd if=/dev/random of=/dev/null bs=1K count=100
0+14 records in
0+14 records out
204 bytes (204 B) copied, 24.92 seconds, 0.0 kB/s
 
 
tty 2 
$ pgrep -l '^dd$'
 
8789 dd 
$ kill -USR1 8789


$ watch -n 10 kill -USR1 8789




Reference :
Linux Commando: Show progress during dd copy

2013年5月6日 星期一

Gerrit auto publish and submit

$ ssh -p 29418 yan@yanxen.no-ip.org gerrit query --format JSON --current-patch-set status:open label:V=1 label:R=2 project:RWS_System

# ssh -p 29418 admin@yanxen.no-ip.org gerrit review --submit 9a48b3f46c6ddf6bbdcbe23c349802f6916bf5d1


// run after jenkins build and add comment
$ vi /home/gerrit/review_sites/hooks/comment-added
#!/usr/bin/python

# auto submit after jenkins verified
# for Gerrit 2.5

import json, sys
from subprocess import Popen, PIPE

username = "jenkins"
server = "localhost"

verified_min = 1
reviewed_min = 2

results = Popen([
"ssh", "-p", "29418", username+"@"+server, "gerrit", "query",
"--format", "JSON", "--current-patch-set", "--commit-message",
"--files" , "status:open", "label:V="+str(verified_min), "label:R="+str(reviewed_min)], stdout=PIPE).communicate()[0]

parsed = json.loads(results.split("\n")[0])

if parsed:
    commit = parsed['currentPatchSet']['revision']
    results = Popen([
"ssh", "-p", "29418", username+"@"+server,
"gerrit", "review", "--submit", commit], stdout=PIPE).communicate()[0]




Reference :
From blue skies and oceans — Configuring Gerrit to auto-submit on patch approval

2013年5月2日 星期四

run script after git clone

$ mkdir -p ~/.git/hooks

$ vi ~/.git/hooks/post-checkout
#!/bin/sh                                                                                                                    


echo "Project : $0"
echo "Working on `pwd` ..."

git config remote.origin.push refs/heads/*:refs/for/*


echo "Get Hooks ..."

HOOK_DIR='.git/hooks'

echo "  - commit-msg"
wget -P $HOOK_DIR -q http://yanxen.no-ip.org:8081/tools/hooks/commit-msg

chmod u+x -R $HOOK_DIR

$ chmod u+x -R ~/.git/hooks

$ git clone --template=/home/user/.git ssh://user@gerrit.server:29418/my_project

git-review for Gerrit

$ cd my_project

$ vi .gitreview
[gerrit]
host=gerrit.server
port=29418
project=my_project

$ git review -s

$ echo hello > world
 
$ git add world

$ git commit -m 'hello world'
 
$ git review  // 代替 git push





Reference :
gerrit with jenkins : installation and configuration | Loïc Dachary


Further:
隨手誌: git push到gerrit review server的方法與設定

2013年5月1日 星期三

missing Change-Id in commit message

下載生成 Change-Id 的 hook
$ scp -p -P 29418 user@gerrit.server:hooks/commit-msg .git/hooks/

or 

$ cd .git/hooks ; wget http://gerrit.server:8081/tools/hooks/commit-msg ; chmod u+x commit-msg


重新 commit
$ git commit --amend




Reference :
missing Change-Id in commit message
git - Gerrit error when Change-Id in commit messages are missing - Stack Overflow

Gerrit query verified

command :
$ ssh -p 29418 yan@gerrit.server gerrit query --format JSON --current-patch-set --commit-message --files status:open label:V=1 label:R=2

http :
http://gerrit.server/#/q/is:open+Verified>=1+-Verified<=-1+CodeReview>=1+-CodeReview<=-1+branch:master+reviewer:green+age:3d,n,z


Reference :
Gerrit Code Review - Searching Changes
gerrit query

Useful Gerrit Searches - HPDD Community Space - HPDD Community Wiki