Skip to content

Instantly share code, notes, and snippets.

@tovbinm
Created April 20, 2011 15:18
Show Gist options
  • Save tovbinm/931602 to your computer and use it in GitHub Desktop.
Save tovbinm/931602 to your computer and use it in GitHub Desktop.
Useful OS stuff
echo <scheduler> > /sys/block/$disk/queue/scheduler
(http://stackoverflow.com/questions/1009577/selecting-a-linux-i-o-scheduler)
CentOS:
sudo vim /etc/sysconfig/network
reboot
Ubuntu: bash> gconf-editor
Then: /apps -> metacity -> general -> button_layout = :minimize,maximize,close
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>
cat /etc/issue /proc/version
$start=0
$end=1
$isenabled=0
for i in {$start..$end}; do echo $isenabled > /sys/devices/system/cpu/cpu$i/online; done
grep processor /proc/cpuinfo | wc -l
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'"
tr -cd '[:print:]\n' < infile > outfile
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