Archive for the ‘Linux’ Category

Linux: Top 18 command line tools for linux monitoring

Thursday, January 23rd, 2014
  • 1. Top – Linux Process Monitoring
  • 2. VmStat – Virtual Memory Statistics
  • 3. Lsof – List Open Files
  • 4. Tcpdump – Network Packet Analyzer
  • 5. Netstat – Network Statistics
  • 6. Htop – Linux Process Monitoring
  • 7. Iotop – Monitor Linux Disk I/O
  • 8. Iostat – Input/Output Statistics
  • 9. IPTraf – Real Time IP LAN Monitoring
  • 10. Psacct or Acct – Monitor User Activity
  • 11. Monit – Linux Process and Services Monitoring
  • 12. NetHogs – Monitor Per Process Network Bandwidth
  • 13. iftop – Network Bandwidth Monitoring
  • 14. Monitorix – System and Network Monitoring
  • 15. Arpwatch – Ethernet Activity Monitor
  • 16. Suricata – Network Security Monitoring
  • 17. VnStat PHP – Monitoring Network Bandwidth
  • 18. Nagios – Network/Server Monitoring

For more info, look at the excellent post: Linux Command Line Tools to Monitor Linux Performance

Linux: sed for search & replace for big files

Thursday, November 21st, 2013
sed 's/oldstring/newstring/g' file.txt > newfile.txt

An intro to Sed

Linux: Top RPM command examples (install, uninstall, query)

Sunday, April 7th, 2013

Probably the best page on the subject: rpm command examples

Linux: Resize (extend) a Logical Disk in a Xen from DOM0

Saturday, May 14th, 2011

Assuming you have set your xen VM (e.g. domu1) points to a logical volume.

from DOM0

Extending the domu1 logical volume to 40G

lvextend -L40G /dev/vg0/domu1

from domu1

Resize the Physical Disk

pvresize /dev/hda

Resize the desired LV

lvextend -L15G /dev/vg0u/store
// might want to unmount the volume first, but this works on ext3 on live disk
resize2fs /dev/vg0u/store

See also

LVM Guide

Linux: Bash Shell script, variable, if/else, echo

Monday, November 29th, 2010

Great tutorial: Bash Scripting Tutorial

Test if a parameter is defined

if [ -n "${1}" ]; then
  echo $1
  echo "hum, nothing"
fi will output “hum, nothing” foo will output “foo”

Linux: Install Apache with Yum

Monday, August 16th, 2010
yum install httpd
yum install mod_ssl

Source: Installing Apache, PHP, and MySQL on Fedora Core

Linux: MySQL Install (with yum) & Run

Sunday, August 15th, 2010

Install via Yum

yum install mysql
yum install mysql-server


service mysqld start

Set Root Password

mysqladmin -u root password MYPASSWORD

Change root Password

mysqladmin -u root -p'oldpassword' password newpass

Linux: Add User to Group

Friday, July 9th, 2010

Add group to user

usermod -a -G mygroup myuser

Change primary user group

usermod -g mygroup myuser


Linux: FileSystem command tips

Saturday, January 23rd, 2010

List the file systems

df -h

Size given folder

du -sh /path/to/folder

Sort/List largest directories/subdirectories

du /var/log/ | sort -nr | less

Other Links

SSH: Configuring Pageant on Windows to automatically use a key

Thursday, November 19th, 2009
C:PuTTYpageant.exe d:main.ppk