Browsing articles from May, 2011

theSpoke Archive: Sorting Out All Those Feeds

May 30, 2011   //   by demon   //   Tech  //  0 Comments

I have spent this past week trawling through archives of RSS feeds, posts, website Favorites of articles, images, promotions, and everything else this week that I have amassed over the past few years.

Articles have ranged from posts on advice to run a business, tech articles, DVDs to watch, music to listen to, image to retain for future inspiration to name a few. With close to five years worth of information, I have successfully culled a lot of it by either retaining the information or storing it to blog about later or Amazon Wish Lists. The rest was either now irrelevant, or of no longer any interest. Some of which, I wish I did read at the time. Such house cleaning lead me to a theSpoke archive post of mine from the past:

Sorting Out All Those Feeds (18/11/2005)

I have finally managed to get on top of sorting out Newsgator in my Outlook, downloading all the feeds I actually want to read and cleared out all the junk that I kind of subscribed to purely that one post looked interesting and the rest were just rubbish really…but who am I to judge: one man’s rubbish is another mans treasure.

I have found the new theSpoke to be a lot slower loading up (even with a 2Mbps connection – although connecting wirelessly to the network), so I have decided to download all the feeds I subscribed to straight into one folder instead of one individual folder for each person – my screen resolution is big but not that big!

I have 39 blogs in Newsgator with about 5-6 website blogs that use RSS 1.0 and are just easier to read on the website than just download the small snippets of the blog. I really do struggle at times to try and keep on top of reading them all. I have one folder that is the Microsoft Communities which feeds all the blogs by Microsoft into one folder instead of trying to search through the individual blogs – although I think I will use this method to search out the blogs I really want from Microsoft then delete the major blog if that makes any sense!

One thing that does seem to irritate me about blogging is the somewhat laziness of it. I susbscribed to this one blog as the guy wrote about his blogging and trying to explain it to his mother.  That blog alone convinced me it was worth further reading. The rest of his blogs were just one liners pointing to other blogs that pointed to other blogs about a topic. Blogging seems to contain alot of pointless cross-referencing. The reason I like the idea of blogging is that people discuss their own personal views on a topic of any type and its this that makes the reading interesting to see how others think. Yet a one line blog to say what someone wrote about something is altogether pointless and the person might as well have saved that time to write interesting blog other than multiple one lines on nothing.

Interestingly enough, the rant in the last paragraph is pretty much what Twitter has become. If I only I acted upon it…

Install VSFTPD on CentOS v5 x86/64-bit

May 29, 2011   //   by demon   //   Tech  //  0 Comments

Following on from my previous posts of installing Apache on CentOS, this post will run through setting up VSFTPD to run an FTP server so you can upload your website files.

As much as I hate FTP because it is archaic and insecure (sending passwords in clear text), it does server it purposes of uploading files to a GUI-less Linux server.

This post will run through installing VSFTPD, and setting up a user to access a restricted location.. See the following posts on how to install CentOS on Hyper-V to get a secure O/S environment setup.

Step one is to create a location that is restricted to this user. I will use a location where we will be storing a website as per the Apache install website:

  • /var/www/vhosts/mydomain.com/httpdocs/

We now have a location where can upload a website, now we need to create the user account that will be used to login via FTP, and map this account to the web site root folder as the home location:

  • adduser -d /var/www/vhosts/mydomain.com/httpdocs/ mydomain.com
  • passwd mydomain.com

With the user created and mapped to the website root folder, we now need to set the owner and permissions on the root folder so that the user can write files and subfolders:

  • chown mydomain.com:mydomain.com /var/www/vhosts/mydomain.com/httpdocs/ mydomain.com
  • chmod 755 mydomain.com:mydomain.com /var/www/vhosts/mydomain.com/httpdocs/ mydomain.com

If you are running a WordPress site, you will also need to run the following command to make the WP-Content folder writable for Apache:

  • chmod 777 mydomain.com:mydomain.com /var/www/vhosts/mydomain.com/httpdocs/wp-content

Now we need to install VSFTPD:

  • yum install -y vsftpd
  • chkconfig –level 2345 vsftpd on
  • service vsftpd start
Now we need to configure the VSFTPD vsftpd.conf configuration file. I have only added the lines that I edit (you will need to search!):
  • vi /etc/vsftpd/vsftpd.conf
  • anonymous_enable=NO
  • ascii_upload_enable=YES
  • ftpd_banner=Welcome to mydomain.com FTP Server
  • chroot_list_enable=YES
  • chroot_list_file=/etc/vsftpd/chroot_list
  • ls_recurse_enable=YES
  • chroot_local_user=YES
  • vi /etc/vsftpd/chroot_list

We now need to create and update the chroot_list of users who are jailed to their home directory (specified when we create our users):

  • vi /etc/vsftpd/vsftpd.conf
  • #mydomain.com

