preload
Feb 24

JosephJ 隞蝝 zsh 憟賢敺憟賜剁潭臬停蝯 OS X 閮剖瑼銝靘閰衣拐銝銝
$ curl http://stuff.mit.edu/~jdong/misc/zshrc-osx-blackonwhite > ~/.zshrc
蝯閰西銝 ls 潛暹鈭航炊嚗潭舀 ~/.zshrc ll, ls 抵 alias 閮餉圾韏瑚嚗撠曹航炊閮臭

Tagged with:
Nov 12

Action

apt-get command

aptitude command

Install foo

apt-get install foo

aptitude install foo

Search foo

apt-cache search foo

aptitude search foo

Remove foo

apt-get remove foo

aptitude remove foo

List reverse dependencies

apt-cache rdepends foo

aptitude ~D foo

Print information on priorities for foo

apt-cache policy foo

?

Download foo’s sources and build a binary .deb package

apt-get source –compile foo

?

How to upgrade your distribution
Find out current version of Debian that you are running:

cat /etc/debian_version

Example for upgrading sarge to etch or etch 4.0r1 to 4.0r2 …etc

aptitude update
aptitude dist-upgrade

靘皞嚗Aptitude – Debian Wiki

Tagged with:
Nov 12

箇 Leopard 批遣 Python 其璅∪銝銝剜憿
隞乩 MacPorts 鋆 Python 2.6嚗鋆憟賭敺箇
To fully complete your installation and make python 2.6 the default, please run

sudo port install python_select
sudo python_select python26

python_select嚗Switch the default python interpreter


隞斤扳瘝=.=

航芸楛雿蝯瘥頛靽

cd /usr/bin/
sudo ln -s /opt/local/bin/python python
Tagged with:
Nov 05
  • 靘銵撌乩閬
    • 冽瘜冽璈踵澈皞澆漲臬阡拐葉嚗拇潔蜓璈雿
    • 閮摰梯”頛詨箸瘥鈭箏臬唬遢詻瘥隞賣憭批捆航撓箏梯”蝔桅嚗摮瑼蝔撘瑼佗蝑閬
    • 餃萎辣嗥潛恣嚗閮摰摮曉銋靽∩辣芷歹隞亙雿函蝣蝛粹
    • 蝬剜璈踵湔嚗摰脰皜瞏撌乩銝臬冽輸ㄡ憌貊
    • 摰撠蝟餌絞雿瘜雿蝝隞乩噶亙亥岷
    • 閮摰璈蝔摨
    • 摰瑼X亙瑼獢蝟餌絞嚗撠銝敹閬瑼獢芷歹隞亙雿典云憭蝤蝣蝛粹
  • 梢閮剖憓皜銋閬
  • 雿輻刻撣唾蝞∠
    • 啣芷文仃銝函雿輻刻撣唾
    • 撌乩扯釭詨撌乩蝢斤雿輻刻撣唾
      • 閮剖銝撌乩蝢支蝙刻撣唾蝤蝣雿輻函征
    • 閮摰雿輻刻撣唾
    • 撣唾雿輻刻撠刻擃雿輻函甈
    • 雿輻刻撣唾撖蝣潛湔啗蝬剛風
    • 摰隞賭蝙刻鞈瑼嚗隞亦雁霅瑚蝙刻甇撣詨極雿 蝜潛梯 »
Tagged with:
Nov 03

-h”Human-readable” output. Use unit suffixes: Byte, Kilobyte, Megabyte, Gigabyte, Terabyte and Petabyte.
-sDisplay an entry for each specified file. (Equivalent to -d 0)
-ddepth
Display an entry for all files and directories depth directories deep.


芸箇桅憭批嚗

du -sh ~/Documents/EyeTV\ Archive/

3.2G /Users/name/Documents/EyeTV Archive/


箇桅鋆∟府撅斗瑼獢憭批嚗

du -sh ~/Documents/EyeTV\ Archive/*

4.0K /Users/name/Documents/EyeTV Archive/EyeTV Archive.xml
4.0K /Users/name/Documents/EyeTV Archive/EyeTVAutoTune.log
3.2G /Users/name/Documents/EyeTV Archive/勗葆擳 – 桀桀.eyetv
25M /Users/name/Documents/EyeTV Archive/隡蝝W拙 – 蝚17嗆脣怠⊿摮撅梯惇.eyetv

Tagged with:
Oct 21

箏極雿閬銝 PDF 隢頧嚗Mac OS X 10.5 Leopard 批遣璈其犖 Automator 璅撌乩瘚蝔臭誑憟剁雿隞憭拇蹂銝 18 隢靘頧曹憟賢嗾

憒 ImageMagick 芾 10 撟曄嚗

lauct$ time convert example.pdf example.jpg
 
real	0m13.767s
user	0m9.945s
sys	0m0.821s

OSX 瘝批遣 ImageMagick嚗臭誑 MacPorts 摰鋆嚗閮敺閬鋆Ghostscript嚗銝憪撠望臬閮 GS 銝韏瑞楊脖瘝颲行頧

lauct $ sudo port
MacPorts > install  ImageMagick +gs
MacPorts > exit

亥死敺閮剖潸箔銝憭蝎曄溶閰梧啣臭誑銝鈭詻

lauct$ convert -verbose -colorspace RGB -resize 1024 -interlace none -density 300 -quality 95 example.pdf example.jpg

頧箔嚗
霈敹甇行剔蝝璅憭U閰祉摮詻
霈敹甇行剔蝝璅憭U閰祉摮詻

Tagged with:
Oct 07

潛暹鈭 Linux 銝 pidof 隞文臭誑敺瑁銝剔摨pid

OSX 銝行批遣隞歹嗆仿 ps aux | grep XXX 銋臭誑啁詨踝Y憿舐內蝯銝憭銋暹楊

閰西餅 pidof source code 靘蝺刻陌嚗雿蝺其韏瑚XD

撟詨末嗡擃靘鈭 scrpit

冽迨蝭蝔撘蝣潔誑鞈嚗
Shell Script嚗

1
2
#!/bin/sh
ps axc|awk "{if (\$5==\"$1\") print \$1}";

Perl嚗

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl
 
@procs = `ps -x`;
 
for $proc (@procs ) {
    if( $proc =~ /\s+(\d+)\s+\S+\s+\S+\s+\S+\s+(\S+)/ ) {
	$pid = $1;
	$name = $2;
	if( $name =~ /$ARGV[0]/ ) {
	    print "$pid ";
	}
    }
}
 
print "\n";

link嚗macosxhints.com – Create a pidof command to find PID numbers easily

Tagged with: