What deployment tools can do for you

I restarted work on one of my older hobby projects. Though I’m not really sure what my end goal is yet I got a vague idea of what I want to build and it’s nice to have something of my own to code on. While setting this project up I took some extra time to make sure I got deployments automated from the start. Proper configuration and use of tools saves a lot of time but it also takes several hours to a day or two to set up, depending on the project of course.
Read more →

How I set up Pelican for blogging pt. 2

So the whole point of running a static website (besides that it’s cool) is the performance aspect. And I personally think that if you’re doing something for performance you might as well go all the way. So here’s how I optimized my static website. First downloading the plugins and themes I would require to the folder for my configuration files. git clone https://github.com/getpelican/pelican-plugins ~/Projects/Pelican/plugins git clone https://github.com/getpelican/pelican-themes ~/Projects/Pelican/themes And then adding them to the main configuration file by adding these lines to the bottom.
Read more →

How I set up Pelican for blogging pt. 1

No, this blog still uses WordPress (now Hugo!) because of its convenvience and ease of use. But I needed a way to document my personal server that I use for Mumble, IRC and my small projects and I decided to test out static blog generators for that. Normally people use Octopress (based on Jekyll) which labels itself as “A blogging framework for hackers” which is cool and all but I really don’t like Ruby and I had heard a lot of good stuff about Pelican so I went with that.
Read more →

On two factor authentication

I’m studying computer security this term and it has a way of making you very paranoid about security matters, and recent articles like this and this really doesn’t help either. Therefore I’ve decided to set up two-factor authentication everywhere possible to help protect myself to some degree for the uselessness of passwords. Two-factor authentication essentially means that you use two authentication factors to log in instead of only one. An authentication factor is one of three things, something you know, something you have or something you are.
Read more →

On Vagrant

Vagrant enables a developer to isolate their project to a dedicated virtual machine while still coding in the same environment they use for other projects. You can essentially edit your project files in Windows and access the result through Windows while everything is running on Linux without having to do any of the tedious work of setting up and installing a virtual machine. The cool thing about Vagrant is how the configuration file for the project can be redistributed with the rest of the code base to give other developers access to an exact replica of the original development environment.
Read more →

Fucking sudo

I stumbled across this comment a while ago and though it was pretty funny, so I wrote a basic one liner to add the “feature” to my shell. Basically what it does is allowing you to write “fucking” instead of “sudo” for the humorous effect of it, example below. $ make install No. $ fucking make install Here’s the code for setting it up. The specified configuration file needs to be changed for it to work in other shells than bash.
Read more →

Automatically setting height of textarea to height of its contents on page load

jQuery makes everything so ridiculously simple. To make sure a textarea is automatically resized so it fits its content one could calculate the amount of rows of text and the approximate height of the font and set the height of the textarea to the product of that. Or you could set the height to the scroll size with jQuery and JavaScript. <script> $(function() { $('textarea').height($('textarea').prop('scrollHeight')); }); </script> Admittedly, it’s not a complete solution if you need it on a page with more than one textarea though.
Read more →

Is [language] worth learning?

This is a really short response to a question I’ve stumbled across twice today, “Is [language] worth learning?” All languages have some worth, but they are all good in different areas. It all depends on what you want to do and how much you want to learn about programming. C is very good if you want to learn how computers work without delving into the inaccessible mess that is assembly programming.
Read more →

How to put checkboxes in Bootstrap dropdowns

Bootstrap is an extremely useful set of tools which, I personally believe, everyone should know about and use for their own internal projects. It’s ridiculous what a time saver it is, especially combined with Font Awesome to get over 360 free, scalable icons to use with Bootstrap. Bootstrap also have these amazing JavaScript tools which, for instance, allows you to place a dropdown menu on virtually any element. The only problem with these are that you can’t really put forms in them, since the dropdown closes when you click on it.
Read more →

An alternative for SQL pagination

I was reading up on improving the performance on MySQL when I found an article and stumbled on a really cool alternative to using offset when generating pagination results from the database. On the query side, instead of using LIMIT with offset, you can select one more row than you need, and when the user clicks the “next page” link, you can designate that final row as the starting point for the next set of results.
Read more →