A little script to send a backup file to a remote FTP server: #!/bin/bash HOST=’123.111.123.111′ USER=’bak_user’ PASSWD=’OpEnSeSaMe’ TODAY=”$(date +”%Y%m%d”)” FILENAME=Hostname_$TODAY.tgz cd /var/backup/sched/ ftp -n -v $HOST << EOT ascii user $USER $PASSWD prompt cd backups put $FILENAME ls -la bye EOT Then run it every day from Cron.
Posts Categorized: linux
IPTables Custom Chain for SSH access
I wanted a custom IPTables firewall chain to allow SSH access to a machine. The idea is that users hit a web page that adds their dynamic IP address to a list and then a script inserts that IP address into IPTables to allow SSH access. I achieved this as follows. In /etc/sysconfig/iptables I added: *filter… Read more »
Adaptec Hardware RAID controller on Sun 4150
On our Oracle Sun x4150’s the Hardware Raid can be checked after installing the StorMan software which is available (as StorMan-6.40.x86_64.rpm) in the software bundle for x4150s available after logging in to the Oralce support website and locating the downloads for x4150s. The download is pretty big (931MB) when the 39MB RPM is all you are… Read more »
Keeping Services Alive with Monit
On CentOS install monit as follows: yum install monit Make sure it starts automatically: /sbin/chkconfig –levels 235 monit on The main configuration file is at /etc/monit.conf but this file loads in any files under /etc/monit.d which is where we will place our files. First comment out the following sections in /etc/monit.conf as we will be… Read more »
Monitoring Child Internet Use on Ubuntu
So I wanted to keep an eye on what my daughter was up to on facebook etc. In addition to using OpenDNS and the Nanny parental control software in the Ubuntu Software Center I would like to use DansGuardian but that might take a little more time. One of the things I have done quite… Read more »
Skipfish on CentOS
I’m using CentOS 6.2 and needed to install the following dependencies before Skipfish would ‘make’: yum install pcre-devel openssl-devel libidn-devel libidn2-devel Some of the errors listed before this included the following: In file included from src/auth.c:30: src/http_client.h:26:25: error: openssl/ssl.h: No such file or directory In file included from src/auth.c:30: src/http_client.h:214: error: expected specifier-qualifier-list before ‘SSL_CTX’… Read more »
Photoshop CS5 on Linux
Great instructions for installing and running Photoshop CS5 via Wine: http://www.makeuseof.com/tag/idiots-guide-installing-photoshop-cs5-ubuntu-1004/
My Raspberry Pi has Landed
So my Raspberry Pi arrived a few days ago and I have now managed to get it out of the wrapper. After realising that I should have been using an SD card in the dedicated SD Card slot rather than trying to boot from one of the USB ports I was up and running. On… Read more »
Web Screenshots with Xvfb and Khtml2Png2
To get that headless Linux server capturing screenshots of web pages we need: Xvfb e.g. apt-get install xvfb Khtml2png2 (and dependencies) After installation of the above the steps are below and I wrapped it up into a PHP script which also did some database tasks to keep records of the screenshots. 1.Check if the Xvfb… Read more »
Remove Line Breaks with tr
I had a text file with multiple lines of input that I was manipulating using awk and sed but I found the following ‘tr’ command easiest to remove the line breaks: cat input.txt | tr -d ‘\n’