Tag: bash

dyndns update via bash

Sometimes it comes handy to update your dynamic IP onĀ  DynDNS or namecheap via bash file. This is a simple solution on how to do that: A improved script: #!/bin/bash # # DynDNS for Namecheap # including check between externel…

up count with fix character length

Sometimes it is quite important to have all the time the same length of characters. A small bash script can help and with “printf” the beginning indicated has always the same length. #!/bin/bash count=0 #counter equals zero # star loop…

mac os x – wget

I realized that wget is not part of mac os x lion. I did not find a binary that you can just install and be happy. But luckily curl is installed. Curl is able to replace wget bey using “curl…

Get external IP via bash

To get your external IP via a small bash script #!/bin/bash # Define parameters LOGFILE=”/tmp/extip.log” DATE=$(date “+%Y%m%d-%H%M”) GETIP=$(wget -q -O – checkip.dyndns.org | sed -e ‘s/[^[:digit:]|.]//g’) test -f $LOGFILE || echo “no LOGFILE” touch $LOGFILE GETLOGIP=$(tail -n 1 $LOGFILE |…

Ping – Host Check

A short script to perform a continuous ping to check the availability of a certain server / host. execute: ./pingscript.sh <ping count> <target> <additional delay> ./pingscript 5 192.168.0.1 25   #!/bin/bash # set varables COUNT=$1 TARGET=$2 DELAY=$3 COUNT=0 LOGFILE=”./host_check.log” #…

generate strong passwords with Unix

If you wanna generate strong passwords with linux board tools. If you are using Ubuntu or Debian the following package is required: sudo apt-get install sharutils Generate password head -n 2 /dev/urandom | uuencode -m – Output: begin-base64 644 -…

tar via SSH

How to backup files over ssh ? A nice way of backuping files from one machine to an other is a zipped tar file transferred via ssh. # tar zcvf – /var/www | ssh root@backupserver “cat /backup/www-backup.tar.gz” Your output will…