Recently came across a scenario, where curl was able to connect to localhost but not 127.0.0.1. When I tried curl 127.0.0.1:80, it just hung there. While curl localhost:80 returns the expected output.
My first instinct was to check apache config to see if it was only serving to localhost and not the IP address. But that seemed unlikely because /etc/hosts had the correct entry.
My next big clue was when I tried curl -v localhost:80, this was the output -
Scenario: You SSH into an Ubuntu server. How do you know if you just logged in inside a docker container, or just a regular VM?
Turns out there are no straight answers.
Docker provides virtualization based on Linux Containers (LXC). LXC is a technology to provide operating system virtualization for processes on Linux. This means, that processes can be executed in isolation without starting a real and heavy virtual machine. All processes will be executed on the same Linux kernel, but will still have their own namespaces, users and file system.
In the previous post we figured out how to find the process which is writing an open file. And we also saw that we can kill the process and it’ll stop it from writing to that file. But what if we are not supposed to kill the process? But we still need to close the file.
First we need to figure out the file descriptor for that file for that process.
Scenario: Imagine you login to a server and you find that the disk is filling up rapidly. Either by using df -h or du -h -d1 /<dir> or getting errors like no more disk space left etc. How do you figure out who is filling up the file?
Solution: Let’s say the file in question is /var/log/badd.log and it’s rapidly filling up.
First step is to use lsof to figure out which process has that file open. To write to a file, any process has to first open that file. So the process will show up in lsof, which is a program to “list open files”. With any luck your output will show up like this -
I recently bought a new (used) laptop, a Lenovo Thinkpad T430, and decided to install Linux Mint with KDE on it. I used to use Cinnamon but decided to give KDE a chance because I’ve used KDE apps before and they’re the finest.
It’s been running fine since then except, I’ve had this problem where once in a month or so, when I close the lid, the laptop sleeps for a second and then wakes up instantly. First I thought it was a kernel issue, so I updated the kernel and that fixed that somehow. So I kept using it but then again in about a month it happened again. I updated the kernel again, it went away. Then today morning it happened again. By now I’m pretty sure that it’s not a kernel issue. Something is stopping the system from falling into sleep. So I looked in to syslog and looked for logs around the time the wake up happened to see if there is any error logged there. I didn’t find any error and the log looked like this -
I cannot stay away from Terminal. :| So I was setting up a debian box inside my Windows installation. I downloaded a net installation image of Debian 6.0.3 (debian-6.0.3-i386-netinst.iso) and booted into it in VirtualBox. Well, while installing it, VB was in NAT mode and I didn’t notice that. So the installer configured the OS according to NAT mode and I had the network connection after I logged in. But as I wanted to run few server applications, I needed the OS to use a bridged connection. So I opened the network configuration of VB, changed it to Bridged Adapter mode, selected by adapter, hit Ok, then restarted the network service in the box and tried to ping google. But got error. The network wasn’t working.
Want Linux Discs? All you need is an internet connection to make the request and/or a postal address. I’m assuming you have the both. :)
Ubuntu****Request CD: https://shipit.ubuntu.com/ (Ubuntu has stopped the Shipit service. You need to download it now.)Download http://www.ubuntu.com/getubuntu/download
Kubuntu****Request CD: https://shipit.kubuntu.com/ (Same as Ubuntu. No CD, just Download.)Download http://www.kubuntu.org/getkubuntu
Fedora****Request CD: Its a bit tricky. First go here - https://fedoraproject.org/freemedia/FreeMedia-form.html, The form is opened at the beginning of each month. If it says that the form is closed for this month, then find your nearest Fedora ambassador from here and mail them. They will surely attend you as soon as possible. Download http://fedoraproject.org/get-fedora