RSS feed [root] /unix /weblog




login:

password:

title search:




 


Mon Feb 17 20:40:19 HKT 2020

unix



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

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

operation


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

http://www.onlamp.com/lpt/a/6377

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

http://www.thegeekstuff.com/2014/01/linux-sysadmin-books/

(google search) (amazon search)


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

openoffice


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

Tip for calc for libreoffice - http://www.thegeekstuff.com/2011/10/openoffice-calc-tips

Using Draw to edit PDF in linux - http://kryogenix.org[..]iting-a-pdf-sorta-on-ubuntu-2013-edition

Using stardict at command line - http://www.lainoox.com[..]mand-line-dictionary-at-your-fingertips/

(google search) (amazon search)


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

ssh


Using SSh tunneling at RMI - http://blogs.sun.com[..]alventosa?entry=using_the_ssl_tls_based1

Use sshd as proxy - http://rudygems.com/post/569787317/ssh-d-is-your-friend

http://www.thegeekstuff.com/2011/05/openssh-options

putting ssh password in command line - http://www.lainoox.com/ssh-password-command-line/

how-to-disable-ssh-host-key-checking - http://linuxcommando.blogspot.com.au[..]ow-to-disable-ssh-host-key-checking.html

Having batch with ssh for interactive command - http://linuxcommando.blogspot.com.au[..]4/one-liner-to-shutdown-remote-host.html

Cat output to a new file in single line - http://linuxcommando.blogspot.com.au[..]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

pdf


Convert PDF to set of image as slide show - http://ejohn.org/blog/easy-pdf-sharing/

pdftk, extra pages from one pdf to another pdf - http://linuxcommando.blogspot.com.au[..]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

string


http://www.thegeekstuff.com/2010/07/bash-string-manipulation

http://www.thegeekstuff.com/2010/11/strings-command-examples/

http://www.thegeekstuff.com[..]/01/regular-expressions-in-grep-command/

tr, useful string tranformation tool - http://www.thegeekstuff.com/2012/12/linux-tr-command/

(google search) (amazon search)


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

debug


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 - http://gbenson.net/?p=111

A quick tutorial of GDB - http://www.thegeekstuff.com/2010/03/debug-c-program-using-gdb

Use objdump to analysis the object file - http://www.thegeekstuff.com/2012/09/objdump-examples/

(google search) (amazon search)


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

security


Built-in checksum tool - cksum

Disable root password - http://www.debianadmin.com[..]le-and-disable-ubuntu-root-password.html

How can we fine tune permission more than chmod - http://man-wiki.net/index.php/3:cap_from_text

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

ssh -N -R 3389:localhost:22 user@remote-unix-box.net

2. Leave work and go home. From a shell account on remote-unix-box.net do this:

ssh 127.0.0.1 -p 3389

http://16systems.com/acls.txt

(google search) (amazon search)


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

xdotool


Simulate user input - http://pratyeka.org/fake-x-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


Sort by column - http://javarevisited.blogspot.com[..]/unix-sort-command-example-tutorial.html

(google search) (amazon search)


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

webserver


Create webserver with nc using bash

http://www.linuxscrew.com[..]07/09/06/web-server-on-bash-in-one-line/
http://paulbuchheit.blogspot.com/2007/04/webserver-in-bash.html

(google search) (amazon search)


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

path


common log files - http://www.thegeekstuff.com/2011/08/linux-var-log-files

(google search) (amazon search)


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

loop


http://www.thegeekstuff.com/2011/07/bash-for-loop-examples/

(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

http://bashcurescancer.com[..]/10-linux-commands-youve-never-used.html

http://www.thegeekstuff.com/2010/11/50-linux-commands/

======================================create real player song list
#!/bin/sh
win_path=C:/tools
linux_path=/mnt/disk/winapp
for file in `find $1 -type f`;
do
if(`/bin/cat $file | grep $win_path`); then echo $file;fi;
done;
/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:\/\/www.carfield.com.hk/'>/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 "http://www.thai.net/ferrari545/bbs_series/ku_bbs_000$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

http://binkley.blogspot.com[..]5/getting-more-from-streams-in-bash.html


(google search) (amazon search)


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

backup


Reference of rsync - http://www.thegeekstuff.com/2010/09/rsync-command-examples

Backup the package list - http://radio.javaranch.com/davo/2011/03/09/1299682981215.html

(google search) (amazon search)


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

boot


Linux Boot Process - http://www.thegeekstuff.com/2011/02/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
dhclient

to bring up network.

https://bugs.launchpad.net/ubuntu/+bug/430272/comments/24

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:

Code:
grub-install /dev/sda
and then updated grub

Code:
update-grub
then Ctrl-D twice to exit, and reboot. http://ubuntuforums.org/showthread.php?t=1677888

(google search) (amazon search)


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

i18n


Some tips for ibus showing enough font - http://forum.ubuntu.org.cn/viewtopic.php?f=8&t=297078

(google search) (amazon search)


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

solaris


In fact a guide to map linux stuff to solaris - http://www.tuxradar.com/content/opensolaris-vs-linux

Some more information about java, LD_LIBRARY_PATH and solaris - http://blogs.sun.com/darcy/entry/purging_ld_library_path

Common errors - http://www.darklab.net/resources/solaris/common_err.html

(google search) (amazon search)



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

win32


Read Ext2/Ext3 partition from Windows - http://www.diskinternals.com/linux-reader/

Experience of switching to Linux, comment of OpenMP is interesting - http://anteru.net/2009/09/14/604/

(google search) (amazon search)


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

test


hint of using test - http://www.ibm.com/developerworks/linux/library/l-bash-test.html http://binkley.blogspot.com/2009/02/speeding-up-cygwin-login.html


(google search) (amazon search)


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

font


http://blog.taragana.com[..]/archive/how-to-use-mac-fonts-on-ubuntu/

(google search) (amazon search)


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

virtualization


According to http://wiki.debian.org/SystemVirtualization , 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

date


A working date calculation script

http://www.unix.com[..]s/4870-days-elapsed-between-2-dates.html

(google search) (amazon search)


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

netcat


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.

http://www.onlamp.com/lpt/a/3771

(google search) (amazon search)