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

 ALL


  Hello, Kernel!

When we learn module programming, the first small program must be hello, kernel!. For a novice, how do we avoid some mistakes and how to fix the bugs we have when writing the first module program? Is there any example we can refer to? Here is one example.1. Write the hello.c01#include <linux/init.h>02#include <linux/module.h>03#include <linux/kernel.h>04//Compulsory05//Module lincese declaration06MODULE_LICENSE("GPL");07//Module load function08static int hello_init(void)09{10    printk(KERN_ALERT "hello,I am edsionte\n");11   ...

3,431 0       LINUX MODULE KERNEL


  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,966 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,521 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,575 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,926 0       LINUX /DEV/NULL /DEV/TTY


  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,455 0       LINUX SCP ZIP


  Something you may not know about Shell

Shell is also called command line interface, it is the interface between *nix users and computer. Shell is a program which provides service to access OS kernel services.This article is to introduce some not so well known but useful and interesting knowledge about shell.Wikishell was born almost at the same time as Unix. The first UNIX shell was written by Ken Thompson in 1971 and its name is Thompson sh. It's older than Linux kernel.The default Shell in most *nix and MacOS is bash, bash was created by Brian Fox in 1987, the full name is Bourne Again shell(bash).There are other shells except ba...

5,026 0       LINUX COMMAND SHELL UNIX