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 use Bind Mounting in Linux

Bind Mounting allows us to make one directory accessible from more than one location. It’s like “intercepting” directory1 and making the system redirect requests to directory2. Let’s take a look how to set this up and why we may want to use this technique. Quick Refresher: Device Mounting Perhaps you’re familiar with mounting devices to … Read more

How to SSH into a Virtual Machine in Parallels Desktop

I was pulling my hair out the other day trying to connect to a VM in Parallels Desktop. It’s fairly straightforward, yet rather complex at the same time. Here’s how to do it step by step. In this example I’m running Parallels Desktop 8 under Mac OS X 10.9 Mavericks, and my Guest OS CentOS … Read more

How to run PHP from the command line in Linux

Did you know that you can run PHP directly from the command line? Here’s how: Running a command Let’s run a one-liner and see the output displayed in our console. We’ll use phpinfo() because we know it should generate a lot of text. We need to start our line with php, use the -r switch … Read more

How to fix yum update failure blaming “qpid-cpp”

I’ve just tried to update one of my CentOS 6.2 servers that was built from an older AMI, only to find that the yum update command stopped unexpectedly with several dependency errors. They all pointed to something called “qpid”, and I must admit that I’ve never heard of it – nor did I know that … Read more

How to display wired clients on an Apple AirPort Time Capsule

Version 6.x of Apple’s AirPort Utility displays all your wireless client’s IP addresses, but it doesn’t show you wired devices. The old version 5.6 did, but without a hack it no longer runs on Mountain Lion. There is however a simple way to display all clients using the command line tool arp. Open up a … Read more

How to list installed packages on CentOS

yum can help us here. This should do the trick: #yum list installed If you’re interested in a particular package, you can pipe a search string into grep and only list filtered results: #yum list installed | grep “yum” keyutils-libs.i686 1.4-4.el6 @anaconda-CentOS-201303020136.i386/6.4 yum.noarch 3.2.29-40.el6.centos yum-metadata-parser.i686 yum-plugin-fastestmirror.noarch The search string doesn’t even need to be in … Read more

How to find my own IP address in CentOS

Two commands come to the rescue: ip and ifconfig. Either does the trick: #ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:19:99:0D:D2:58 inet addr:87.106.181.234 Bcast:87.106.181.234 Mask:255.255.255.255 inet6 addr: fe80::219:99ff:fe0d:d258/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14022830 errors:1 dropped:0 overruns:0 frame:1 TX packets:17605482 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6842851425 (6.3 GiB) TX bytes:22015650673 (20.5 … Read more

How to mount an EBS Volume in Linux

Once you’ve created an EBS Volume in the AWS web interface and attached it to an EC2 instance, how do you actually use it on your virtual server? Here’s how! The following commands assume you’re logged into your system as root. I’ve created a 13GB volume and attached it to my running instance. Before we … Read more