WordPress, PHP Scripts, and Debian Linux Tips & Tricks
This article is about Offline Package Management in Debian. Debian is a pretty well known project. One of the things that makes Debian very popular is APT (a.k.a Advanced Packaging Tool) which allows remote package downloads, upgrades and dependency resolution. Unfortunately it does require a network connection – unless you use apt-offline.
In Debian, when you need to install a package, you usually would fire up the apt-get command and the software would just install without any hand holding.
While APT is really very cool one of the main reasons for its success is the Debian Policy. The Debian Policy is like the brain of the project that controls the entire project ensuring that all the bits and pieces fit well together upto the Debian Standards. APT is just a result of the fantastic Debian Policy work.
cpulimit is a simple program that attempts to limit the cpu usage of a process (expressed in percentage, not in cpu time). This is useful to control batch jobs, when you don’t want them to eat too much cpu. It does not act on the nice value or other scheduling priority stuff, but on the real cpu usage. Also, it is able to adapt itself to the overall system load, dynamically and quickly.
How it works
Note that you don’t need to read this paragraph in order to use cpulimit, you can safely skip it if you are not interested in tweaking cpulimit.
So, you are curious to know the secrets of cpulimit
Of course there is no secret if you are a C developer, but I will try to explain to everyone. The work of cpulimit is done all in userspace, so it doesn’t interfere with the Linux scheduler. Basically, the target process, which you can specify by pid, name, or command line, is continuosly paused and resumed by sending it SIGSTOP and SIGCONT signals. Signals are sent by cpulimit in appropriate moments, based on the limit specified by user and the process statistics read from /proc. Continue Reading cpulimit – Limit the cpu usage of a process
1. Network Settings
A. To configure your network interfaces with ifconfig.
- Static IP Address
#ifconfig [interface_name] [ip_address] netmask [mask]
ex :
#ifconfig eth0 192.168.1.15 netmask 255.255.255.0 broadcast 192.168.1.255
To configure the default gateway:
#route add default gateway [ip address] dev [interface_name]
ex :
#route add default gateway 192.168.1.1 dev eth0
Continue Reading Basic Network Setting Debian