Trap Ctrl-C in a Bash script
How to trap Ctrl-C in a Bash script?
The piece of code:
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
echo
echo "Ctrl-C by user"
# do the jobs
exit
}
How to trap Ctrl-C in a Bash script?
The piece of code:
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
function ctrl_c() {
echo
echo "Ctrl-C by user"
# do the jobs
exit
}
What are the popular / good NoSQL databases nowadays? MongoDB, CouchDB Find more at https://en.wikipedia.org/wiki/NoSQL and http://nosql-database.org/ Answered by omshivaprakash. Read more: SQL layers on NoSQL databases Consistency models for distributed systems Free server images – SysTutorials QA How to choose the number of mappers and reducers in Hadoop How to config network in host…
MPlayer has lots options for video rendering and filtering. Any suggestions on good MPlayer options that improve video rendering quality nicely? My ~/.mplayer/config is as follows with 2 profiles: [fast] vf=eq2 [default] vf=hqdn3d vo=gl:yuv=3:lscale=5:cscale=5 ao=pulse The default one gives good video quality by using the hqdn3d video filter while the CPU usage is high. If…
In C, how to get the hostname of the node? In C, you may use the gethostname function. #include <unistd.h> int gethostname(char *name, size_t namelen); The gethostname() function shall return the standard host name for the current machine. The namelen argument shall specify the size of the array pointed to by the name argument. The…
How to make a swap partition on Linux? First, make a new partition (or reuse an existing one if you like). I suggest using cfdisk to create it: https://www.systutorials.com/docs/linux/man/8-cfdisk/ Then, turn the new partition (say, /dev/sdc1) to a swap # mkswap /dev/sdc1 Lastly, turn it on # swapon /dev/sdc1 You can check whether its status…
The Windows 7 Multiple Activation Key (MAK) can be used to activate Windows 7 Enterprise installed with the Windows 7 Volume Licence DVD provided by Microsoft to enterprise/university customers. How to activating Windows 7 with MAK: Make sure your system is connecting to the Internet. During Windows 7 activation, Windows will connect to Microsoft.com for…
I cannot login desktop in Ubuntu Precise. It told me following errors: Could not write bytes: Broken Pipe… Check Battery Satte Actually, I tried many ways to solve this problem. It seems that something wrong with my lightdm software so, at last, I use gdm software to replace lightdm to kill this problem. Just install…