time to chill

Breakcore and drum’n’bass are all cool and shizzle but sometimes you just need something to chill to. Or maybe you simply want to block out those blabbing (but otherwise so nice) colleagues in that open landscape office with some non-distracting music. In that case some soothing ambient music is excellent but it’s still a matter of picking the right tracks so they really don’t make you go “da fuk is that?” when weird noises burst into your ears while the whole point is not to be distracted.

Since Soundcloud is such a great library of free, streamable and sometimes downloadable music, I thought I’d try to find me some good ambient tracks for general chillage. I conveniently packed what I found in a playlist for personal office-chillaxing, but since it’s shared you can find it right here and check it out. It might still grow, or not. Suggestions are welcome. share it, like it, whatever.

Another great playlist I ran into on my quest for chill tunes is this one from no other than the great electronic music producer Moby. Long Ambients1 is a list of long ambient tracks (du-uh) produced for doing yoga, catching sleep, meditate or whatever. They are also great for coding with headphones in loud offices I noticed.
There are links to various other download and streaming platforms from Moby’s site but conveniently you can stream them from Soundcloud again.

join the EFF summer security reboot and get some cool dice

DSC01217The Electronic Frontier Foundation is on the fore-front when it comes to defending our digital rights. Even as a European I think they are doing important work even though they are mostly US centric. This because whatever happens in the US ripples over the pond and affects Europe and the rest of the world anyway. That means that next to larger fast-food portions increased digital surveillance is on its way to the EU as well.
Next to protecting our digital rights they are the author of a number of awesome security plugins and tools like the HTTPS Everywhere and Privacy Badger browser plugins and a driving force behind the Let’s Encrypt free web site certificate tool set.

Next to a lot of security tools and tips (see the site & newsletter) they now have a Summer Security Reboot fund drive where you can get a cool geeky secure-password generating dice set for a mere $20 membership until the 20th of July.

So if you like what they are doing for a secure and free internet in the future, go check them out and get yourself some cool dice in the process.

If you feel more like donating to a EU centric counterpart of EFF, you can check out EDRI.org instead (no dice there though).

Photo by Violet Blue, cc-licensed.

indent selected lines with tab in vim

.vimrcOne thing that annoyed me about using Vim was how much keystrokes it took to indent or un-indent a few selected lines of code. My (probably less than ideal) way of doing that was to go into visual mode, select the lines with the movement keys J or K, then use the keys to change the indenting which are < or >.
To indent another level, pressing dot after this would work.

In Visual Studio or a typical Windows text editor I’m used to simply selecting the lines by holding shift & moving the cursor keys up or down, then pressing TAB to indent and shift-TAB to un-indent.

I’m so used to using the cursor keys for text manipulation that it’s hard to unlearn this, so I was looking for key mappings to do the same thing in Vim.
Luckily this turned out to be rather easy. If you add the following to your vimrc file, you can shift-tab away to indent your code:

" TAB-mappings to allow indenting of selected text instead of using < & >
vnoremap <Tab> >
vnoremap <S-Tab> <

warmup your site or wordpress blog with a single command line statement

mother

GNU Wget is a powerful tool when it comes to downloading files from the web or mirroring sites. It’s command line features can be daunting and not very obvious. With some experimentation, reading the (f..) manual and some Googling you can get it to do some pretty neat tricks for you.
All of that is from the command line too, which is great if you want to schedule this kind of magic or use it in a script.

For example, you might want to warm-up your site or WordPress blog so your homepage and all posts linked from it are present in your cache when a visitor arrives. I’m assuming you are using a caching on your site otherwise this is pretty pointless. For WordPress you can use a caching plugin like W3 Total Cache for example.

With Wget, it goes like this:

wget.exe http://n3wjack.net --spider --no-directories --level=1 --recursive 
         --accept-regex=n3wjack.net/20[1..9].*

