Let me describe the scenario: You have a linux software raid (raid5, in my case, created with mdadm). On top of it, you have a few LVM volumes, and LUKS encrypted partitions. You literally set this up 10 years ago - 4 disks 2 Tb each. It has been running strong for the last 10 years, with the occasional disk replaced. You just bought new 8Tb disks. And now, you want to replace the old disks for…
Let's say you have a Carbon X1 5th gen . Let's say your trackpoint is an TPPS/2 Elan TrackPoint (and you can check this by running xinput |grep -i TrackPoint ). Let's say you have tried various xinput or /sys/.*/acceleration or /sys/.*/speed settings. But still... Your trackpoint is WAY TOO SLOW!! This is what fixed it for me: Run: mkdir -p /etc/libinput Create a local-overrides.quirk file with:…
When thiking about Docker and what it is designed to do, what comes to mind are disposable containers : containers that are instantiated as many times as necessary to run an application or to complete some work, to then be deleted as soon as the work is done or the application needs to be restarted. It's what you do when you use a plain Dockerfile to package an application and all its dependencies…
When you run a an application under docker, you have a few different mechanisms you can choose from to provide networking connectivity. This article digs into some of the details of two of the most common mechanisms, while trying to estimate the cost of each. Using -p The most common way to provide network connectivity to a docker container is to use the -p parameter to docker run . For example,…
I recently had to increase the size of an encrypted partition on my Debian server. I have been a long time user of LVM and dm-crypt and tried similar processes in the early days of the technology. I was really impressed by how easy it was today, and how it all just worked without effort without having to reboot the system, mark the filesystems read only, or unmount them. Here are the steps I used,…
When talking about using Debian, one of the first objections people will raise is the fact that it only has "old packages", it is not updated often enough. This is generally not true. Or well, "true" if you stick to the "stable" release of Debian, which might not be the right version for you. Also, people don't often realize that it's easy to use more than one "release" on a given system. For…
I have always heard that it was possible to guess the content of "HTTPS" requests based on traffic patterns. For example: a large long download from youtube.com, is, well, very likely to be a video :). But how easy is it to go from a traffic dump, captured with something like tcpdump to the list of pages visited by an user? Mind me: I'm talking about pages here - URLs, actual content. Not just…
Let's say you are thinking about moving to Rome in the near future. Let's say you have family, and you want to find all daycares within 30 mins by public transport to your perspective new house. Or maybe you want to find a house that's near a daycare, which in turn should be within 30 mins to your workplace. In the past, I would have done this manually: find list of day cares, look at a map, check…
Did you know that you can generate nicely formatted HTML file from your source code with clang ? I just noticed this by peeking in the source code, took me a few attempts to get the command line right, but here it is: clang - S - Xclang - emit - html test . c - o test . html Which will create a colorful and nicely formatted version of your .c file, which you can see here . The only annoyance? Not…
Recently, I tried to run a Java application on my Debian workstation that needed to establish SSL / HTTPs connections. But... as soon as a connection was attempted, the application failed with an ugly stack trace: ValidatorException : No trusted certificate found sun . security . validator . ValidatorException : No trusted certificate found at net . filebot . web . WebRequest . fetch ( WebRequest…
A bit more than a year ago I became the proud parent of the cutest little girl in the world. By living abroad and traveling often, the little one had to endure quite a few trips with us on her first year: west to east coast and back, with a road trip involving New York and Boston, a few trips to Europe and one trip to Hawaii. All spiced up with hours of driving and a few rides on trains, buses and…
I have been living in different countries for the last 10 years. Although I can get in touch with friends and family using gtalk, skype, or you name it, having an extremely cheap phone line to receive or make calls on can come in handy. Given my love for technology, trying out VoIP (or voice over IP, or phone over the internet), seemed like the next logical step. There are 2 things you need to do…
In a previous article we talked about how to use ssh keys and an ssh agent . Unfortunately for you, we promised a follow up to talk about the security implications of using such an agent. So, here we are. If you are the impatient kind of reader, here is a a few rules of thumb you should follow: Never ever copy your private keys on a computer somebody else has root on. If you do, you just shared…
If you work a lot on linux and use ssh often, you quickly realize that typing your password every time you connect to a remote host gets annoying. Not only that, it is not the best solution in terms of security either: Every time you type a password, a snooper has an extra chance to see it. Every host you ssh to with which you use your password, well, has to know your password. Or a hash of your…
Down with the spinning disks! And hail the SSDs! That's about what happened the last time I upgraded my laptop. SSDs were just so much faster, energy efficient, and quieter that I couldn't stand the thought of remaining loyal to the trustful spinning disks. So... I just said goodbye to a few hundred dollars to welcome a Corsair Force GS on my laptop, and been happy ever after. Or so I thought.…
The Problem Let's say you want to add a search box to your web site to find words within your published content. Or let's say you want to display a list of articles published on your blog, together with snippets of what the article looks like, or a short summary. In both cases you probably have an .html page or some content from which you want to generate a snippet, just like on this blog: if you…
Have you ever had to pay extra fees to carry oversize luggage? Flown somewhere, ended up buying so many things that they did not fit your suitcase anymore? Here's a nifty trick we used in our last trip to Europe which allowed us to carry much more than we believed we could at no extra charge. The Basics First: make sure to read the allowances for carry on and check in baggage on your ticket. Make…
With my last laptop upgrade I started using awesome as a Window Manager. I wasn't sure of the choice at first: I have never liked graphical interfaces, and the thought of having to write lua code to get my GUI to provide even basic functionalities wasn't very appealing to me. However, I have largely enjoyed the process so far: even complex changes are relatively easy to make, while the…
Let's say you want to make the directory /opt/test on your desktop machine visible to a virtual machine you are running with libvirt. All you have to do is: virsh edit myvmname , edit the XML of the VM to have something like: <domains ... > ... <devices ... > <filesystem type= 'mount' accessmode= 'passthrough' > <source dir= '/opt/test' /> <target dir= 'testlabel' /> </filesystem> </devices>…
All the libvirt related commands, like virsh , virt-viewer or virt-install take a connect URI as parameter. The connect URI can be thought as specifying which set of virtual machines you want to control with that command, which physical machine to control, and how. For example, I can use a command like: virsh - c "xen+ssh://admin@corp.myoffice.net" start web - server to start the web-server…
While traveling, I have been asked a few times by security agents at airports to turn on my laptop, and well, show them it did work, and looked like a real computer. Although they never searched the content and nothing bad ever happend, every time I cross the border or go through security I am worried about what might happen, especially given recent stories of people being searched and their…
The Problem I am writing a small python script to keep track of various events and messages. It uses a flat file as an index, each record being of the same size and containing details about each message. This file can get large, in the order of several hundreds of megabytes. The python code is trivial, given that each record is exactly the same size, but what is the fastest way to access and use…
Some say that clothes smell and look better when dried with sunlight in the summer breeze. I can certainly state that if you have to pay to use a dryer, it is much cheaper to use sunlight, and line dry. And really, it's not that much more work. The only annoying part where we live is the wind: yes, it gets the clothes to dry faster, but it also gets them to fall off the line, and on the grass of…
Just a few days ago I realized that the Raspberry PI I use to control my irrigation system was dead. Could not get to the web interface, pings would time out, could not ssh into it. The Symptoms The first thing I tried was a simple reboot. The raspberry is in a black box in my backyard, maybe the hot summer days were... too hot? I have a cron job that shuts it down if the temperature goes above 70…
When it comes to HTML, CSS, and graphical formatting, I feel like a daft noob. Even achieving the most basic formatting seems to take longer than it should. Giving up on reasonable compromises is often more appealing to me than figuring out the right way to achieve the goal. Anyway, tonight I am overjoyed! I wanted to have a <pre> block, with code that: had an horizontal scroll bar. but only when…
I've always liked text consoles more than graphical ones. This at least until some time in 2005, when I realized I was spending a large chunk of my time in front of a browser, and elinks, lynx, links and friends did not seem that attractive anymore. Nonetheless, I've kept things simple: at first I started X manually, with startx , on a need by need basis. I used ion (yes! ion ) for a while, until…
If you like hacking and have a few machines you use for development, chances are your system has become at least once in your lifetime a giant meatball of services running for who knows what reason, and your PATH is clogged with half finished scripts and tools you don't even remember what they are for. If this never happened to you, don't worry: it will happen, one day or another. My first…
Just a few days ago I finally got a new server to replace a good old friend of mine which has been keeping my data safe since 2005. I was literally dying to get it up and running and move my data over when I realized it had been 8 years since I last setup dmcrypt on a server I only had ssh access to, and had no idea of what best current practices are. So, let me start first by describing the…
Let's say you have a CSS with a few thousand selectors and many many rules. Let's say you want to eliminate the unused rules, how do you do that? I spent about an hour looking online for some tool that would easily clean up CSS files. I've ended up trying a few browser extensions: CSS Remove and combine, for chrome , did not work for me. It would only parse the very first web site in my browser…
A simple problem... Let's say you have a regression test or fuzzy testing suite that relies on generating a random set of operations, and verifying their results (like ldap-torture ). You want this set operations to be reproducible, so if you find a bug, you can easily get to the exact same conditions that triggered it. There are many ways to do this, but one simple way is to use one of many…
While trying to get ldap torture back in shape, I had to learn again how to get slapd up and running with a reasonable configs. Here's a few things I had long forgotten and I have learned this morning: The order of the statements in slapd.conf is relevant. Don't be naive, even though the config looks like a normal key value store, some keys can be repeated multiple times (like backend, or…
Have you ever been lost in conversations or threads about one or the other file system? which one is faster? which one is slower? is that feature stable? which file system to use for this or that payload? I was recently surprised by seeing ext4 as the default file system on a new linux installation. Yes, I know, ext4 has been around for a good while, and it does offer some pretty nifty features.…
Back in 2004 I was playing a lot with OpenLDAP . Getting it to run reliably turned out more challenging than I had originally planned for: BerkeleyDB performance was terrible if the proper tunings were not provided. Nowhere in the docs was mentioned that this was necessary. The way to do it was to drop a DB_CONFIG file in the top level directory of the database. Not a feature of openldap, rather a…