Skip to main content

Posts

Showing posts from 2010

a little fun with bash

The fun of Linux is that you can configure it as you want. This post is about some config i made. 1.color vim ~/.bashrc add this line:    PS1='\[\033[1;32m\]\u\[\033[1;32m\]@\h >>\[\033[0;34m\]\w\$ \[\033[1;36m\]' save and quit. close the terminal and open a new one. Now it's colored. more HowTo and color in here . 2. show somthing open opening terminal (like the Linux Mint) vim /.bashrc  add command lines save and quit. examples: 1.calendar  add /usr/bin/cal in .bashrc. 2.fortune sudo apt-get install fortune-zh  (for others languages, aptitude seacrh them) add  /usr/bin/fortune-zh in .bashrc. 3.cowsay and others sudo apt-get install cowsay  add fortune-zh | cowsay   in .bashrc.

aes,gpg,encrypt, man etc

-Who is the most controversial man in the world recently? -Definitely it's Julia Assange . WikiLeaks had released a package of file encrypted with AES. What shall we do right now? yeah! download it and wait for the passphrase! So let's have a little try at encrypting in Ubuntu. GPG  here is sample file another_file. 1.gpg -c filename enter a passphrase.Now the file is encrypted. 2.gpg filename.gpg AES     Download AESCrypt here.     extract the package with         tar xzvf filename     then         make         sudo make install     I haven't tried aescrypt yet. But you can make it with a simple command. Just go to their home page. Others things: Chinese man page. while downloading source file of aescrypt, i found that they provide a manpage file. So making 'man aescrypt' working in terminal became a problem. After googling, I resolved it. And in additionl, I found a way to use man in Chinese. where is manpage file ?     they are in

ffmpeg notes

ubuntu下录屏的软件很多,recordmydesktop、istanbul、wink啊什么的。 不过好像很多geek录制tutorial时都是用ffmpeg的,于是我也想折腾一下。 之前apt-get的ffmpeg貌似是不能x11grab的。 按照网上的教程complie,也是从来没有成功过=。=! 还好在网上发现个script,可以安装ffmpeg和x264.下载地址如下: http://code.google.com/p/x264-ffmpeg-up-to-date/downloads/detail?name=ffmpeginv1.4.sh 运行scrip,一路yes,大概5-10分钟就可以装好了。 >录制视频: $ffmpeg -r 30 -s 1280x1024 -f x11grab -i :0.0 -vcodec mpeg4 -qscale 1 ~/output.avi -r 是rate,应该是帧率的意思。30就是每秒30帧。 -s 是size,1208x1024是我的显示屏分辨率大小,也就是录制全屏了。 -f x11grab 是开启录制功能。ps:需要的编译时enable,用脚本安装的就自动有了。 -vcodec mpeg4视频编码。 -qscale 1 是视频质量,数字越小质量越好。 ~/output.avi是输出文件名。 >录制窗口 先要获取窗口大小和位置。 $xwininfo 提示选择要获取的窗口,点击完成。 运行结果如图: -geometry 902x587+143+99 就是所选窗口的大小及位置。 ffmepg命令就这样写: $ffmpeg -r 30 -s 902x588 -f x11grab -i :0.0+143,99 -vcodec mpeg4 -qscale 1 ~/output.avi 录制video+audio(via micophone): ffmpeg -f oss -ac 2 -i /dev/dsp -f x11grab -r 30 -s 900x554 -i :0.0+199,249 -vcodec mpeg4 -qscale 1 ~/output.avi q键退出录制。

auto input pwd while ssh

As ssh became my first choice for going over GFW, a auto connected ssh tunnel is badly required. what i did for a long time is adding a application launcher whose property is set as "ssh -D port usr@host" to the panel. the tunnel will be established with one click and some pwd typing. I googled and find EXPECT. Step One: $sudo apt-get install expect Step Two: $vim ssh //create a new script. Step Three: //Input in Vim #!/usr/bin/expect spwan ssh -D port usr@host; expect "*password:"; send "pwd\r"; interact; //{esc};:wq;{enter} to save the file. Step Four: $chmod +x ssh Step Five: ./ssh Now the script will connect to ssh server automatically without requiring the pwd.

bitlbee: twitter in irc

dedicate to @sychopx, without her instruction, this wouldn't be done. from BitlBee Home Page What is BitlBee? BitlBee brings IM (instant messaging) to IRC clients. It's a great solution for people who have an IRC client running all the time and don't want to run an additional MSN/AIM/whatever client. BitlBee currently supports the following IM networks/protocols: XMPP/Jabber (including Google Talk), MSN Messenger, Yahoo! Messenger, AIM and ICQ, and the Twitter microblogging network (plus all other Twitter API compatible services like identi.ca and status.net). 很明显的说了,bitlbee是把IM转成IRC的形式,非常适合整天开着irc而又不想开msn/aim的人。 目前bitlbee支持XMPP/Jabber (包括 Google Talk), MSN Messenger, Yahoo! Messenger, AIM and ICQ, and the Twitter 。 记录一下自己在ubuntu上折腾bitlbee的过程: 要准备的东西:irc客户端(这里用的是irssi) 插曲:因为看错了这个东西的名字,少看了个“l”,以为是“bitbee”,所以在ubuntu apt安装是一直找不到。事实上,bitlbee已经包含在ubuntu源里了。另外,据@sychopx says, in fact you don't have to install it to use it. it's already implemented on the server. all you n