Created
April 20, 2011 15:18
-
-
Save tovbinm/931602 to your computer and use it in GitHub Desktop.
Useful OS stuff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo <scheduler> > /sys/block/$disk/queue/scheduler | |
(http://stackoverflow.com/questions/1009577/selecting-a-linux-i-o-scheduler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CentOS: | |
sudo vim /etc/sysconfig/network | |
reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.Run: sudo vi /etc/init/<service-name>.conf | |
2.Then edit the file with follows: | |
description "service description goes here" | |
exec <service-command> | |
3. Then try it: | |
sudo service <service-name> start | |
sudo status <service-name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat /etc/issue /proc/version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$start=0 | |
$end=1 | |
$isenabled=0 | |
for i in {$start..$end}; do echo $isenabled > /sys/devices/system/cpu/cpu$i/online; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep processor /proc/cpuinfo | wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In order to watch cpu usage on multiple machines one may use: | |
watch mussh -h host1 host2 -c vmstat | |
Or a faster version (runs in parallel): | |
watch "parallel -- 'ssh host1 vmstat' 'ssh host2 vmstat'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tr -cd '[:print:]\n' < infile > outfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In order to generate /etc/apt/sources.list for ubuntu you may use: | |
http://repogen.simplylinux.ch/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment