cURL and automatic Tweets

July 3rd, 2009

This is the easiest way to schedule tweets to Twitter. If you want to seriously start building traffic to your web site then regular tweets are essential.
First, make sure you have curl installed. cURL is often already present in Linux distros but Windows users will need to locate and install it.
The command is very simple which can be placed in a shell script (Linux) or a batch file (Windows). This can then be scheduled as you wish - I suggest you don’t over do it, the same message every minute will not be posted as it will be identical to your previous one and Twitter will reject it. Keep repeated messages a few minutes apart.
Right, down to the nitty gritty.

The command is fundamentally straight forward:

curl -u username:password -d status="Technical Knowhow | NetworkUsAll Journal http://www.networkusall.com" http://twitter.com/statuses/update.xml

The username:password is fairly obvious - just replace it with your own Twitter account login details.
The text following -d status= is your tweet message (I included my blog url).

See below
Sponsored Links




Now, this produces output to the screen and is helpful when you want to know that the command has worked and what it did. However, this is no good if you want to automate the command. Screen output will cause an error in scheduled running of scripts and applications. Fortunately there is a way around this.
I shall show you how to do this in Linux as I currently don’t know the equivalent in Windows (it may be the same in Windows but don’t count on it).

curl -u username:password -d status="Technical Knowhow | NetworkUsAll Journal http://www.networkusall.com" http://twitter.com/statuses/update.xml > /dev/null 2>&1

This makes sure that all output is cleanly dealt with without causing errors.

The shell script in which you place the command can now be scheduled as you wish.

Julian Perry Linux & Windows , , ,

Computer Breakthrough

July 1st, 2009

It’s happened. Well almost.
Supersonic performance.

The race to petaflop supercomputers is heating up, with the latest entry coming from NASA, Intel and SGI. The trio announced plans to build what will be a petaflop-capable supercomputer by next year, and up to 10 petaflops (define) by 2012.

Supercomputers have been in a constant game of oneupsmanship and bragging rights. The definitive list of the fastest supercomputers, called Top500, is released twice a year, and for the last few years, IBM (NYSE: IBM) has dominated with its Blue Gene/L supercomputer at the Lawrence Livermore Laboratories.

With each update to the list, the number of teraflops (define) goes up because no matter how much processing power you give these machines, there’s still more demand for them. These massive systems aren’t just doing one job at a time. They are rented out to other agencies or researchers who have a massive computing task they need done.
See below
Sponsored Links




At any given time, a supercomputer likely has hundreds of computational tasks running on it. So there are never enough teraflops to go around. A teraflop is a trillion operations per second. As of last November, Blue Gene/L topped out at 600 teraflops and ran at a sustained rate of 478 teraflops. By contrast, a Core 2 Duo E6700 processor performs around 12-13 gigaflops, or billions of operations per second.

See the whole story at http://www.internetnews.com/hardware/article.php/3745856.

Julian Perry Linux & Windows, software

My favourite TV advert of all time

June 22nd, 2009

I just find this one of the funniest TV adverts ever…

Sponsored Links




I just find it hilarious.

Julian Perry Fun , , , ,

Booting from a Linux CD and wiping an operating system

June 7th, 2009

Some times it is very useful to boot from a Linux installation CD or DVD in order to use tools straight from the CD/DVD. You are not necessarily looking to install Linux but simply to make use of its low level software tools.
There are a number of ways to do this but I shall list just two as they are the most familiar to me.
1) Using the first CD or DVD from RedHat/Fedora/CentOS media :-
Set your BIOS to boot from your CD-ROM drive
When the boot process reaches the boot> prompt, enter “linux rescue” and hit return, this will provide you with a number of boot options, choose the most basic as we don’t need any networking functionality.
This will load linux into memory and provide access to the programs held on the CD/DVD.
The following command will allow you to wipe the beginning of your hard drive thus removing key information about anything held on the drive.
See below
Sponsored Links




dd if=/dev/zero of=/dev/sda bs=512 count=50000

or

dd if=/dev/zero of=/dev/hda bs=512 count=50000

depending on whether you have a SATA drive or an IDE drive respectively.

2) Boot from a Puppy Linux CD, start a terminal window then follow the same dd commands described above.

Upon begining an operating system installation it will appear that the hard drive is brand new and completely blank.

Julian Perry linux , ,

Installing Windows on a blank hard drive

June 5th, 2009

This is the best way to achieve a clean and uncluttered install of any Windows operating system.
If you have a badly corrupted Windows operating system then first of all you will want to blank the hard drive first. This can be easily achieved by booting from a Linux boot disk then using the “dd” command to write directly to the hard drive. I shall cover the Linux boot in another post. Place your Windows install CD into the CD-ROM drive and restart the computer. As the BIOS starts, hit DEL or F2 or whatever your BIOS requires to enter the setup and set it to boot from the CD-ROM drive first, followed by the hard drive you wish to install Windows on. Save your settings and restart the computer. This should now begin the Windows installation procedure.
See below
Sponsored Links




