Linux Archives

Over 80% is running on some form of Linux – so does your Mac and you iPhone. Sometimes we have to get our hands dirty on the command line – it makes you feel like a proper hacker.

Here are some pointers I picked up on my journey.

How to remove __MACOSX from zip archives

Creating a ZIP file on your Mac is really easy: select a few files in Finder, right-click on those and select “Compress…”. It’s the equivalent of selecting “Send to ZIP Folder” under Windows. But Mac OSX does something rather bizarre when creating ZIP files: it adds several unnecessary, unwanted and un-called-for files starting with __MACOSX. … Read more

How to use yum-complete-transaction

Tux-says-YUMEvery once in a while it can happen happen that use use “yum update” to update your Linux system.

Usually this works without a hitch, but you may have come across a message such as this:

Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.

But what does this mean, and how do we alleviate this?

Read more

How to mount additional disk space in 1and1’s Cloud Server

Tux Linux IconAfter having a chat about what would be the best managed hosting would be with my friend at Bennet Office Technologies, I’ve just ordered a new Dynamic Cloud Server with 1&1 with a total of 800GB disk space. They rock, but they come with a minor inconvenience: due to the way these server instances are allocated, 1&1 do not automatically extend the partition for you – so you can’t actually start using the full amount you’ve ordered.

Here’s how to make use of the full disk space on a current file system:

Read more

How to setup MySQL Master/Slave Replication with existing data

mysqlThis is a step-by-step guide on how to replicate an existing MySQL server. The server is live and contains data and needs a constant backup companion.

Many tutorials focus on how to setup replication when no data is present on the system. That’s an ideal solution if you’re building a new setup, but in case you’ve got a server that already has data present then here’s how to accomplish the this:

  1. setup your existing MySQL server (with data) as a Master
  2. export all your databases and user accounts
  3. create a slave and import all your data
  4. start replication

I’ve done this several times and always forgot to take some notes – until today. Without further ado, let’s replicate MySQL.

Read more

How to install CentOS 6 on a Samsung NC10

NC10

Today was a rather exciting day for me: I’ve successfully turned my aging Samsung NC10 Netbook into an internal server in our office.

I bought the little guy in 2009 and he’s been my trusty companion on many jobs before I got an iPad. He still works fine, even though Windows XP was getting weird of late – and admittedly I hadn’t even turned him on in over 8 months.

Now my trusty pal is running CentOS 6.4 while sitting quietly in a corner next to the printer, serving as an internal Linux server. This is great for testing and automated backups – and in the same spirit as playing with a Raspberry Pi (in a much neater battery powered package).

Refreshing the NC10 wasn’t a picnic though, and some of the steps are rather involved. Here are my notes, in case I either have to do it again or you want to follow along.

Read more

How to add a System User Account on Linux (CentOS)

On both CentOS and Red Hat Linux systems you can easily create new user accounts with their own home directories. Here’s how you do this from the command line. I’m assuming you’re logged in as root, and the new user we’d like to create is called “testuser”: useradd testuser Let’s give our testuser a password … Read more

How to install Git on CentOS

Git-Logo-2ColorGit is a superb version control system that’s tightly integrated into Apple’s Xcode. To collaborate with some coding buddies of mine we wanted to setup a central remote storage on my Plesk server so we could all contribute to the code.

Since we did not want to share our code with the public we wanted to make it secure. So secure in fact that we could contribute from coffee shops around the world, hence we decided to use Git with SSH. This is probably the easiest and most straightforward way for read/write access to Git remotes: no daemon to setup, to Firewall to tweak – all we needed was a set of SSH credentials and a server running Git with a bit of space.

Read more

How to fix Duplicate Counter Error in OSSEC

You may come across a duplicated counter / duplicate error in OSSEC. This can happen when you try to add an agent to the server again which was previously added (say when you had to rebuild the OSSEC Server).

The agent is basically saying “hey I’ve got some data here which doesn’t line up with what I should be getting from the server”.

This problem can be resolved easily – let me show you how.

Read more