One of my favourite blog is Motho ke motho ka botho. It’s all about Linux and getting the most out of old and low powered machines. As you probably expect, it heavily promotes console based applications – which is great for me and my continual search for lightweight efficiency (read as happily playing about with new things and possibly not getting too much done).
In the list of software is a little application called Charm. This is a console based publishing tool for (amongst others) Wordpress. Well, I had to give it a go – which is exactly what I am doing right now. It is pretty simple to set up, and fortunately allowed me to switch my editor from Vim to Emacs (and start flamewares…now).
I still have to have a good poke around, I don’t know if it can schedule posts, or save as drafts etc etc, but so far it looks pretty good. I also want to test out Emacs’s Weblogger Mode, the quest for my console based utopia continues.
This is great for a couple of reasons. Firstly, Live Unsigned has a decent server in which to grow. Secondly, and most importantly, it meant I had a blank canvas to work with to get the server exactly as I wanted it. Things like this are fun! The setup I went with in the end was Debian 6, Nginx, MySQL, PHP5.3 (with PHP-FPM), Memcache and finally postfix for the mail serving. Following is a little description of each step required.
A number of weeks ago, the lovely people at 6sync were nice enough to host Live Unsigned*, in exchange for a plug or two on this blog. To me, this seemed like a very fair exchange, also it meant that I had a nice clean server which I could set up just as I wanted so as to handle the increasing traffic Live Unsigned is getting.
Over the next few posts I’ll be outlining how I set up the server, along with any issues and gotchas, plus I’ll most probably be talking about Biscuit – 6sync’s control panel.
For all you cynics out there, don’t worry, I’ll be maintaining my editorial integrity. This blog is not going to turn into one big advert! But, I do want to say a big thanks to Mario and the 6Sync team.
* For those of you that don’t know, Live Unsigned is a weekend project that my girlfriend Elizabeth and I are running in order to keep ourselves sane!
With Jabbakam we save a lot of images. All these images are stored in Amazon’s S3. Recently I thought I’d delete some of the test buckets.
Not as easy as I first thought. It turns out that you have to empty buckets before you can delete them. Fair enough, but there didn’t seem to be a way to easily bulk delete hundreds of images.
After some Googling I found Robert LaThanh’s S3Nukem which looked like it would do the job. All I needed to do now was fire up an EC2 instance, install and run. The steps were as follows:
Create an EC2 instance on AWS (I used Ubuntu on a medium instance)
make sure it is all up-to-date
apt-get update
apt-get upgrade
install ruby (if not already installed)
apt-getinstall ruby1.8 ruby1.8-dev
(not sure about ruby1.8-dev, but added just in case)
If like me you are constantly bouncing about between different places within a file, or even between multiple buffers then you should save a lot of time by using Registers.
Registers are a handy little tool that enable you to save a snippet of information for the length of your session. This snippet of information can be either text, numbers, rectangles and even window configurations.
For the benefit of this tip, however, we’ll be saving a position within the register. It is so simple, it is actually quite silly.
When you are at a position you want to save, simply enter:
C-x r <space> q
This will save your current location into the register “q”. You can replace “q” with any single character. For some reason I always use “q”, “w”, “e”, “r” etc. but you can use whatever you want.
To remember this command, you simply need to think about saving a space in a register called q.
Jumping back to the position saved in the register is just as simple
C-x r j q
You are jumping to register q
Once you have the hang of it, it’s pretty effortless.
As my aversion to all things rodent orientated increases and my use of Emacs grows so too does my use of org-mode.
Org-Mode probably doesn’t need any introduction. It can be used for pretty much any sort of organising you require, from sketching out blog posts (this article was drafted in Org-Mode before being published to Wordpress) to a full productivity and GTD suite.
The Emacs tip this week isn’t about highlighting all the useful features Org-Mode has to offer, but instead it is more of a “How-to-Learn” rather than a “How-To”.
In my daily Emacs activities I open a lot of files. However, during the week I am normally opening the same files as I’m generally working on the same stuff. Emacs’s Recent Files (recentf) feature generates a list of my recently used files and allows me to display that list so I can quickly open any of them.
To enable recentf mode, add the following into your Emacs init file (which you are version controlling right?)
If you use Tramp a lot you may want to disable the auto-cleanup command for Recentf. This is simply because every now an then, if enabled, the auto-cleanup feature scans a list of your recent files, and tries to stat them to see if they should remain in the list. Obviously, if it tries to stat any remote files this may cause your system to temporarily hang.
;; recentf stuff(require 'recentf)(setq recentf-auto-cleanup 'never);; disable before we start recentf!(recentf-mode 1)(setq recentf-max-menu-items 25)(global-set-key "\C-x\ \C-r" 'recentf-open-files)
Now use Emacs for a bit to generate a list of your recently used files. Next time you open Emacs, simply hit C-x C-r and you’ll be greeted with a list of your recently used files.
As some of you know, whilst Emacs is my editor (et al.) of choice my favourite window manger is Awesome. Awesome is, according to the website,
.. extremely fast, small, dynamic and heavily extensible using the Lua programming language
I’ve never delved into Lua before, but since using Awesome I’ve had to play around with a bunch of config files. They have always looked very clean and simple so, this weekend, with a spare couple of hours to kill I thought I’d have a play around with Lua and see if Awesome really is as “heavily extensible” as the claims make out.
A couple of weeks ago I set up real time web analytics on a number of sites with Clicky. Clicky have an incredibly simple API which I thought would be perfect to play around with.
I decided to try and build a widget that displays the total visitors and actions for a specified website. Really simple, but also quite useful. I had never written anything in Lua before, or even played around with widgets too much in Awesome. Fortunately both Awesome and Lua made the whole thing fantastically easy and fun. What follows is the code I wrote, use it if you want to, it’s just an example of what I did with my first attempt, so feel free to extend it as you want.
This first tip is something that I’m seeing more and more people do, especially with the excellent Emacs Starter Kit aiming to get Emacs newbies up and running quickly:
Version control your emacs.d directory.
This technique is especially useful if you have a number of development machines that you work from (desktop, laptop, remote server). This is the reason why I started to version control my .emacs.d directory. Whilst my configuration is still very basic (for now) I find it invaluable.
Whilst it is useful to version control your configuration file, a happy side effect of the increasing prevalence of services like GitHub is that you can see other Emacs users’ setups. It is great to look at these, borrow some ideas and lean some new techniques. After some Googling, I’ve quickly compiled the list below from GitHub, which is by no means exhaustive:
As regular readers of my poor, infrequently updated blog may know my editor of choice is the wondrously magnificent Emacs. One of the reasons I like Emacs is because there is so much more to learn. I can easily imagine that one could spend every day for a whole year learning a new technique, mode or snippet within Emacs and still not come close to learning all there is to know about it.
Sadly, I’m not dedicated enough to learn a new tip every day.
However, I am going to try and learn one a week. My aim is to pick up a new Emacs top tip, use it for a week and post about it here on my blog. This should hopefully increase my knowledge of Emacs and server as a repository of this information.
So, tune in every Monday for my Emacs Tip of the Week!
For those that can’t wait, there are loads of great places for all things Emacs out there. Check out: