Replacing a string in a bunch of files using perl inline replace:
perl -pi -e ‘s/ORIG/NEW/g’
September 20th, 2011 | Posted in Linux, Perl | No Comments
Tags: Perl Inline Replace
Replacing a string in a bunch of files using perl inline replace:
perl -pi -e ‘s/ORIG/NEW/g’
August 7th, 2011 | Posted in AWS, Linux, Xen | No Comments
Get s3fs going on xenserver 5.6:
yum remove fuse fuse* yum --enablerepo=base install yum-utils yumdownloader --enablerepo=base e2fsprogs-devel rpm --nodeps -Uvh e2fsprogs-devel*.rpm yum install gcc libstdc++-devel gcc-c++ curl curl* curl-devel libxml2 libxml2* libxml2-devel openssl-devel mailcap cd /usr/local/src wget --no-check-certificate "https://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.4/fuse-2.8.4.tar.gz?r=&ts=1312707573&use_mirror=kent" tar -zxff fuse-2.8.4.tar.gz cd fuse-2.8.4 ./configure --prefix=/usr && make && make install export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/lib64/pkgconfig/ ldconfig modprobe fuse pkg-config --modversion fuse (confirm correct version) cd ../ wget http://s3fs.googlecode.com/files/s3fs-1.59.tar.gz tar -zxf s3fs-1.59.tar.gz cd s3fs-1.59 ./configure --prefix=/usr && make && make install vi /etc/passwd-s3fs (add aws id and secret key in format xxxxx:xxxxx) mkdir /mnt/s3drive s3fs bucket /mnt/s3drive dump all running vms/data to the AWS S3 cloud mount (/mnt/s3drive)
January 5th, 2011 | Posted in Debian, Linux, PostgreSQL | No Comments
/etc/apt/sources.list
deb http://backports.debian.org/debian-backports lenny-backports main
deb http://backports.debian.org/debian-backports lenny-backports-sloppy main
Install from the new target release:
apt-get install -t lenny-backports postgresql-common
apt-get install -t lenny-backports-sloppy postgresql-9.0 postgresql-client-9.0 postgresql-contrib-9.0
http://lists.debian.org/debian-backports-announce/2010/10/msg00000.html
December 19th, 2010 | Posted in Linux, PostgreSQL | No Comments
Importing a database into pgsql:
cat dbname.pgdump | psql -d db_name
Or
psql -d db_name -f dbname.pgdump
Exporting a database from pgsql:
su – postgres
pg_dump dbname > dbname.pgdump
Exporting all databases from pgsql:
pg_dumpall -o > all_dbs.pgdump
psql -e template1 < all_dbs.pgdump
September 22nd, 2010 | Posted in Linux | No Comments
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2010-3081
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2010-3301
Patch all 64-bit kernels
March 11th, 2010 | Posted in Linux, Postfix | No Comments
Tags: Linux, Postfix
The default “message_size_limit” is set to 10240000 bytes which is approximately 10MB. To change it, add/modify the message_size_limit line in your main.cf to;
message_size_limit = 20480000
The above is roughly 20MB and is more than enough on a typical server.
March 11th, 2010 | Posted in Blog, Linux, Qmail | No Comments
If you ever need to route mail destined for a certain domain through a smarthost you can edit/create the following file;
/var/qmail/control/smtproutes
The contents is straight forward… to relay mail destined for domain.com through smtp.yourdomain.com add the following;
domain.com:smtp.yourdomain.com
If you want to relay ALL mail through smtp.yourdomain.com add;
:smtp.yourdomain.com
March 9th, 2010 | Posted in Blog, Linux | No Comments
During a routine scheduled upgrade window I upgraded to the latest Dell OMSA on a range of Dell PowerEdge servers running CentOS. After the upgrade, shell scripts that check the health of disks started reporting that no storage controllers can be found.
# omreport storage pdisk controller=0
Invalid controller value. Read, controller=0
No controllers found.
After some digging through the Dell mailling lists it became apparent that i’m missing the Dell Firmware Tools on my installation. Installing the firmware tools solved the problem.
# yum -y install dell_ft_install
# srvadmin-services.sh restart
Once done, all was fine.
January 10th, 2010 | Posted in Blog, Linux, PowerDNS | No Comments
http://doc.powerdns.com/modules.html
To launch two backends of the same type, you can assign a name to each launch like this;
launch=gmysql:connection1,gmysql:connection2
gmysql-connection1-host=10.10.10.1
gmysql-connection1-user=pdns
gmysql-connection1-dbname=pdns
gmysql-connection2-host=10.10.10.2
gmysql-connection2-user=pdns
gmysql-connection2-dbname=pdns