Skip to content

Instantly share code, notes, and snippets.

@holys
Last active December 11, 2015 04:48
Show Gist options
  • Save holys/4547375 to your computer and use it in GitHub Desktop.
Save holys/4547375 to your computer and use it in GitHub Desktop.
practice *nix command line
@holys
Copy link
Author

holys commented Jan 16, 2013

whois  domain 

@holys
Copy link
Author

holys commented Jan 16, 2013

wget -m url 镜像下载?

@holys
Copy link
Author

holys commented Jan 16, 2013

whatis --display manual page descriptions

@holys
Copy link
Author

holys commented Jan 16, 2013

@holys
Copy link
Author

holys commented Jan 16, 2013

fg  n

bring job n to foreground

@holys
Copy link
Author

holys commented Jan 16, 2013

tar  tf  file.tar

show contents of archive

@holys
Copy link
Author

holys commented Jan 16, 2013

gzip  file 

compress file and rename to file.gz , so no more file itself but remain file.gz

gzip -d file.gz 

decompress file.gz to file

@holys
Copy link
Author

holys commented Jan 16, 2013

ctrl + d

log out of current session
so does exit

@holys
Copy link
Author

holys commented Jan 16, 2013

!!

repeat last command

@holys
Copy link
Author

holys commented Jan 17, 2013

force a user to log out .
find its process .
run w to see who is logging in

 w
 18:52:40 up 10:52,  1 user,  load average: 0.00, 0.01, 0.05
USER     TTY        LOGIN@   IDLE   JCPU   PCPU WHAT
david    pts/0     18:48    0.00s  0.14s  0.00s w

then find the process of pts/0 .

ps -dN |grep pts/0

e.g:

% ps -dN |grep "pts/0"
 9287 pts/0    00:00:00 zsh

then kill 9287 process

sudo kill -9 9287

@holys
Copy link
Author

holys commented Jan 17, 2013

let virtualenv use different python version

virtualenv -p  /path/to/different/python   env

e.g
virtualenv -p $HOME/mybin/bin/python env

@holys
Copy link
Author

holys commented Jan 19, 2013

setuptools/easy_install

pip

@holys
Copy link
Author

holys commented Jan 19, 2013

安装python package 的方式

  • 对于源码包, .tar.gz 样的, 先解压, 进入目录, python setup.py install
    • 如果是系统python shell, 会安装到/usr/lib/pythonXX/site-packages/ 目录下,
    • 如果是自定义安装的python, 比如安装到用户目录下比如$HOME/mybin , package则相应地被安装到 $HOME/mybin/lib/pythonXX/site-packages
  • 对于打包好的.egg安装文件, 可以使用easy_install 命令安装,
easy_install   foo.egg
  • 对于在线安装(来自pypi), 可以使用easy_install 或者pip
    推荐 pip , pip install package_name

    pip freeze 列出已经通过pip安装的模块. 可以导出到一个文件 如requirements.txt (名字任取), 可以快速恢复安装之前的模块, 如 pip install -r requiments.txt

@holys
Copy link
Author

holys commented Jan 19, 2013

pacman 更新失败的解决办法, 一般是文件冲突的, 删除, 或者不更新这个包 --ignore package , 暴力点就说 -f

@holys
Copy link
Author

holys commented Jan 22, 2013

sudo mkdir /media/usb
sudo mount -t vfat  /dev/sdb /media/usb
cd ~ 
sudo umount /dev/sdb

@holys
Copy link
Author

holys commented Jan 22, 2013

groups [user]
id [user]   // provide addtional information like UID & GID
cat /etc/group 
# groupadd  [group]  // create new group with root privilege
# groupdel [group]
# gpasswd -a [user] [group]  // add users to a group
# gpasswd -d [user] [group]  //remove users from a group

@holys
Copy link
Author

holys commented Apr 3, 2013

库python的没用过,说说图像处理的思路吧

1,拿图(废话)
2.图拿到后,直接灰度化+二值化一次
3.由于基本无噪声且无粘连现象,对于二值图垂直投影一次,得到投影曲线
4.投影曲线找凹点,切为4个区域,
5.每个区域找上下左右边界,切割
6.尺寸归一化
7.识别--办法很多,我刷了几次,只有数字字母,做个模板库,比对吧;复杂的就要分类了,分类就有很多高深方法了,svm,神经网络,特征统计...具体实现跟方法就有关系了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment