RSS feed [root] /unix /weblog



title search:


Mon Feb 17 20:40:19 HKT 2020


(google search) (amazon search)
download zip of files only

Thu Jan 30 11:08:46 HKT 2014 From /weblog/unix


An article to share how to organizate files as well as daily task, his approach is difference from me, but still worth to take a look

In contrast to the author experience, categories work for me. Spotlight or google desktop doesn't add value, I can just find it.

(google search) (amazon search)

Sat Jan 18 17:09:47 HKT 2014 From /weblog/unix


An example of how to do document convertion in batch at shell using openoffice:[..]/01/11/from-microsoft-to-openoffice.html

Tip for calc for libreoffice -

Using Draw to edit PDF in linux -[..]iting-a-pdf-sorta-on-ubuntu-2013-edition

Using stardict at command line -[..]mand-line-dictionary-at-your-fingertips/

(google search) (amazon search)

Wed Apr 24 12:25:42 HKT 2013 From /weblog/unix


Using SSh tunneling at RMI -[..]alventosa?entry=using_the_ssl_tls_based1

Use sshd as proxy -

putting ssh password in command line -

how-to-disable-ssh-host-key-checking -[..]ow-to-disable-ssh-host-key-checking.html

Having batch with ssh for interactive command -[..]4/one-liner-to-shutdown-remote-host.html

Cat output to a new file in single line -[..]e-liner-to-copy-text-to-remote-host.html

(google search) (amazon search)

Fri Mar 01 09:25:37 HKT 2013 From /weblog/unix/script


Convert PDF to set of image as slide show -

pdftk, extra pages from one pdf to another pdf -[..]2/splitting-up-is-easy-for-pdf-file.html

(google search) (amazon search)

Sun Dec 23 00:56:52 HKT 2012 From /weblog/unix/script


tr, useful string tranformation tool -

(google search) (amazon search)

Mon Oct 01 16:58:55 HKT 2012 From /weblog/unix


In Solaris, we can get stack trace even if binary is not compile with debug symbol, just run gdb with coredump: "gdb binary core", then can use "where" command in GBD console for that

Look like "bt" give you some result -

A quick tutorial of GDB -

Use objdump to analysis the object file -

(google search) (amazon search)

Sat Jul 14 11:29:00 HKT 2012 From /weblog/unix


Built-in checksum tool - cksum

Disable root password -[..]le-and-disable-ubuntu-root-password.html

How can we fine tune permission more than chmod -

1. From a shell account on a Unix box behind the firewalled network do this:

ssh -N -R 3389:localhost:22

2. Leave work and go home. From a shell account on do this:

ssh -p 3389

(google search) (amazon search)

Wed Jan 25 00:42:37 HKT 2012 From /weblog/unix/script


Simulate user input -

(google search) (amazon search)

Wed Jan 25 00:40:32 HKT 2012 From /weblog/unix

ubuntu cheat sheet

(google search) (amazon search)

Sat Sep 03 11:37:14 HKT 2011 From /weblog/unix/script


Sort by column -[..]/unix-sort-command-example-tutorial.html

(google search) (amazon search)

Thu Aug 25 02:16:44 HKT 2011 From /weblog/unix/script


Create webserver with nc using bash[..]07/09/06/web-server-on-bash-in-one-line/

(google search) (amazon search)

Wed Aug 03 01:15:56 HKT 2011 From /weblog/unix


common log files -

(google search) (amazon search)

Tue Jul 12 01:11:20 HKT 2011 From /weblog/unix/script


(google search) (amazon search)

Thu Jul 07 23:54:28 HKT 2011 From /weblog/unix/script

useful example of shell script

xmlwf, need to know if a XML document is well formed? (A configuration file maybe..)
mkfifo is the coolest one. Sure you know how to create a pipeline piping the output of grep to less or maybe even perl.
nl, add number for every line of a file[..]/10-linux-commands-youve-never-used.html

======================================create real player song list
for file in `find $1 -type f`;
if(`/bin/cat $file | grep $win_path`); then echo $file;fi;
/usr/bin/find $MUSIC_SRC -type f -exec /bin/echo file://{} \; > $TMPDIR/tmp.rm
while read i ; do /bin/echo "$RANDOM $i" ; done < $TMPDIR/tmp.rm | /bin/sort -n | /bin/sed 's/^[0-9]* //' > $TMPDIR/tmp1.rm
/bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\///' >$HOME/mplayer.list
/bin/cat $TMPDIR/tmp1.rm |/bin/grep -vi wma >$HOME/real.rm
/bin/cat $TMPDIR/tmp1.rm |/bin/sed -e 's/file:\/\/\/var\/www\/html/http:\/\/'>/var/www/html/.secure/media/music/live.rm

======================================remove log
for file in `find -type f|grep website.|grep -v lck`;do rm -f $file;done
======================================for loop
for((a = 1; a <10; a++)); do wget -b "$a.jpg";done
======================================resize photo
for i in *.jpg; do convert -geometry 1024x768 $i newdir/$i ; done
======================================basic calculation
i=1;find|grep -v zng|grep -v avi|while read file;do mv "$file" $i.jpg;i=$((i+1));done
======================================# Make 3 a copy of 1 (stdout)
exec 3>&1
result="$(command to generate stream \
| tee /dev/fd/3 \
| command to process stream)"
# Now work with $result
# The original stream also went to the console[..]5/getting-more-from-streams-in-bash.html

(google search) (amazon search)

Wed Mar 16 21:22:12 HKT 2011 From /weblog/unix


Reference of rsync -

Backup the package list -

(google search) (amazon search)

Tue Feb 08 00:47:36 HKT 2011 From /weblog/unix


Linux Boot Process -

if you want to boot into something you can edit the boot parameters in grub:

"e" to edit
replace the boot parameters from ro xxxx xxxx to "rw init=/bin/bash"

and you'll be able to access a limited shell (no job control), then can run

ifconfig eth0 up

to bring up network.

If there is really disaster situation that grub fail, can try this to reinstall grub:

sudo mount /dev/sdXx /mnt
sudo mount -o bind /dev /mnt/dev
sudo mount -o bind /sys /mnt/sys
sudo mount -o bind /proc /mnt/proc
sudo chroot /mnt

Once at the prompt I reinstall grub:

grub-install /dev/sda
and then updated grub

then Ctrl-D twice to exit, and reboot.

(google search) (amazon search)

Sun Feb 06 23:11:59 HKT 2011 From /weblog/unix


Some tips for ibus showing enough font -

(google search) (amazon search)

Wed Jan 12 18:12:08 HKT 2011 From /weblog/unix


In fact a guide to map linux stuff to solaris -

Some more information about java, LD_LIBRARY_PATH and solaris -

Common errors -

(google search) (amazon search)

Fri Sep 18 01:33:07 HKT 2009 From /weblog/unix


Read Ext2/Ext3 partition from Windows -

Experience of switching to Linux, comment of OpenMP is interesting -

(google search) (amazon search)

Wed Feb 11 18:55:55 HKT 2009 From /weblog/unix/script


hint of using test -

(google search) (amazon search)

Tue Jan 06 11:41:30 HKT 2009 From /weblog/unix


(google search) (amazon search)

Tue Jan 06 11:02:30 HKT 2009 From /weblog/unix


According to , there are several virtualization tool available for linux. First I try QEMU / KVM, easy enough to setup but I cannot get the networking working for guest vista, the driver is up and saying run fine but cannot get IP. Then I try VirualBox, with using "Intel PRO/1000 MT" as driver, the network work fine and I can connect to the VPN

(google search) (amazon search)

Thu May 08 14:00:20 HKT 2008 From /weblog/unix/script


A working date calculation script[..]s/4870-days-elapsed-between-2-dates.html

(google search) (amazon search)

Thu Feb 15 16:45:24 HKT 2007 From /weblog/unix


From "man nc"

The nc (or netcat) utility is used for just about anything under the sun
involving TCP or UDP. It can open TCP connections, send UDP packets,
listen on arbitrary TCP and UDP ports, do port scanning, and deal with
both IPv4 and IPv6. Unlike telnet(1), nc scripts nicely, and separates
error messages onto standard error instead of sending them to standard
output, as telnet(1) does with some.

(google search) (amazon search)