Category: Uncategorized

Env for scripts interpreter searching

Posted by – February 15, 2012

#!/usr/bin/env bash
Probably the most common use of env is to find the correct interpreter
for a script, when the interpreter may be in different directories on
different systems.  The following example will find the `perl’ inter-
preter by searching through the directories specified by PATH.
1.  #!/usr/bin/env perl
One limitation of that example is that it assumes the user’s value for
PATH is set to a value which will find the interpreter you want to exe-
cute.  The -P option can be used to make sure a specific list of directo-
ries is used in the search for utility.  Note that the -S option is also
required for this example to work correctly.
2. #!/usr/bin/env -S -P/usr/local/bin:/usr/bin perl
The above finds `perl’ only if it is in /usr/local/bin or /usr/bin.  That
could be combined with the present value of PATH, to provide more flexi-
bility.  Note that spaces are not required between the -S and -P options:
3. #!/usr/bin/env -S-P/usr/local/bin:/usr/bin:${PATH} perl

#!/usr/bin/env bash
Probably the most common use of env is to find the correct interpreter     for a script, when the interpreter may be in different directories on     different systems.  The following example will find the `perl’ inter-     preter by searching through the directories specified by PATH.
1.  #!/usr/bin/env perl     One limitation of that example is that it assumes the user’s value for     PATH is set to a value which will find the interpreter you want to exe-     cute.  The -P option can be used to make sure a specific list of directo-     ries is used in the search for utility.  Note that the -S option is also     required for this example to work correctly.
2. #!/usr/bin/env -S -P/usr/local/bin:/usr/bin perl
The above finds `perl’ only if it is in /usr/local/bin or /usr/bin.  That     could be combined with the present value of PATH, to provide more flexi-     bility.  Note that spaces are not required between the -S and -P options:
3. #!/usr/bin/env -S-P/usr/local/bin:/usr/bin:${PATH} perl

C++ Primer the fourth Edition

Posted by – September 28, 2011

See http://jinlab.com/website/cpp/

vim remotely edit using scp/sftp/ftp/rsync etc.

Posted by – July 22, 2011

Here:
http://vimdoc.sourceforge.net/htmldoc/pi_netrw.html#netrw

e.g.:
vim scp://jinlab.com// path/to/file

ssh login without enter password/passphrase every time.

Posted by – July 21, 2011


http://www.ibm.com/developerworks/library/l-keyc2/
http://www.gentoo.org/doc/en/keychain-guide.xml
http://vimdoc.sourceforge.net/htmldoc/pi_netrw.html#netrw-ssh-hack

Keychain:
http://docs.funtoo.org/wiki/Keychain

Perl install module from CPAN

Posted by – July 20, 2011

For example:

perl -MCPAN -e ‘install File::List’
Or:
1. perl -MCPAN -e  shell # to enter into perl install module command line
2. Enter:
install File::List

[jin@jinlab]$ sudo perl -MCPAN -e shell

[jin@jinlab]$ sudo perl -MCPAN -e shellTerminal does not support AddHistory.

cpan shell — CPAN exploration and modules installation (v1.7601)ReadLine support available (try ‘install Bundle::CPAN’)
cpan>

Ubuntu中pdf的乱码问题

Posted by – October 12, 2010

Ubuntu下pdf中文乱码的解决办法
办法一:

使用命令:

[bash]
sudo apt-get install xpdf-chinese-simplified xpdf-chinese-traditional
[/bash]

如果仍然中文乱码的话,需要安装poppler-data, 并且删除/etc/fonts/conf.d/49-sansserif.conf
使用命令:
[bash]
sudo apt-get install poppler-data
sudo cp /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak
sudo rm /etc/fonts/conf.d/49-sansserif.conf
[/bash]

选择PDF文件,点击右键,选择XPDF打开即可。

办法二:

安装Foxit Reader for desktop Linux

Foxit Reader is a free PDF document viewer for the Linux platform. 提供一个deb包很方便。
附件:
FoxitReader_1.0-1_i386.deb [3.25 MiB]
下载地址
http://forum.ubuntu.org.cn/download/file.php?id=64192
安装完成后,运行命令FoxitReader,打开PDF阅读器。

Rename Ubuntu box name

Posted by – September 14, 2010

On terminal:
[bash]
$ sudo vi /etc/hosts
$ sudo vi /etc/hostname
$ reboot
[/bash]

Refers to:
http://wiki.ubuntu.org.cn/%E6%9B%B4%E6%94%B9%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%90%8D

Top 10 security plugins for wordpress

Posted by – September 6, 2010

Refers to:
http://speckyboy.com/2008/04/08/top-10-security-and-protection-plugins-for-wordpress/#comment-311102

10款安全保护类插件分别有:WordPress Database Buckup(WP备份插件)Semisecure Login(加强登录保护)Ask Apache Password ProtectForce SSL(强制SSL)WP Security Scan(安全扫描)Secure FilesWP-SpamFree(防垃圾留言)BackUpWordPress(备份WordPress)Anonymous WordPress Plugns Updates(匿名WordPress插件更新)Replace WP-version(替换WP版本).

A foreign girl quiting email

Posted by – September 3, 2010

A quiting email from a foreign girl:
Refers to:
http://user.qzone.qq.com/732952649/share/1283421397
Happy Monday everybody!
I quit!
I’ve learned a lot these past 2 years and I’m going to miss all of you.
execpt one I’m looking @ you Spencer.
Being your assistant’s been a special hell.
I put up with your temper and your bad breath.
Becuase I wanted to be a broker.
On Friday I transferred you a call, I was about to hang up when I
heard you call me a HOPA.
HOPA?? H–O—P–A–
Hot Piece Of Ass.
Is that really all you thought of me?
Did you ever wonder… Why everybody in the office called the trash
a garbage diSpenver?
Office Morale is down since you installed the ‘Littel office switch.
So you could monitor how we spend our time  noline.
So I wondered “How dose Spencer spend hist time online?
You gave Me the codes after all.
4 hrs./week Scottrade
5.3 hrs./week TechCrunch
and Drumro!!!
19.7 hrs./week playing FARMVILLE.
Wow
So this HPOA’s Moving on
although I don’t have another job.
Something tells Me I’ll be just fine

写给新入IT的新人们

Posted by – August 3, 2010

Refers to:
http://iove.net/733/