H

  • How to get logs from Linux
      Location /var/log Or  /var/logs   Other Methods sudo tail -f /var/log/syslog  sudo less -f /var/log/syslog sudo more -f /var/log/syslog sudo cat /var/log/syslog ...
  • How to SSH without password
        For passwordless login, hit enter when asked for password then hit enter again for default name. mkdir .ssh #not needed in most casesssh-keygen -t rsa -b ...
  • How to delete files by date
      This will delete the content of the specified folder without deleting folders, just files.   find /var/Vol1/* -mtime +29 -exec rm -f {} \; ...
  • How to backup home directory
      cd /home/ find . -depth -print0 | cpio --null --sparse -pvd /backup/home/ ...
  • How to Mount Windows shares from fstab
      This works well on Centos //192.168.1.50/temperature /var/www/html/hot  cifs password=ASF1f02@2,username=KoocooMonster   This works for Ubuntu //192.168.1.50/apps  /media/192.168.1.50 cifs workgroup=NDS2K,password=ASF1f02@2,username=KoocooMonster 0  0   ...
  • How to split large files
      To split split /media/storage1/Largefile.zip /media/APPS2/slize/export.1   To join   cat export.1* > NEWFILENAME ...
  • How to rename a file with date stamped
      Assuming that you have a directory /logs This is the actual command that runs on one of my  cron jobs.     logwatch --detail=High --range=Today >/logs/watchdog.txt  && mv /logs/watchdog.txt ...
  • How to add remote SMTP server to Postfix
      Edit 'main.cf' file, create/edit a line as follows: Centos and Ubuntu location /etc/postfix/main.cf     relayhost = smtp.west.cox.net ...
  • How to reset Linksys/Sipura Modems
      Dial ****73738# Dial 1# to confirm ...
  • How to obtain IP address from a Linksys Sipura - SPA Phones by dialing
    From the Phone dial ****  then press 110#   - this will say the current IP     ...
  • How to find the best proxy for Broadvoice sip server
      Run this and  select the lowest ping  ping proxy.lax.broadvoice.com -i 3 -c3 >>ping.txtping proxy.dca.broadvoice.com -i 3 -c3 >>ping.txtping proxy.mia.broadvoice.com -i 3 -c3 >>ping.txtping proxy.atl.broadvoice.com -i 3 ...
  • How to find the best proxy for Broadvoice sip server
      Run this and  select the lowest ping  ping proxy.lax.broadvoice.com -i 3 -c3 >>ping.txtping proxy.dca.broadvoice.com -i 3 -c3 >>ping.txtping proxy.mia.broadvoice.com -i 3 -c3 >>ping.txtping proxy.atl.broadvoice.com -i 3 ...
  • How to get Bios info
      sudo dmidecode sudo biosdecode     Handle 0x0000, DMI type 4, 35 bytes Processor Information Socket Designation: LGA 775 Type: Central Processor Family: Manufacturer: Intel(R) Corporation ID: F6 06 00 00 FF FB EB BF Version: ...
  • How to obtain wireless info from the console
      To get info such as, speed, quality, etc.   iwconfig iwconfig wlan0 iwconfig wlan0 | egrep -e "Quality" -e "Rate"     wlan0     IEEE 802.11abgn  ESSID:"Marissa1"           ...
  • How to synchronize folders
      Rsync I use this alot to synchronize several machines,  A basic way  rsync  -rtvaz --delete   /var/www/Vol1 root@192.168.1.102:/var/Vol1  > /var/rsync.txt     To limit the Bandwidth   rsync -rtvaz --delete --bwlimit=1000  -e ...
  • How to run VirtualBox on a headless Server
        VBoxHeadless -startvm servername  Or   nohup vboxheadless -startvm Windows7 < /dev/null > /dev/null 2>&1 &  nohup vboxheadless -startvm Windows7 < /dev/null > /dev/null 2>&1 &    ...
  • How to get tcpdump on port 5060 or any other port
      tcpdump -n "dst host 192.168.10.1 and dst port 5060" -vw /var/log/asterisk/capture.cap   Another way   tcpdump -n "port 5060" -vw sip.dump ...
  • How to convert wave files for Asterisk
        From Ubuntu sox sourceStereo.wav -r 8k -c 1 out-mono8kfile.wav       ...
  • How to import export OST PST files
      Most sites out there have multiple comments about so called freeware to open OST files, the fact is that most of them are nothing but ...
  • Hard drive failure notification
      cd /root nano hd-monitor.sh #!/usr/bin/perl$to='some@yourown.com';$from='hdfail@whatever.com';my $command_output = ´/usr/sbin/smartctl -a /dev/sda1´;if ($command_output =~ /PASSED/ && $? == 0) {print "No issues with /dev/sda1";}else{´echo "Subject:HD Failure \n$command_output" | /usr/sbin/sendmail ...
  • How to send SSH commands to remote host, ssh Automation
      This is very useful for automating tasks in remote machines or to gather remote info from many machines at once.   ssh root@192.168.1.48 'uptime' For multiple commands ssh root@192.168.1.48 'uptime ...
  • How to take a picture from terminal
    Something easy to use fswebcam apt-get install fswebcam     fswebcam -r 1080x780 --jpeg 90 -D 1 snap.jpg   ...
  • How to measure Internal Network speed
    First you need to install Iperf on all the machines that you wish to test throughput.   sudo apt-get install iperf   Once you have it installed, select a machine ...
  • How to remove blank spaces on files, folders and subfolders
        cd into directory  find . -depth -name '* *' \ | while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' ...
  • How to get Navit working on Raspberry Pi with a USB GPS device
    To install Navit and GPSD  sudo apt-get install navit gpsd gpsd-clients python-gps -y Copy to your home directory cp /etc/navit/navit.xml ~/.navit/navit.xmlcd /home/pi/.navit Get a map (using your browser) http://maps.navit-project.org  (zoom and ...
  • How to backup My Documents on Windows 7 using batch script
      The following script will create a folder on the D: drive named as today's date in numeric format, this is great if you need to ...
  • Hidden folder after copying from external drive
      This problem occurs sometimes when using robocopy , sometimes I Can't even see files in external drive and they are not hidden. My solution is to run: attrib ...