Posts Tagged ‘mercurial-server’

2011w29

Sunday, July 24th, 2011

vim and ctags

I’ve been meaning to look into ctags for a while, mostly because I’ve wanted some better way of being able to locate the definition or calls of a function, than popping up a new terminal and running grep. I know of :[l]grep and :[l]vimgrep and should really spend a day or two learning those as well, but ctags looks like it could be more useful to know immediately so for now I’ll focus on getting acquainted with these keybindings.

ctags itself is “exuberant ctags” and is found on sourceforge, if not available from your package manager. If you’re using vim you’ll also want to grab the ctags.vim script and just drop it into your ${HOME}/.vim/plugin/ directory.

In your source directory simply run $ ctags -R and you will have yourself a tags file for this directory and all subdirectories. Opening a file and calling :TlistOpen will give you a list of all the found definitions in the project. Unfortunately for me, I want all the newly created windows from a split to appear to the right or below, the original window, EXCEPT for this tag list window ;)

The solution to that came in a StackOverflow thread and is called Ctrl-W R

There are several good posts which helped me come to terms with ctags.

firefox and sorting downloads

For a while now *cough*since around 2006*cough* I have been using the absolutely asskicking add-on Download Sort for Firefox. You set up your rules for where files with a certain extension should go, and then you just start downloading files, and they all end up where they should.

Or so the theory goes. But let’s say that you get tired of having to move all your wallpapers downloaded from deviantart.com or wherever, to your wallpapers folder, from the generic images folder?

Then Download Sort is looking less good. There just isn’t a way to differentiate between an “image” jpg and a “wallpaper” jpg.
Sadly, the only add-on I’ve found which advertises the features I want, Automatic Save Folder, didn’t work for me at all. It might be my overly paranoid security settings screwing things up, but for some reason it just won’t remember any of the rules I set into place…

urxvt-tabbedex