Now restart the VSFTP service to put the new changes in to effect:

  • service vsftpd restart

You will need to open up TCP port 21 on incoming traffic on your firewall. Now test and see if you can log in.

Creating a DOS Bootable USB Flash Drive

May 28, 2011   //   by demon   //   Tech  //  2 Comments

Since the decline of floppy drives, creating a DOS bootable USB device has become a nightmare with a mixture of half-baked solutions online and no real clear cut solution.

I had to upgrade the BIOS on a Supermicro X8STi 1U rack server on Friday, and I need to boot in to DOS to run the BIOS flash program. The server doesn’t have a 3.5in floppy drive, let alone a DVD-ROM. I do actually have an IBM USB floppy drive floating around somewhere in storage in the UK, and I really should dig this out as it would save me a lot of pain. Until now…

I have run through a number of different online tutorials, and finally found this one by Perley Mears, a worker at Oracle. I couldn’t get his solution working, however I did come across a different method in one of the comments.

Step one is to create a virtual floppy drive on system, which will allow us to create an MS-DOS start up disk.

  • Download and unzip VFD
  • Open a command prompt (running as Administrator), and change the directory to the unzipped VFD
  • Run the following command to install the VFD driver:
  • vfd.exe install
  • Now right click vfdwin.exe and select Run as Administrator
  • Select Start, to start the VFD driver
  • Select Drive0, choose a drive letter, and create a msdos.vfd

If you now open My Computer, you should now see your floppy drive. We need to format the virtual disk, and set it as a MS-DOS startup disk.

  • Right click floppy drive and select Format
  • Select Quick format and MS-DOS startup disk

The next piece of software is going to take our MS-DOS files, and recreate them on our USB stick, and make it bootable.

  • Download HP USB Disk Format Tool
  • Right click HPUSBDisk.exe and select Run as Administrator
  • Select your USB flash drive, select Create a DOS startup disk, and select your floppy drive to collect the MS-DOS files

The HP tool will now do all the work, creating your bootable USB flash drive. You can also take a copy of the files of your floppy drive and zip them up, saving them for later. This will avoid the need to run VFD in future – you will need to disable hiding operating system files in the Control Panel Folder Options to ensure you copy hidden files.

The VFD tool was very useful for me, as the Supermicro BIOS flashing tool insisted on unzipping to a floppy drive, which included it’s own version of DOS to run boot off.

How To Get From Weekend Idea To Funded Startup

May 28, 2011   //   by demon   //   Tech  //  0 Comments

I am certainly look for some extra-curricular activities to get me busy, as well as rake in some extra cash; so I have become much more interested in startup advice, videos, blogs, tweets, presentations, etc.

This video was recorded at Google I/O session, with Don Dodge hosting a panel discussion on how to go from an idea, to starting up and getting funding. The three entrepreneurs on the panel are Paul Buchheit, Joe Kraus, and Seth Priebatsch.

I had no idea who any of these three were, but you soon sit up and listen to what they say once they introduce themselves and their history!

As I mentioned, I am planning a few ideas and already have one project going that certainly needs TLC and will be the foundations of my new idea. I must say that there is a lot of talk about funding and venture capitalism seems to be the new buzz word. I can’t say that it excites me, as if I have an idea, I want it to be my idea that is built on my hard graft and my money. This is why I am typing this on a 5 year old laptop in a flat I rent, and not running a Facebook.

Maybe it is time to change?

WordPress on Windows

May 28, 2011   //   by demon   //   Tech  //  0 Comments

I currently run my WordPress site on a Windows Server with IIS. With WordPress being PHP, and I assume, design to run optimally on a LAMP infrastructure, there are a few hidden extras you need to do, in order to make use of WordPress’ full functionality.

1. WordPress Version

When you download your version of WordPress, make sure you download the version labelled “wordpress-<Version>-IIS”. I don’t actually know if there are differences in the code between the standard and IIS versions of WordPress, it mainly just looks like they add additional files:

  • install.sql (MySQL deployment script)
  • manifest.xml (for Windows Live Writer integration)
  • parameters.xml (for Windows Web App Gallery)

To be honest, it looks like the IIS version is the version that Microsoft uses to deploy WordPress using its Web Platform Installer.

2. Permalinks

