Wouldn’t you like to be greeted with some random ASCII art when you open up a new PowerShell command window? I thought so!
Here’s a project just for you. Download the ASCII Art Message of the Day project, link the script in your PowerShell profile and bam!, random ASCII art awesomeness every time you open a shell.
Follow the installation instructions from the readme f ile, and you are set. You can even customize what color you want to use. I know, it’s fantastic. The random ASCII art comes from asciiart.eu, so check it out if you want to have an idea of what you’ll be getting.
A while ago, I wrote a command line tool to clean up any IMAP inbox, and delete the oldest emails if the inbox gets over a certain amount of mails. This is handy and has been doing its thing for a long time, but recently I wanted to extend that, and also delete emails in a specific timeframe. Let’s say between 23h and 6h of each day.
Say hello to v2.0 of the IMAP Cleanup tool, which now has a slightly modified command line, where you can specify if you want to delete using the count, or if you want to use time as the criteria.
It looks like this if you want ot use count (without the login credentials):
.\ImapCleanup.exe count --keep 500
or to use time:
.\ImapCleanup.exe time --from 23:00 --to 6:00
It’s pretty fast in doing its job, so you can run it a number of times sequentially for more specific cleanup jobs.
You can find all the details on how to set it up and use it on the Github page.
Let’s say you have this IOT device like a motion detection camera. Which sends you emails. Emails you keep in a separate IMAP mailbox. Lots of emails. So you want to delete those emails in some automated fashion, because doing that daily is oh so boring (remember, lots of emails).
Wouldn’t it be great if there was like some handy command line tool that would delete the oldest emails and keep like a 1.000 or 500 of them only? Well yes, that way I could script that annoying job and run it daily.
I didn’t find something that already did this. So I figured I’d be able to whip something up in an hour or so using PowerShell, or maybe a small .NET console application using an existing IMAP library.
Well, 3 different IMAP libraries and about 4 hours later I did have something rudimentary that finally did what it was supposed to do. Delete the oldest email, and leave the most recent 1000 (or whatever number you want) behind. That took longer than expected, so to regain as much time spent on this as possible I threw the ImapCleanup tool on GitHub, including binary downloads. I hope someone else will find this useful as well.
Beware though. This tool deletes emails. Be careful which mailbox you point this at, and make sure you test it in advance on a dummy mailbox. Maybe your email server behaves differently than mine, and important emails get digitally shredded by mistake.
Maybe you have some Azure credits lying from a Visual Studio subscription you have from work, waiting to be spent on cool and nifty experiments, but don’t end up actually using them.
How about spending some of those dollars on cancer research? Or help find a cure against Zika? Fighting AIDS maybe?
Enter the World Community Grid, a vast grid computing network running on the Open Source BOINC client software, started as a philanthropic initiative by IBM.
Sounds good right?
All you need to do is create a WCG account, spin up a Linux machine on Azure, install the BOINC headless client on it and link it to your account. In about half an hour you’ll be computing cancer markers, folding genes or fighting some horrible disease. Well, the software will be doing that really, which is even better.
Here we go, step by step.
1. Setup your Azure Linux machine, I chose an Ubuntu 16 LTS machine. I pick the classic VM because its way easier to setup.
Depending on the type of machine you’ll have more compute power and thus turning out more results. Try a few out and see how you can maximize your Azure credits.
2. Once provisioned, log in using PUTTY or your favorite SSH client. Now it’s time to update the Linux packages and then install the BOINC client:
Of course you want to check what’s going on, so you can check the BOINC client’s state like this:
This should give you a list of the tasks and their state. It might take a while before they start kicking in, but you’ll see results coming in after a day or so on the WGC website under your contribution history.
That’s about it. Your client is all set up. All you need to do is keep those VM’s running in the cloud, which normally takes non effort at all. Neat.
What’s next? Well, you can set up more than 1 machine if you like, or a heavier one and see what gives you more bang for your buck. You can also join my World Computing Grid team called “Team Azure” and see how many cloud bucks we can burn. It’ll be effortless fun, I promise! ;)
Vim plugins are written in viml or vimscript, an internal script language in the vim editor, and are plain .vim files containing scripting code which extend vim in all sorts of wonderful ways. There are tons of vim scripts out there so finding the right ones for your needs takes a bit of time. There are however some helpful guides out there and blog posts like this one to help you on your way. I’ll list some of those and links to more plugins at the end.
Installing those scripts and plugins can be tedious though. Download a zip, unpack, copy files, yada-yada-yada. Since we’re into package managers these days we want things to go automatically with a few keystrokes.
You’ve probably guessed by now this is a vim plugin manager (and a plugin by itself). It allows you to install, update and search for available vim scripts among other things. I like this one in particular because it does this all from vim itself with a number of specific commands.
To get started you’ll have to install this one manually though, but it only takes a few command line statements and some .vimrc edits. Once you have this up and running, you’ll be able to install most plugins using it so it’s worth the hassle.
Alright. Now, what plugins should we get?
Well it depends on what you want to do of course, but here are some general purpose ones you might like.
A pretty looking status bar you’ll see in a lot of vim screenshots. It’s tweakable so you choose what kind of info you want it to show.
Adds tab completion to vim using the tab-key. That might sound odd but the default use a bunch of control keys so this just comes more “natural”.
This is a directory browsing plugin which is just better than Netrw which comes out of the box. Visually you can fold/unfold folders, search (use any vim command in the window), manipulate files etc. Very handy to keep track of a project when programming or just see what other files are in a folder without having to exit vim.
A fuzzy file search plugin. Press Ctrl-P and you’ll get list at the bottom of files in your current directory. Type in some characters of the filename you are looking for and it will filter the files matching those characters. So you don’t need to know the full name, and you can skip parts. Check out this video to get an idea of how it works.
One note on this. If you have a folder with a lot of files in the sub-folder tree (like a C# application with build files in the sub-folder) be sure to exclude any non-relevant types like object & dll files. CtrlP has a maximum file limit and those irrelevant files can stop you from finding those you actually want to see.
In my _vimrc I use this to exclude the .NET build artifacts and some more irrelevant file types:
vim-fontzoom is a simple plugin that allows you to increase or decrease your vim font size using the plus or minus key when you are in command mode. Note that this doesn’t work with the +/- on your numeric pad, just with the regular keys on your keyboard. But you can remap the keys if you want to change this.
Not really a functional plugin but hey, you want your editor to look pretty right? I’ve tried a ton of themes already but lately I’m sticking with the chriskempson/base16-vim set. In this package you get a bunch of nicely crafted and balanced color themes which will definitely have something you like. Dark and light themes, monokai, solarized and other classics, it has it all. The last theme plugin you’ll ever need.
Depending on your workload there are plenty of more specific plugins out there. Google is your friend, but here’s a few places to get started:
The easiest to use and most awesome Vim plugin directory is called VimAwesome. Great to find new plugins, or great to find old ones and how to install them. Each plugin lists how to install it with Vundle or another plugin manager, which is super handy.