I started playing with tabbed urxvt. I ultimately ended up installing urxvt-tabbedex and using that instead. The differences are small, but tabbedex doesn’t provide a “new” button (a new shell is spawned using Shift-Down, and tabbedex provides (the perhaps less useful) feature of renaming a tab (Shift-Up).

wmii

I have lived under the impression that I was using a really old wmii (even though the package I used was wmii-hg which should pull the latest version from the repository). The reason I was under the impression that this was old was that it never came any updates when I executed a $ yaourt -Sayu.

When I finally looked into it yesterday I finally realized that I was running on bleeding edge. The trick to wmii-hg, apparently, is that you need to manually re-install it to have it fetch the latest updates… What I took as project inactivity (and must thus be an old branch) was in fact not so.

As tagrules are severely broken in wmii-hg it hasn’t been fun using it (and colrules behaved very strange, but strange in a way I have now come to appreciate… go figure) but there were always issues with the wmii package in the repository, most having to do with an insane amount of flickering when creating a new terminal, or moving one about etc.

The flickering parts seems to have been solved, it might have had something to do with my transparent terminals and not a problem with wmii, I don’t know, but now it works.

Thanks goes out to pesa for single-handedly seeking out and vanquishing my final annoyance of wmii 3.9.2: that every now and then it would start spawning more than one terminal when I issued a command to get one.

When I was reloading the configuration, the old process remained, and with it, the listeners for keyboard commands… like starting a new terminal…

mercurial-server

I’ve been running the mercurial-server package on my server to provide me with easy access to (mercurial) repositories. This week, for some reason, it started failing.

I had updated mercurial from 1.3 to 1.9 and my first thought was that this had broken mercurial-server somehow, but after reverting the package, the problem came back.

Not immediately, mind you, which makes this whole thing even stranger.

But this has just provided me with the right amount of kick in the ass to get on my way and convert from mercurial to git, so all in all perhaps not a bad thing?

Links

Why I’m not going near spotify: It sums up pretty well my own feelings about Spotify…

In certain (rather specific) contexts, I even despise Spotify users, and here’s why: Imagine that you are sitting on a train, and you will be doing so for the next seven hours or so. The train has “internet”, via one 3G modem.

Now picture ten other passengers ALSO going online, their objective being to listen to Spotify. Can haz moar bandwifs plz? kthxbai

:wq

My software stack revisited – Server

Tuesday, December 28th, 2010

The addition of the server (in my case, an old laptop onto which I installed Ubuntu server) has made a rather substantial difference on how I work.

While I don’t have any love or trust for the cloud when operated by others, deploying my own miniature cloud is something different altogether. The difference being that in my setup, the data is under my control, and as long as I don’t screw the security settings up, the data is only available to me and the ones I grant access.

Repositories

Mercurial, albeit being a distributed version control system, can be made centralized. It is simple. You just set up all your repositories on a computer, and make it easy to clone, pull and push from and to that computer.

The mercurial-server package does just that, by providing an SSH interface over which people who are authorized (mercurial-server uses SSH keys) can then access the repositories, based on rules in an access configuration file.

All my small projects are now under version control, along with the configuration-files of both my desktop and my netbook.

RSS

In a comment on my original post, archie asked me about how I consume RSS feeds. The answer now is the same as back then: “Thunderbird.”

Back then using Thunderbird for that was a hassle: I had it installed on two computers, my desktop and my laptop, and I’d set both up to fetch the same feeds, which either of the Thunderbird instances would only do if the computer was powered up and Thunderbird was running.

That meant I’d sometimes miss posts in feeds that were aggregating feeds themselves. But what was even more frustrating was when both computers fetched the same feed items, and after having read it in one place, I would then need to prune it from the other location.

Sometime near the end of my time at ITU, pesa made me see the light of IMAP, that mails are stored on the server, and marked as either read or unread. And that any other client connecting in to the same account, would see the emails with the state the first client had left them in.

And I began thinking that it would be awesome to have that for RSS as well. Then there would be no problems synchronizing the feeds, because they’d all be in one place, and no matter which computer I was sitting at, it would have the most updated state.

Also, putting this on a central server would ensure that I wouldn’t miss any posts due to powering down either the laptop or the desktop.

After a bit of searching I found what I was looking for: feed2imap. It polls the feeds specified in the configuration file, at regular intervals as defined in the crontab which executes the feed2imap script, and then converts everything new it finds into the funky mail format hokus pokus which I have yet to fully grasp, putting the output in a Maildir.

Having done that, I would then need an IMAP capable mail-server to serve said mails (feed items) to me, and this is where Dovecot comes into play. With these two components, I can continue using Thunderbird (any IMAP-capable mail-reader actually) to consume my feeds, but in a much better way.

Screen

Another advantage of running a server is that it is supposed to be up and kicking and online, all of the time, and with the remarkable little software GNU Screen one could for instance start irssi (any CLI-application really) in screen, and then attach and detach it and have it live on until you decide to shut the application down. This means that you can have irssi stay online and thus get full access to what is happening in the various channels, even if you yourself are sleeping, or have shut down the work-computer for the day and are on your way home.

Access

The above services I run on the server, with the exception of the “RSS service”, require access to the system via some secure means (SSH), so openssh-server is installed. I have disallowed all password-based authentication, which leaves key-based authentication the only viable option.

However, sometimes one might need access to the server but either don’t have the SSH private key with you (USB-stick) or don’t feel comfortable using / unlocking it from the computer you are currently sitting at.

This is where OPIE comes into play. My cellphone can run Java, so I installed a program called OTPGen on it, which generate the response to an OPIE challenge as sent from the server.

Which basically means that I can log in to the server and any password sniffer can just suck it, because that password I just used is now useless.

Notifications

In part six I wrote about calendars, about appointments, and more specifically about when and remind. In part three I wrote about version control. About mercurial. And in the beginning of this post I wrote about how this server hosts repositories, not just projects, source code etc, but also configurations. Configurations such as the appointment files for when and remind.

In Ubuntus repositories (and in Archlinux AUR) there lies a little package named sendxmpp, with which one can send messages.

I put together a little service of my own, using crontab, a shell script, and sendxmpp. Every morning it pulls updates from the repository, runs when (I haven’t gotten around to updating the script to use remind yet) and parses the output, and if any messages with a specific tag (most notably #Birthday) is found in the filtered output, send that to my primary jabber-account through sendxmpp.

We’re nearly at the end now. Just a final post to summarize and glance forward left in this series.

:wq