If you want to make use of a permalink structure other than the default (http://www.domain.com/?p=123), then you need to add a Web.Config file to the root directory of your WordPress content with the following:

<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="wordpress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>

If you change your Permalink structure to Month and Name (http://blog.demongreen.co.uk/2011/05/sample-post/), then when you try and browse by Category or Tag, then you will receive a 404: File not found error.

3. Scheduled Tasks

I am still working out how to get the Google Sitemap XML plugin to automatically generate the Sitemap.xml for this site.

I also get issues when trying to schedule posts to auto-publish.

Both issues may be because there is no WGET or Cron feature in Windows, so I will have to do more research and get back to you.

Run Hyper-V Management Tools with Alternate Credentials

May 26, 2011   //   by demon   //   Tech  //  0 Comments

If you ever wanted to run Hyper-V Manager from your Desktop, but use a different account that might have the required permissions on the Hyper-V hosts, then take a look at the short tutorial below on how to achieve this.

Ensure you have the latest Remote Server Administration Tools installed, you can get them here (for Windows 7 SP1).

Run the following command in a Command Prompt to save the credentials of your alternate user account

  • C:\Windows\System32\cmd.exe /s /c “runas /savecred /user:<DOMAIN\UserAccount> “mmc \”C:\Program Files\Hyper-V\virtmgmt.msc\”"”
  • Enter the password for the alternate user account
  • Close Hyper-V Manager when it opens

Now we need to create a shortcut that you can leave on your Desktop or pin to your Start Menu and/or your Taskbar:

  • Right click your Desktop and select New –> Shortcut
  • Enter the above command for the location of the item, and name the shortcut Hyper-V Manager

Now you have your shortcut, we need to give it the Hyper-V Manager icon:

  • Right click the shortcut and select Properties
  • Select the Shortcut tab and select Change Icon…
  • Set the icon path to %ProgramFiles%\Hyper-V\SnapInAbout.dll

Your shortcut is now complete, and you can now place it where you want!

This is a short break down of how to do it, pinching the core detals from this post on Virtual PC Guy’s Blog. If you are serious about Hyper-V then you should definaltey subscribe to this blog as there is a lot of useful information coming out of it.

Install Apache on CentOS v5 x86/64-bit

May 23, 2011   //   by demon   //   Tech  //  0 Comments
I have built a few Linux web servers, running on CentOS with the LAMP design – the A being Apache, and the P for PHP. Any server running web server software and web frameworks needs to have security in mind, right from the install, configuration and use.
Here is my breakdown of the install, configuration and hardening that might be of use to others. See the following posts on how to install CentOS on Hyper-V to get a secure O/S environment setup. You can also catch my previous posts regarding installing, backing up and optimising MySQL on CentOS.
Step one is to obviously get Apache installed and started up:
  • yum install -y httpd
  • chkconfig –level 2345 httpd on
  • service httpd start
Step two is to get PHP and the necessary modules installed:
  • yum install php php-mysql php-common php-gd php-mbstring php-mcrypt
    php-devel php-xml
Now restart the Apache service to put the new changes in to effect:
  • service httpd restart
Apache and PHP are now installed, and the service is started. Now we need to create our web server folder structure for own one/multiple websites. Assume our first website is for a domain called mydomain.com:
  • mkdir /var/www/vhosts
  • mkdir /var/www/ vhosts/mydomain.com
  • mkdir /var/www/ vhosts/mydomain.com/httpdocs
  • mkdir /var/www/ vhosts/mydomain.com/logs
Next step, is for a little bit of security. When you visit the base public IP address of the server, you will see a default Apache welcome page. I prefer to turn this off by commenting out the configuration file for this:
  • vi /etc/httpd/conf.d/welcome.conf
  • <Comment out all the lines with a #>
Now we need to configure the Apache httpd.conf configuration file. The configuration file is quite long, so I have only added the lines that I edit (you will need to search!):
  • vi /etc/httpd/conf/httpd.conf
  • AddType application/x-httpd-php .php
  • AddType application/x-httpd-php-source .phps
  • NameVirtualHost <PublicIPAddress>
  • <VirtualHost PublicIPAddress>
  • ServerAdmin email@domain.com
  • ServerAlias www.mydomain.com
  • ServerName mydomain.com:80
  • UseCanonicalName Off
  • DocumentRoot /var/www/vhosts/mydomain.com/httpdocs
  • CustomLog /var/www/vhosts/mydomain.com/logs/access_log common
  • ErrorLog /var/www/vhosts/mydomain.com/logs/error_log
  • DirectoryIndex index.php
  • </VirtualHost>
Now restart the Apache service to put the new changes in to effect:
  • service httpd restart
If the service fails to restart then you probably have a spelling mistake in your configuration. Use the following command to check there are no errors with your new configuration:
  • /usr/sbin/apachectl configtest

Log management is the next step, as unmaintained log files can grow and grow and if your website becomes exceptionally busy then these can eat up in to the server’s disk space:

  • vi /etc/logrotate.d/httpd/vhosts
  • /var/www/vhosts/somethingisaw.co.za/logs/*log {
  • monthly
  • rotate 12
  • compress
  • missingok
  • notifempty
  • sharedscripts
  • postrotate
  • /sbin/service httpd reload > /dev/null 2>/dev/null || true
  • endscript
  • }

And that is that. You will need to open TCP port 80 in your firewall for incoming traffic. Apache should take care of the permissions, inheriting them from the /var/www/ folder when Apache was installed. There is a lot more reading online on how to further secure this.

The following scripts below, are simple backup scripts to backup local copies of the website content on a regular basis:

  • mkdir /home/backups/vhosts/
  • cd /home/scripts
  • vi vhosts_backup_all.sh
  • #!/bin/sh
  • tar -cvzpf /home/backups/vhosts/vhosts_backup_all.tgz /var/www/vhosts/

We must set the permissions on the script so that it can be executed:

  • chmod u+x vhosts_backup_all.sh

I create a backup each day of the week (I haven’t written a script to rotate the backups yet), and then edit crontab to run them on a daily basis:

  • vi /etc/crontab
  • 0 6 * * * root /home/scripts/vhosts_backup_all.sh

Inspiring Stuff: Just Keep Going, You Got Nothing To Lose

May 23, 2011   //   by demon   //   Visual  //  0 Comments

“Just Keep Going, You Got Nothing To Lose” by Luke Rudkowski.

I must admit that I can relate to the opening statement by Luke that nobody talks on subways as it is much the same in London. However, I did notice that subways are much noiser than the London Underground. In London, people rarely talk amongst themselves, and when they do they keep it to a low volume.

I think the behaviour is due to so many people in the city, people subconciously don’t draw attention to themselves; that’s my verdict anyway.

You Can’t Spell Beautiful Without Be You

May 22, 2011   //   by demon   //   Visual  //  0 Comments

“You Can’t Spell Beautiful Without Be You” by wordboner.

I am not sure if it is the yellow, or the crease lines and shadows or the fonts – perhaps even the soppy quote, just I can’t stop staring at this graphic.

Optimise MySQL on CentOS v5 x86/64-bit

May 19, 2011   //   by demon   //   Tech  //  0 Comments

The final step in this MySQL series of posts (read the Install and Backup posts), is the regular optimisation of MySQL.

The my.cnf file has a lot of options that will enable you to customise your MySQL environment to the hardware available and the demand it receives. There are some very good performance monitoring scripts available that will run diagnostics against the MySQL server and offer advice on how to enhance your MySQL configuration.

I had MySQL databases running in one database environments and others in Shared Hosting with multiple environments, so I would set these scripts to run weekly and provide me with the necessary advice to continually optimise the performance.

First step, is to download the performance script and set the execute permissions:

  • cd /home/scripts
  • wget mysqltuner.pl
  • chmod u+x mysqltuner.pl.pl

We can run the above script, and it will provide the necessary diagnostics. However, that is a manual task and we want to automate the script to run weekly and send us an email with the results:

  • vi mysql_tuner_weekly.sh
  • #!/bin/sh
  • /home/scripts/mysqltuner.pl –user mysql-local –pass <Password> > /home/scripts/mysqltuner.log
  • cat /home/scripts/mysqltuner.log | mail -s “MySQL Tuner Log” email@domain.com
  • rm -rf /home/scripts/mysqltuner.log

The above script calls the mysqltuner.pl Perl script, providing the authentication to connect to the local MySQL instance. It will run the diagnostics, outputting the results to the mysqltuner.log file. This file is then emailed off to email@domain.com and the script then does housekeeping by remove the log file.

This script will not run on Windows, so if you want to optimise a Windows instance of MySQL, you need to use the following script:

  • #!/bin/sh
  • /home/scripts/mysqltuner.pl –host <RemoteServerFQDN> –port <RemoteMySQLPort> –forcemem <RemoteServerRAM> –user mysql-public –pass <Password> > /home/scripts/mysqltuner.log
  • cat /home/scripts/mysqltuner.log | mail -s “<RemoteServerFQDN> MySQL Tuner Log” email@domain.com
  • rm -rf /home/scripts/mysqltuner.log

I actually had a management server that had one script, connecting to all the Windows instances of MySQL and a script running locally on all the Linux instances.

Final step is to now schedule the script to run daily at 21:30:

  • vi /etc/crontab
  • 0 6 * * 0 root /home/scripts/mysql_tuner_weekly.sh

I would allow your MySQL server to run for a few days before you first run the script, so that MySQL can generate some stats for the scripts to analye. You will find that the first time it runs, you will get a lot of options to update in my.cnf, but after that, it die down.

Another performance script is available:

  • wget http://www.day32.com/MySQL/tuning-primer.sh

However, it only ever ran it locally because the output to email was too messy and I couldn’t get clean results. However, it is very useful to keep and run when running heavy performance diagnostics on the local MySQL server.

Pages:123»