Hardware Tutorials

Tutorials on hardware, software, operating systems and more.

Installing MongoDB on CentOS 6

I would have written a guide on how I did this, but the blog post over on If Not True Then False covers it perfectly, so just go over there and follow their guide.

No Comments »

Saving files in memory

If you need super quick access to a file, for example a log file which isn’t going to be too big but it being used by a script which is time critical, then rather than writing it to disk, you can mount part of your file system in memory and write to it there.

This has the disadvantage that when you restart your system, you will lose the data. But for test scripts, logs or other temporary files that you don’t mind getting lost, it can really speed up performance.

Luckily, most systems come with a an area mounted in memory already – so you don’t even need to configure it!

cd /dev/shm

If said directory exists, you’ll have a memory mounted directory already and can start using it immediately.

No Comments »

Editing your hosts file

If you want to put custom entries in your computer’s DNS (for running addresses for a local server for example) you need to edit your system’s hosts file. On Unix systems this can be found at:

/etc/hosts

On Windows systems, you need to go to:

C:\Windows\system32\drivers\etc\hosts

To add a custom entry, first enter the IP address (if you’re running a local server you’ll want to set this as 127.0.0.1), then put a tab and then the host name.

No Comments »

Get the system time from the terminal

Wondering what your system date/time is? Easy!

date

It’s that obvious ;) . Don’t mistake it with the command “time”, which won’t return you what you want.

No Comments »

i386 or x86_64 architecture?

Wondering if you’re running i386 or x84_64? No problem, there is quick command which will return this information to you.

uname -i
No Comments »

Uncompress a .tar.gz file

Need to uncompress a .tar.gz file from the terminal? No problem.

tar xvzf filename.tar.gz
No Comments »

Installing Git on CentOS 5 cPanel

Following on from my previous post about installing Git on CentOS 4, CentOS 5 is a whole different story. This is because you actually can get the RPM for Git on Cent OS – but cPanel doesn’t make it quite easy enough to do it.

You see, cPanel likes to take control of a lot of it’s own stuff, so it has a long list of packages which it won’t update automatically, because it will end up breaking itself if it does. As Git has two dependencies from the Perl libraries, this causes a problem.

But we can easily fix that.

cd /etc/
vim yum.conf

Remove perl* from the exclude line, then save the file. Now you should be able to run the command.

yum install git

It will gather all the dependencies and install Git. Final step, go back into the YUM configuration and put the exclude pack in to protect cPanel from its malevolent self.

vim yum.conf
No Comments »

Installing Git on CentOS 4 cPanel

If you’re trying to install Git on CentOS with cPanel, you’ll probably be running into the problems where you can’t get hold the RPM because cPanel excludes all Perl modules. But that is a whole different problem to if you are running CentOS 4.

CentOS 4 doesn’t actually have the RPMs for Git at all. But luckily, it’s actually really easy to install on a cPanel server because cPanel should come will all the dependencies you need.

So, all you need to do is head over to the Git website, download the latest source (I tried it with v1.7.8.1) and compile it – no problems, no worries.

wget http://git-core.googlecode.com/files/git-1.7.8.1.tar.gz
tar xvzf git-1.7.8.1.tar.gz
cd git-1.7.8.1
./configure
make
make install
No Comments »

Integrating SVN with Apache

If you want to allow access to SVN via Apache, it’s actually nice and easy to install and configure it on a blank system. First, install Apache.

yum install httpd httpd-devel httpd-manual

Next, install Subversion.

yum install subversion

Now we need to bridge he two.

yum install mod_dav_svn

Once you have done this, we have everything we need. So we can go ahead and edit the Subversion configuration to add the Subversion directory to Apache.

vim subversion.conf

Finally, start and reload Apache, then go about creating your SVN repository.

No Comments »

Intellectual property and protest sites

A lot of people are using the internet to speak out against the companies that they object to. From the global protest sites such as www.stopesso.com to the small one man operations, protest sites are springing up all over the net. But can it be done without attracting a ball of law suites?

Starting these websites can be a problem on two fronts. The first problem is that if you start printing lies about the company they wouldn’t be happy about you bad mouthing them. The second is that if you register a domain such as www.xyzsucks.com are you breaking the trademark of xyz?

The first problem is easily to solve – don’t say anything unless you can prove it. First of all making up lies isn’t going to help the site as it will discredit it if it is discovered to be a lie and secondly it’s not really fair on the company. Which is why the can sue you if you start publishing lies. Stick to the truth of why you don’t like them though and they pretty much cannot touch you.

As for the second problem there is always the solution of not using the companies name in the website name but then how will people know the site is about that company? The good news is this is not a criminal act so even if the company does get angry, police are unlikely to come round knocking on your doors.

As huumor pointed out on one of my favourite web developer forums:

“if you hate McDonald’s and make a “hate” site called www.McDonaldsSucks.com – you are probably more likely going to be #”¤#&”¤-ed by McDonalds lawyers than if you would use www.CrapDonalds.com – with this domain name you’re not using the copyrighted McDonald’s in it…”

The problem is going to come from ICANN’s decisionon whether you can keep the domain or not. Some sites including www.walmartcanadasucks.com have been allowed to keep the names whereas a recent Reg Vardy protest site had its domain handed over to the company.

There is no clear rule on this one although running a search on The Register throws up some interesting results.

No Comments »