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

 ALL


  Format JSON data on Ubuntu

JSON now becomes a very popular data format because of its simplicity and light-weight. Nowadays many RESTful APIs will offer a choice of exchanging JSON data between the server and client. Sometimes the data may not be formatted and it cannot be easily read by human beings. It's frequently desired that the unformatted JSON data should be formatted before read.Today we will show a few ways to format JSON data on Ubuntu. Assume we have a json file test.json with below content.{ "title": "Test", "description": "Sample description" }The normal cat command will output below content.postman@postman...

27,663 1       UBUNTU LINUX RUBY PYTHON NODEJS PERL JSON JQ YAJL


  Mount DD image on Linux

Yesterday, my Raspberry Pi running Arch Linux was not able to boot with error: Kernel Panic, not syncing: no init found. I spent a night on it, but could not find a working solution. The last option is easy: reinstall the system. That is really the last resort, for I do not want to re-setup everything I have done: samba server, Time Machine server, Xunlei Offline Downloader…Unable to mount the SD cardThe system does not boot, so I need to find a way to get into the file system to identify what is wrong, or at least backup all the configuration files.I cannot directly mount it on my Mac,...

9,478 2       LINUX DD IMAGE


  Shortest command on Linux

Usually when we log in to a Linux system,. we may type some frequently used Linux commands such as pwd,ls, ps etc. All these commands are really simple but powerful with different options. But do you know what is the shortest command on Linux? The answer is w.According to Linux manual, w will show who is logged on and what they are doing on the system. w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages ...

9,375 0       W LINUX SHORTEST COMMAND


  A possible way to recover deleted files on Linux

Last week I was generating a MD5 sum for an virtual machine image on one OpenNebula server:# ls -l test.img-rw-r--r-- 1 root root 10486808576 Oct 12 02:21 test.img# md5sum test.imgAt the same time I was clearing the files on the server on another terminal and deleted the above image file mistakenly with :# rm test.imgSince this image file is 10GB, it took some time to remove this file from the server, so I used the Ctrl+Z command to suspend the remove command.[1]+ Stopped md5sum test.imgBy doing this, we can recover the deleted image file later. The rationale here is if other ...

55,301 0       LINUX FILE RECOVERY


  Time-saving tips Linux users should know

As a programmer or system administrator, we have more chances of working on *nix platforms. It's tough experience when first start use *nix as we need to face a black screen without knowing what's behind it. Now, if we can have some resources to rely on, then we will find the beautify of *nix. They are fast, efficient and most importantly sexy. Below are some great tips for helping Linux users get used to Linux.This list is a bit long. So be patient. To get more information on a command mentioned, first try "man ". The best way to learn something is to read the specification first then practic...

16,122 3       TIPS LINUX


  Recover deleted file in Linux EXT3 file system

Environment : CentOS 5.3 x86_64, /dev/sdb1 is the data segment /data0. EXT3 file system.Problem : /data0/tcsql/cankao/phpcws-1.5.0/httpcws.cpp is deleted mistakenly and httpcws.cpp is not backed up. It will take much time to rewrite this program again. So we must recover it back.debugfs is feasible in EXT2 file system, but in EXT3 file system, it's not very useful. There is one open source software called ext3grep which can help us recover deleted file in EXT3 file system. The recovery steps are:1. Install ext3grep.wget http://ext3grep.googlecode.com/files/ext3grep-0.10.1.tar.gztar zxvf ext3gr...

7,877 0       LINUX EXT3 FILE RECOVERY


  About tmpfs

tmpfs is another confusing name in Linux kernel, its implementation is in mm/shmem.c, shmem has no relation to tmpfs at first glance although we know tmpfs is based on memory. We can understand why we use this name by seeing where this is used.In a desktop Linux system, tmpfs is loaded usually:% grep tmpfs /proc/mountsdevtmpfs /dev devtmpfs rw,seclabel,nosuid,relatime,size=1958956k,nr_inodes=489739,mode=755 0 0tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev,relatime 0 0tmpfs /run tmpfs rw,seclabel,nosuid,nodev,relatime,mode=755 0 0tmpfs /sys/fs/cgroup tmpfs rw,seclabel,nosuid,nodev,noexec,relati...

4,910 0       LINUX TMPFS FILE SYSTEM


  Funny Linux commands

1. slYou will see a train moving from the right to left on the screen.Install : $ sudo apt-get install slRun : $ slIt has options like -aiFe:-a An accident seems to happen. You'll feel pity for people who cry for help.-l shows little one.-F It flies.-e Allow interrupt by Ctrl+C.We can also make fun of other people by setting an alias like below:$alias ls=slWhen the user types ls, he will see the train instead of the file list.2. fortuneOutput one statement, it can be a joke, or famous saying. Or if you install the Chinese version, you will get Tang poem as well.Install : $sudo apt-get install ...

16,693 1       LINUX FUNNY COMMAND FIGLET SL