Choosing a partition size is completely at your discretion, personally if I am only installing Windows on the computer then I choose the whole of the hard drive. From XP onward only a quick format is required.
The vital thing is that you have or obtain any required drivers for your hardware. This is not always provided if you have an “off the shelf” computer. The main thing is that Windows recognises your network interface. If you have this working then you can get back on the internet and download those missing drivers. I shall cover this matter in another post.

Julian Perry windows , ,

Postfix smtpd_client_restrictions

May 21st, 2009

Keeping known email abusers out is always desired. Postfix has a parameter which is specified in the main.cf file that allows you to refer to these lists.
The script I use is as follows…

smtpd_client_restrictions =
	permit_mynetworks
	permit_sasl_authenticated
	reject_unauth_pipelining
	reject_rbl_client cbl.abuseat.org
	reject_rbl_client dnsbl.ahbl.org
	reject_rbl_client dnsbl.sorbs.net
	reject_rbl_client list.dsbl.org
	reject_rbl_client sbl-xbl.spamhaus.org
	#reject_rhsbl_client blackhole.securitysage.com
	reject_rhsbl_client rhsbl.sorbs.net
	permit

Note the commented out line

	#reject_rhsbl_client blackhole.securitysage.com

See below
Sponsored Links




This is a list that was not properly administered. A friend of mine tried to email me who uses the mac.com domain and was being rejected as an abuser which, of course, is rediculous.
I keep the entry as a future reference. There are others out there so if you know of them please let me know.

Julian Perry linux, smtp , , ,

Bandwidth Convertion

May 19th, 2009

Bandwidth Convertion

Mbit K/s
100 12,800
20 2,560
16 2,048
8 1,024
4 512
2 256
1 128
0.5 64

Julian Perry Linux & Windows , ,

Backup your Linux Server Apps

May 18th, 2009

So you have your linux server up and running. A lot of time and effort went into this so lets get it backed up. You don’t need to invest in any fancy backup system. A bit of shell script and some use of crontab will do the trick.

Here are the two scripts I use…

    Email backup

Create an executable file e.g. mailserver_backup.sh containing the following

cd /
dt=`date +%Y%m%d_%s`
/bin/tar -czf mailserver_$dt.tar.gz etc/postfix etc/dovecot.conf usr/bin/null.sh usr/local/bin/safilter.sh usr/local/bin/backup_mailprogs.sh etc/mail/spamassassin home/mailfilt/.spamassassin var/spool/mail
    Web backup

Create an executable file e.g. web_sql_backup.sh containing the following

cd /
dt=`date +%Y%m%d_%s`
rm -f mysqlall.sql
mysqldump -uroot -ppassword --all-databases > /mysqlall.sql
/bin/tar -czf mailserver_web_sql_$dt.tar.gz etc/httpd var/www/html mysqlall.sql usr/local/bin/backup_web_sql.sh

Now use crontab to schedule the running of the scripts…

crontab -e

and enter the following
See below
Sponsored Links




15	3	*	*	*	/usr/local/bin/mailserver_backup.sh
45	3	*	*	*	/usr/local/bin/web_sql_backup.sh

This will backup mail server apps at 3:15am and web backup at 3:45am.

I would also suggest you copy the backed up files to other media in case your server completely crumbles.

Julian Perry server, software , , ,

Telnet your email server

May 12th, 2009

Very often it is necessary to test that your SMTP server is working.
The easiest way to do this is with the telnet command.
This lets you talk directly to the email server in its own SMTP protocol script language.

Here’s how…

telnet server name or IP address 25
HELO aaaa
mail from: <tom@fromdomain.com>
rcpt to: <fred@todomain.com>
data
Enter your message text
.
quit

Along the way you should see feedback from the server to each command entered
See below
Sponsored Links




e.g.

Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 mailserver.local ESMTP Exim 4.43 Tue, 12 May 2009 10:31:00 +0100
helo aaaa
250 mailserver.local Hello mailserver.local [127.0.0.1]
mail from: <tom@fromdomain.com>
250 OK
rcpt to: <fred@todomain.com>
250 Accepted
data
354 Enter message, ending with "." on a line by itself
A message for myself.
.
250 OK id=1M3oKj-0006Sn-9u
quit
221 mailserver.local closing connection
Connection closed by foreign host.

Julian Perry email, smtp , , ,

PostCast Server

May 11th, 2009

This is an SMTP server like the one your ISP provides. It is targeted at Windows users and sells as a faster and more flexible alternative.

I don’t like to be negative about the efforts of others but, I do find it diffucult to see what advantage this server application gives you over the already available SMTP component that Windows XP gives you. If you are looking for improved email delivery times then Windows can do this already. PostCast Server does provide a greater level of control and reporting but if you already send large quantities of email messages then you will already have a form of recording your activity.

It suggestes that you don’t have to be on line to be able to queue-up your messages. Well the vast majority of systems keep messages ready to re-send when an SMTP server is not available.

Perhaps I’m just being a party pooper but it just seems a bit pointless to me.

Why don’t you try adding the Windows SMTP server component and try it out?

Control Panel - Add or Remove Programs - Add/Remove Windows Components - Internet Information Services (IIS), Click Details, select SMTP Service, OK, Next, Finish.

Tweak your email client to use “localhost” and away you go.

Julian Perry email, server, smtp, windows , , , ,