Archive for category Short

How to add more memory to a Ubuntu Server with a Swap File

Types-of-Computer-MemoryIn linux Swapping is the process where memory is copied to the hard disk in space called swap space to free up physical memory. This is the same as virtual memory in linux. It is useful for two important reasons, First, when the system requires more memory than is physically available the kernel swaps out less used pages and gives memory to the current application (process) that needs the memory immediately. Second, a significant number of the pages used by an application during its startup phase may only be used for initialization and then never used again. The system can swap out those pages and free the memory for other applications or even for the disk cache.

There are two ways of setting up swap space in Linux, the most common is to set aside a swap partition when setting up the machine, the second is to set up a swap file. The later is useful if you didn’t set up a swap partition or if you’re using something like an Amazon EC2 micro instance that does not come pre-configured with a swap partition. Read the rest of this entry »

, , , , , , , , ,

No Comments

How to mass/bulk delete all unapproved comments from wordpress

Do you have the problem of hundreds of comments building up on your WordPress site, we’ll the best solution is to check it regularly and delete the unwanted comments, just leaving the appropriate ones. However what happens if you go on holiday for a week and don’t check your blog, or if your forget to look at your comments for a few day (i.e. lost weekend down the pub) well you’ll probably find several hundred comments have built up in this time. Now you can delete these comments manually but this is time consuming. To make your life easier I’m going to go through some simple ways of deleting all unapproved comments while not using phpMyAdmin (as every other tutorial I’ve seen does use phpMyAdmin). Read the rest of this entry »

, , , , , , , ,

No Comments

Enable potentially unsafe attachments in outlook

Ahh the “Outlook blocked access to the following potentially unsafe attachments” message, one of the most annoying things you can see when you in a hurry to get an attachment. However there is a good reason that attachments are disabled in outlook, some attachments can potentially be unsafe, as the warning says. But so long as you know were an attachment is from and you know the risks why can’t you enable these, after all you did pay for your computer and Office so you should be able to do what you want, right? Well in outlooks default setting there is no way to enable unsafe attachments, however there is a setting in the registry to enable them: Read the rest of this entry »

No Comments

C++ Simple Stream Socket Client Class

So I’ve been working on this project that heavily uses Sockets in C++, for the base of this project I’ve created a TCP Socket class so I concentrate on the protocol I’m using rather than worrying about the socket itself and I thought I would share this class with your. Read the rest of this entry »

, , , , , , , , ,

No Comments

CPU Limit Ubuntu Server 11.04 Command Line

I’ve was encrypting some files the other day with GPG and found that while the encryption was taking place my computer ground to a halt because GPG was taking up all of my CPU. Normally I wouldn’t mind this as I would just setup a few jobs and go make a cup of tea. Then I though what would happen if I run my encryption jobs on a webserver, well it grinds to a halt. So how do we run encryption jobs on our servers without affecting users, Read the rest of this entry »

, , , ,

No Comments

Ubuntu grub wont find Windows 7

Ubuntu 11.04So I recently upgraded my Ubuntu instillation to 11.04 and I will admit that at first I didn’t like it, however I’m always upset when people don’t like something just because it changes so I stuck with it for a few hours and I have to say i have grown fond of the unity interface. However after a while I wanted to boot into windows 7 and play some games, the problem was that grub hadn’t found the windows partition. So I had a browse around the internet and found several solutions to fix this problem. Read the rest of this entry »

, , , , , , ,

No Comments

Simple MySQL CSV import from Console

Everyone has the need to import and export data from a CSV into their MySQL database at some point or another. A quick search of Google reviles there are many different ways of doing this, and in my expectance some are far better than others. In this tutorial I’m going to show you my favourite way to import CSV data into MySQL using the “LOAD LOCAL DATA FILEcommand. Read the rest of this entry »

, , , , , , , , ,

No Comments

Install or upgrade Nagios to version 3.2.2

Nagios Core have been updated to 3.2.2
The update/installation process is not different as the one described in the main article Read the rest of this entry »

, , , ,

No Comments

MySQL Backup (mysqldump)

There are plenty of ways of backing up MySQL, however my personal preference is to use MySQL dump, here’s how you do it: Read the rest of this entry »

, , , , ,

No Comments

MySQL MD5 User Password

When you have a user’s table in your database it is bad practice to store user passwords within this table in plain text, the problem with this if anyone managed to hack your database or a mischievous employ looks at the table then they will be able to see everyone’s password.

However if we store the passwords using the MD5 Hash Function then it’s impossible to see the password, however all we can do is encrypt the users password and see if it matched the stored MD5 Function, so how do we do this: Read the rest of this entry »

, , , , , , , , ,

1 Comment