The command line parameters (in order) mean something like:

  1. Crawl n3wjack.net.
  2. Crawl it like a spider (follow the links).
  3. Don’t create directories for downloads.
  4. Crawl 1 level deep (so anything linked on the homepage is OK, but don’t go deeper).
  5. Do this recursively (so it actually goes 1 level deep).
  6. Follow only links that start with "/201..." to "/209..." (it’s a regular expression).
    This one is a trick to have it only follow links to blog-posts because my URL scheme begins with the year of the post (2015, 2016, …). It’s good until 2099, which should do the trick I guess. :)
    This way I’m also avoiding it loading all tag, category or page links.

If your site has a different URL scheme you’ll have to change the accept regex pattern to fit your scheme.

You can download Wget from the GNU site. It’s Open Source and is available for Windows, Mac and various Unix systems.
For Chocolatey users, there is a wget package available to install it on your system.

verifying an md5 file hash with just powershell

Tools
You see this possibility for a lot of software downloads but if you’re like me you hardly ever end up doing it: verifying an install file’s MD5 or SHA-something hash.
For Open Source software this is however recommended if you aren’t downloaded from the official mirror (and even then) and certainly if it’s anything related to security (like Keepass for example).

But to verify that MD5 hash you probably need to install yet another piece of software you’re hardly going to need, so you end up not bothering at all.

Hold on a second.

If you have a recent Windows system with PowerShell installed, you probably have all you need to verify that MD5 hash.

Try this in the PowerShell command prompt:

Get-FileHash .\KeePass-2.30-Setup.exe -Algorithm md5

It should print out something like this:

Algorithm       Hash
---------       ----
MD5             CD430EB0F108BB192D2155C68EB7BB48

Which happens to be exactly the MD5 hash code listed on the site for that version of the Keepass installer. Yay!
Without that -Algorithm parameter it prints out the SHA-256 hash by default, but that’s longer and harder to compare visually even though it’s more precise.

That was easy and required no additional software.
Pretty damn sweet.

Photo by Julien Dumont, cc-licensed.

how to move an unreachable window on windows 7, 8 or 10

arrowsOn the “good” old XP this required some trickery and knowledge of window specific shortcuts, but on more recent version of Windows this has become really easy to do.

So if you run into a situation where an application’s window is outside your visible area, because you disconnected a second screen for example and the app doesn’t automatically snap to the only screen left, simply do this:

  • Keep the Windows key pressed and hit the cursor key left or right.

Your window will simply snap back to your current screen and all is well.
Using it with the up & down arrow will maximize or minimize the active window. Always handy to know those shortcuts if you have both hands on the keyboard anyway.

Photo by Dean Hochman, cc-licensed.

mstsc.exe crashes on Windows 8 (and how to fix it)

Physical View of the Network

When using MSTSC (Microsoft Terminal Server Client aka RDP or Remote Desktop on Windows) to dial into a local HyperV virtual machine on my laptop it often happened that MSTSC crashed on me. When reconnecting afterwards, the VM was running just fine. So it seemed to be an issue on my local machine and not the VM. I assumed it had something to do with HyperV and RDP and didn’t look into it any further (I didn’t need it that much after all).

The exception code I got in my Event Viewer for the crash was 0xc0000005 on ntdll.dll.

But then I kept having this problem so often when connecting to a physical machine in the network it annoyed me enough to Google for a possible solution.
One post pointed me in the right direction (which I can’t find anymore, sorry about that), being that it had something to do with sharing of local resources. In my case I recently activated the option to transfer sound between the remote and my local machine so I could use Skype & Linq.

Turns out that was indeed the culprit. Whenever my remote machine made a sound, my RDP client crashed. Bummer!
Turning off sound transferring to my host machine made the crashes go away. Sweet!

So if you also run into this, try turning off some of those local resources.

It still sucks if you need sound of course, but in my case, I can live with the silence.

Photo by Robin Gist, cc-licensed.