One 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> <
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.
The command line parameters (in order) mean something like:
Crawl it like a spider (follow the links).
Don’t create directories for downloads.
Crawl 1 level deep (so anything linked on the homepage is OK, but don’t go deeper).
Do this recursively (so it actually goes 1 level deep).
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.
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.
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.
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.
You know how it goes. You get this new and shiny computer from big computer company X and with it you don’t only get your OEM licensed Windows OS but also some “super handy” tools X happened to install just for you.
Dell is no different so mine come with Dell Data Vault, Dell SupportAssist and Dell Update Service. All of this is (of course) for your own benefit to update your machine to the latest drivers and blah blah blah, even though anything crucial is sent through Windows update anyway.
The downside is that these things are constantly running and using up your precious CPU and memory, while you’ll probably never need them. Ever. Oh, and they also come with some securityvulnerabilities apparently, which is always a good reason to kick their butt.
I don’t know what Dell Data Vault even does and don’t care to either (its backup software probably). To make things worse it even causes my system to lag sometimes which I notice as my audio glitches up when that happens. I don’t always listen to breakcore you know, so I do noticed that sometimes.
I also noticed that uninstalling Dell Data Service is pointless as (I think) the Dell UpdateService will just reinstall it. Which sucks.
So I see two options.
Uninstalling all Dell related software. This is kinda drastic and you might want that stuff if you need support after all.
Disable the software and prevent it from starting up altogether.
So how do you stop those services from starting up automatically? Here’s how:
On you desktop, press WindowsKey-R, this brings up the Run prompt.
Type services.msc and hit enter. This brings up the list of services installed on your machine.
Look for the Dell ones in the list.
Open them, one by one, and in the General tab select the startup type “Disabled”.
Hit “OK” to save.
Note that in the screenshot I’m disabling a completely innocent service per demonstration as I don’t have a Dell machine handy with an English version of Windows on it.
From now on those pesky services won’t be wasting your resources anymore, until the day you might need them again. All you have to do then is go back into the services console and switch the startup type back to Automatic and save.
Then right-click the services in the list and choose “Start”, or simply reboot the machine.
But we’re not quite there yet. There’s still the case of PCDoctor and the SupportAssist client. Those sneaky startups are hidden in the scheduled tasks. You can disable them using the Task Scheduler like this:
Press WinKey-R and type Taskschd.msc, press enter.
In the list of scheduled tasks in the root node you’ll see a “Dell SupportAssistAgent AutoUpdate” or something similar.
Right click the task and choose “Disable”.
Repeat for any other Dell tasks in there.
They don’t all have “Dell” in their name, but if you check the Action tab below the path to the executable will give them away (like in the screenshot). In my case I had some additional PCD (PC Doctor) tasks and one SystemToolsDailyTest task to disable.
Another good tool to disable scheduled tasks if from the CCleaner tools menu, or by using the SysInternals Autoruns tool.
This worked for me, but as is mostly the case with things you find on the internet… use this info wisely and at your own risk. ;)
Chocolatey rocks when it comes to updating a bunch of installed software from the command line. If you’re not doing that often however it can be hard to remember exactly what commands you can use to do that quickly. So here’s a little run-down on the most helpful commands when you are updating your system.
First you might want to check what’s installed on your machine.
You can get the list of the local package Chocolatey installed like this:
choco list -localonly
or for short:
To check if any package have updates available chocolatey now has the outdated command:
Ready to update all packages at once? Nice. So let’s disable those confirmation prompts while we’re at it too by adding the -y switch.
choco upgrade all -y
cup all -y
If you want to upgrade individual packages you can specify them by listing them after the upgrade command:
choco upgrade conemu irfanview vlc vim -y
Edited 26th February 2017 : replaced deprecated update command with the new Chocolatey 1.0 upgrade command.
Edited 1st April 2018: include the outdated command instead of using update all -whatif.