Fixing /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Today I had to run a script on a 64Bit server, but was met with the following error:

/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Reason for the /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory error

The /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory error will happen only on 64 bit systems, the cause is the that 32 bit libraries are missing from the system and the script/program needs them, so it can’t run.

How to fix the /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory error

Continue reading

mysql-logo

MySQL get size of all databases in megabytes

Why would you want to get the size of all databases in my MySQL?

Reason for this could be many, in my case I wanted to make sure replication worked as expected, I wanted to see the size of my database be the same on all my MySQL servers. And also I was a little curious how big some of my databases was.

There’s not much to write on this matter, just thought somebody could use this query, I know I am going to use this query many times in the future again.

The query for showing databae sizes in MySQL

It’s one tiny query actually. Just fire up a mysql client – phpmyadmin, mysql in terminal or you can even do this in a script.

The query:

SELECT table_schema AS "Database name", SUM(data_length + index_length) / 1024 / 1024 AS "Size (MB)" FROM information_schema.TABLES GROUP BY table_schema;

Sample output:

+----------------------------+-------------+
| Database name | Size (MB) |
+----------------------------+-------------+
| information_schema | 0.15625000 |
| mysql | 1.12139893 |
| performance_schema | 0.00000000 |
| phpmyadmin | 0.04900742 |
+----------------------------+-------------+
4 rows in set (0.01 sec)

View network bandwidth for each process in Linux using Nethogs

Have you ever been in the saturation that your Linux server is using a lot of network bandwidth, but it’s a guesswork to find the process using it all?

I just stumbled upon this tool, it’s not a new tools, but it’s extremely useful!

Let’s say you have a server running apache, mysql, ftp, btsync and a lot of other network services. and somehow that server is using up 100Mbit constantly. You want to find out what it is but only got tools like iftop, atop, iptraf and others which are all great tools, but they only show which connections are using the network bandwidth.

Continue reading

xbindkeys

Make your own keybindings in linux using xbindkeys

Are you like me, who want to listen to music while you work? But then your boss comes over and you quickly have to pause it? Or maybe you just want some key bindings on your linux workstation to make life a lot easier, then look no further! xbindkeys is the solution, and I will show you how in this post! it’s really easy to configure and extremely helpful.

In my example, I will use it to pause/unpause my music when i press CTRL+space no matter what desktop I’m on and even if I’m not in the terminal where MOC (the music player I use) is running.

What you need

xbindkeys is the name of the only package you need for this. It should be in the official repository for your distro. Install examples below:

Debian

apt-get install xbindkeys

Arch Linux

pacman -S xbindkeys

CentOS

yum install xbindkeys

Continue reading

logtail

Get all new dhcp leases, but only the new leases since last check in bash

I needed to make a bash script for work that got the ip address of all new leases in the dhcp server, but only the new ones.
I spend some time looking for something useful, and therefore I decided to write a short post here to help others since i had a hard time finding it (maybe my google-fu is not as good as it should be)

The script had to do the following:
1. Get all new lines from a log file since last run
2. Get the ip addresses of the new leases
3. Do some stuff with the new ip addresses. This will not be part of this post
4. Run every minute in cron. This will also not be part of this post

In this post I will only cover how i did 1 and 2.

Continue reading

centos

How to install a CentOS 7 64Bit server

With CentOS 7 just released, I thought it would be a great time to make a CentOS 7 64Bit server installation step-by-step guide, with pictures and everything just like the old CentOS 6.5 64Bit server installation guide.

Requirements for installing a CentOS 7 64Bit server

You don’t need much for this, of course you need a computer or server to install this on, and the only other things you need are a working internet connection on the server and the CentOS 7 64Bit iso.

You can download the iso here: http://centos.skarta.net/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-DVD.iso

Continue reading

harddrive

Creating and mounting a partition lager than 2 TB in Linux

This might be basics for some, but it’s a good thing to have bookmarked for the day you might need it. It helped me a lot.

Why can I only use 2 TB (TeraByte) of my 2+ TB drive in linux?

The answer is really simple. I guess you formatted the drive using “fdisk” which use a ms-dos partition table.
MS-dos partition table (MBR) is 32 bit, and thereby it can’t handle anything above 2 TeraBytes

How to create a partition above 2TB in linux

To fully use your 2+TB harddrive, you have to use a partition table that supports it. We now know that the MS-DOS partition table (MBR) does not, so what should you use instead? GPT.

GPT supports up to 9.4 ZB (ZetaByte). That’s 9895604649984 GB (GigaByte)!. It’s pretty safe to say, that you will not hit this limit in the near future.

Continue reading

word_lens

Word lens – The real time translation app for Android and IOS is now free!

Word lens is not really Linux, or hardware related. But i’m sure every tech geek will love this.

What is World lens

Word lens is an app that can translate text from signs, papers or similar through the phones camera. I think it would be simpler to just show you their official video:

The app is not perfect, and if you try to translate something on a computer screen, it will “flicker” a bit. But it’s a nice and useful tools to have in your pocket when you are travelling or just visit another country, specially because it will work without any internet connection!

Continue reading

iLO-Configuration

Find all HP ILO interfaces on a subnet in Linux

By default, HP’s ILO interfaces are set to DHCP.
Yes you could go into your router to see which DHCP lease it got, but here is a much more easy solution that you can use anywhere, even though you don’t have access to the router/DHCP server.

Requirements

You don’t need much. What you need on your Linux computer for this to work is:

  • sudo (You only need this if you are not logged in as root)
  • nmap

Continue reading

bin-bash-extended.sh-600x600

Execute commands if load average is above in linux

Description

I needed this to do some testing with a load problem I had. One of our server would spike in load for a minute or two, but at random times.
I needed to see what was generating these spikes, but did not want to sit around waiting for it to happen and being ready to hit enter on the commands i needed to run when the load was spiking. So I made this simple little script that you can edit to your needs.

It’s a bash script, and requires the package “bc” to be installed (install it using your package manager if you don’t already have it installed.)

I have tested the script on CentOS and Debian.

I have tried commenting everything in the script as good as possible, but if you have any changes feel free to post a comment.

Continue reading