Cleaning up a Debian GNU/Linux system

An old post from Thu 9 Nov 2006

You arrive at a Debian GNU/Linux server which has some history of neglection. Let’s suppose someone else neglected it but if your new-year resolution is to stop neglecting your beloved server, this applies as well.

One form of neglection is to install, install, install and never un-install any package. The common utility to perform installation and un-installation of packages is apt-get which adds to the problem because it doesn’t have automatic removal of non-needed dependences.

That means that when phpMyAdmin was installed it also installed Apache, PHP and ton of other packages. phpMyAdmin was removed when it was no longer needed but Apache, PHP and the ton of packages remain there.

Aptitude to the rescue. Aptitude is another package manager front-end like apt-get but it can keep track of automatically and non-automatically installed packages. That means that when you installed phpMyAdmin it was marked as non-auto while Apache and company was marked as auto. When you remove phpMyAdmin all the non-needed automatically installed packages like Apache would be removed.

That is nice, but since the neglecting previous administrator didn’t use Aptitude, all the packages are marked as non automatically installed. The safe way so Aptitude doesn’t remove anything that it is needed.
So, what to do now ?

Well, the answer is: try to mark all files as automatically installed except those that you really want. To do that you can use the following (which you could write in one line if you want):

for pkg in $(aptitude search ~i | grep -v "i A" | cut -d " " -f 4) ; do
 echo "-- markauto $pkg --";
 aptitude markauto $pkg;
 done;

A little explanation about this. This piece:

aptitude search ~i | grep -v "i A" | cut -d " " -f 4

you can run it by itself. It list all installed packages, then grep remove all those marked as automatically (we really don’t care about them). The cut part extracts the name of the package.

Once you have the name of each package you print a little header to know what package we are talking about and then try to mark it as automatic with:

aptitude markauto

in many cases marking a package as auto will not remove it, because another package depends on it, on other cases it’ll remove the package and maybe some other non-needed packages. In those cases Aptitude will ask you wether you want to continue or not. That is where you’ll have to do your job, analyze wether those packages are needed or not. If they are, tell Aptitude not to perform the operation and the for loop will continue with the next package.

At last, you may also consider removing the configurations of all those removed packages. Before doing this, make backups, that’s very important and I meant it.

To remove the configurations you can use the following code:

for pkg in $(dpkg -l | grep "^rc" | cut -d " " -f 3) ; do
 dpkg -P $pkg ;
 done

At the end you’ll have a system that is a bit cleaner.

Copied from here.

 

Internet connectivity

Found an old version of this blog, and one of the posts was about the speed of the internet.

So, blast from the past in 2009 I was getting speeds like this:
492186377

Need to rerun this test, but got the following a couple of months ago:
3307882637

Oh how times have changed ;)

 

 

PSAPC-3281-hg

APC Back-Ups CS 350VA

Now that I have the synology setup and running very well, it’s a good idea to get it running behind a ups.

I ordered the APC Back-Ups CS 350VA UPS,  and it arrived today.

Shut down the synology, plugged in the power and data cable, switched on and voila.

After the synology started up, I logged in and enabled the ups functions, enabled the network UPS server, and now when the power goes out the synlology will shutdown cleanly, and annouce the loss of power to other devices on the network.

Just need to get my router behind the UPS and then all done ;)

Synology DS1813+

Synology DS1813+

It arrived today, in a big box… My brand new NAS and 6 drives.

Opened the box at work cause one of the guys (Hi Matt), wanted to see what it looked like, but then it went back in the box and I put it in the car.

Once I got home and sorted out all the house/life stuffs, I set out to install the drives. I was amazed at how quick and easy it was to install the drives, completely tool-less.

Once I had the drives installed I booted it up, it took a couple of minutes, and all the lights flashed away.

After a quick network scan, I found the IP and then connected to it, and was greeted by a quick start wizard. Nice and simple.

It took about an hour to build the initial volume (6x3TiB ~= 18TiB volume). And it’s still busy verifying the volume which is gonna take a while.

Then I just need to move all my data from my old server, and then put the two 3TiB drives from there into the NAS, and then all done :)

UPDATE Got all the data moved across (lost a couple of episodes somehow) and now have a 18TiB Volume, that should last a little while :p

Welcome-on-Beach

Welcome to my Blog

Lets give this blog thing another go. It’s been a while since I last posted anything on a blog.

I have tried different things and I keep ending back here, on wordpress.

I also managed to pull in some of the old posts on my GitHub pages site.

openelec_raspberry

Media centre

A while ago I learned about the RaspberryPI, and I found out that it was good enough to use as a media player. Well I managed to get two, loaded OpenELEC on them, setup XBMC MySQL syncing and now both tvs are connected to my media collection.

I even got XBMC running on my Android tablet, also hooked up to the MySQL db, the only problem I had was that the paths were not working on the Android client, but a quick tweak to the path substitution in the XBMC advanced config file and everything is working.

The only thing I need now if to upgrade my space, currently running out of space. I’m looking to get the Qnap TS-870 Pro and 8 x 4TiB Western Digital Red harddrives. P.S. Donations are welcome ;)

I’m hoping to put up a tutorial on how to setup OpenELEC and MySQL syncing, just need to make some time.

UPDATE Managed to get myself the Synology DS1813+ and 6 x 3TiB Western Digital Green Drives (I already have two), so this should last a while ;)

My-Sony-Xperia-Wallpaper-Logo-Z_(69)

Sony Xperia

I am really impressed with the new line of gadgets from Sony, so adding to my wishlist are the following:

My cellphone contract is up for renewal in April, I’m hoping that the Z2 will be available, but if it’s not available then I will have to wait an extra month or two ;)

UPDATE Got my upgrade on 18th June 2014, all together I got the Z2, Style Cover, Smartband and Smart Watch 2.