Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 LINUX/UNIX


  10 tools to make your shell script more powerful

Many people mistakenly think that shell scripts can only be run in command line. In fact shell can also call some GUI components such as menus,alert dialogs, progress bar etc. You can control the final output, cursor position and various output effects. Here we introduce some tools which can help you create powerful, interactive and user friendly Unix/Linux shell scripts.1. notify-sendThis command can let you inform the process to send a desktop notification to users. This can be used to send prompt to users or display some information to users. You can download it :$ sudo apt-get install libn...

6,978 0       GUI SHELL ZENITY


  Build RPM package on Linux

1. Check the OS version and core version#uname -a#more /etc/redhat-release2. Create relative directories/usr/src/redhat/SOURCES    //Store source codes, patches, icons etc/usr/src/redhat/SPECS        //Store specs about the process of building RPM packages/usr/src/redhat/BUILD     //File after uncompressed are stored here/usr/src/redhat/RPMS     //Store the binary files built with rpmbuild/usr/src/redhat/SRPMS   //Store source code package built with rpmbuild #mkdir -p /usr/src/redhat/#cd /usr/src/redhat/...

5,970 0       LINUX BUILD RPM


  Linux Clock : CST,UTC and NTP setup

1. There is an option when you set up clock on installing Linux: system clock users UTC, so what does UTC mean?It's Universal Time Coordinated(UTC), there are two different times in GPS system: one is UTC , the other one is LT(Local Time). The difference between these two is just the timezone difference, UTC is the time in timezone 0. If the local time in Beijing is 8 o'clock in the morning, then UTC time is 0 o'clock, which is a 8 hour difference.2. In Linux, when we use date to check the time, we may get 17 December,2008 Wednesday 09:04:14 CST. What does CST ,mean here?CST is China Standard ...

21,522 0       LINUX CLOCK UTC


  How to find which process a file is being written by in Linux?

Some people ask a file is being written by one process and they want to check this process, but they cannot find the process even with sof.This question is very common and there are many solutions, here we introduce a straightforward method. In Linux, each file will be stored on one device and of course there will be a relative inode, then we can use vfs.write to know who is writing the inode on one specified device continuously. Luckily there is inodewatch.stp in the installation package of systemtap, it locates at /usr/local/share/doc/systemtap/examples/io. It is used foe above.Let take a lo...

4,576 0       LINUX PROCESS FILE WRITE


  /dev/null and /dev/tty in Linux

In Linux, there are two special files /dev/null and /dev/tty. /dev/null will drop all the data written to it, i.e, when program writes data to this file, it means the program has completed the data write operation. But in  fact it does nothing, if you just want the status of a command but not the output of a command, this feature will be very useful. See below shell codes:    /> vi test_dev_null.sh        #!/bin/bash    if grep hello TestFile > /dev/null    then        echo "Foun...

15,930 0       LINUX /DEV/NULL /DEV/TTY


  Convert time to Unix time

Unix time is defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), 1 January 1970,not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. It is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on some Unix systems by typing date +%s on the command line.Sometimes it's a bit difficult to compare times stored in different applications or systems with different formats. For example, if we want to compare a DATE in Oracle with a date string in Unix, we...

6,537 0       UNIX TIME ORACLE DATE CONVERSION TIMESTAMP


  Some useful Linux commands for teamwork

A small development team in the intranet will frequently transfer codes, share files. Here are some command we use frequently to release some of our work. They are not applicable to Windows users.1. Output program execution output through GTalk.Sometimes we may need to send the program execution result and log to teammates for debugging using IM. These outputs are very troublesome to copy and send while in command line mode. So we could have a program called gpipe.py which can put GTalk as a pipe after one program. For example:make 2>&1 | gpipe tinyfoolWith this line, The GTalk client o...

2,392 0       LINUX HTTP NFS GTALK


  Big file transfer in Linux

It's very common that we need to transfer files between two different hosts such as backups. It is also an very simple task, we can use scp or rsync to complete the task well. But what if the file is very big, it may take some time to transfer it. How can we transfer a big file with high speed? Here we propose one solution.Copy fileIf we copy one uncompressed file, then we should follow below steps:Compress dataSend it to another hostUncompress the dataVerify the data integrityThis will be very efficient and it also saves bandwidth.With ZIP+SCPWe can combine ZIP and SCP to achieve this.gzip -c...

7,458 0       LINUX SCP ZIP