Wednesday 22 December 2010

Hack - Emacs calendar: Indian/Nepali/Hindu holidays for 2011

Ideally, it would be nice to calculate these automatically for all years (and to be able to convert from Gregorian to Vikram (Bikram) Samvat dates).... But for now, this can be inserted into your .emacs file to display Hindu holidays for 2011:

;; Hindu Holidays (North India/Nepal)
(setq holiday-other-holidays 
'(
(holiday-fixed 1 14  "Makar Sankranti")
(holiday-fixed 2 8   "Vasant Panchami / Saraswati Puja")
(holiday-fixed 3 3   "Maha Shivaratri")
(holiday-fixed 3 19  "Holi")
(holiday-fixed 4 4   "Bikrami Samvat / Hindu New Year [2068]")
(holiday-fixed 4 12  "Ram Navmi")
(holiday-fixed 4 18  "Hanuman Jayanti")
(holiday-fixed 5 6   "Akshaya Tritiya (Akha Teej)")
(holiday-fixed 6 15  "Savitri Puja")
(holiday-fixed 7 15  "Guru Purnima")
(holiday-fixed 8 4   "Naag Panchami")
(holiday-fixed 8 12  "Mahalakshmi Vrata")
(holiday-fixed 8 13  "Raksha-Bandhan + Janai Purnima")
(holiday-fixed 8 22  "Krishna Janmashtami")
(holiday-fixed 9 1   "Ganesh Chaturthi")
(holiday-fixed 9 9   "Indra Jatra begins")
(holiday-fixed 9 11  "Kumari Indra Jatra")
(holiday-fixed 9 17  "Indra Jatra ends")
(holiday-fixed 9 11  "Teej")
(holiday-fixed 9 13  "Pitr-Paksha begins")
(holiday-fixed 9 27  "Mahalaya (Pitr-Paksha ends)")
(holiday-fixed 9 28  "Navaratri begins")
(holiday-fixed 10 3  "Durga Puja begins (Maha Saptami)")
(holiday-fixed 10 5  "Navaratri ends")
(holiday-fixed 10 6  "Dasain/Dusshera (Vijaya Dashami)")
(holiday-fixed 10 11 "Lakshmi Puja (Sharad Purnima)")
(holiday-fixed 10 16 "Karwa Chauth")
(holiday-fixed 10 25 "Dhan Teras")
(holiday-fixed 10 26 "Diwali / Deepavali / Tihar")
(holiday-fixed 10 28 "Bhai Dooj")
)
)

You may want to add other holidays as appropriate, e.g. South Indian holidays; holidays specific to the Punjab, Orissa etc. The format is:
(holiday-fixed numeric-value-of-Gregorian-month numeric-day-of-month "Name-of-Holiday").

E.g. (holiday-fixed 3 5 "Losar") for the holiday Losar falling on 5th March.

Wednesday 17 November 2010

Hack: Emacs-like bindings for Pentadactyl

Pentadactyl -- the successor of Vimperator -- can speed up your web-use, especially if you're used to using a high-powered editor like Vi(m) or Emacs.

I've started using Emacs a lot recently, because of the brilliant Emacs TeX packages  (i.e. AUCTeX and RefTeX, preview-latex, outline mode), thus I've got used to Emacs-like bindings.

So, inspired by anrxc's vimperator bindings (but differing significantly from them in many places): a configuration file for  that provides an Emacs-like set of keybindings for Pentadactyl.

1) .pentadactyl configuration file
2) QuickReference 'card' as PDF
3) QuickReference 'card' as TeX
4) QuickReference 'card' as HTML 


This is version 1. Comments/suggestions welcome.

[Edit (2011-Jan-11): With the latest version of Pentadactyl, something seems broken (the mode-line isn't appearing). I don't know if this is something with the configuration or some deeper change to Pentadactyl. However, I've switched to Conkeror, so I'm no longer actively updating this config.

See this BabbageFiles post, "Browsing the web, Emacs-style - with Conkeror".]
]

Friday 15 October 2010

Linux: More than 1%

We are more than 1%:
With this initiative, we intend to refute the statistics of certain press organizations that ensure that the use of GNU/Linux does not exceed 1% and has not advanced in recent years at the desktop.
If you want to help us accomplish this goal, please participate in our statistics!

Link: http://www.dudalibre.com/gnulinuxcounter?lang=en



Interestingly, from the statistics collected on the above site (as of 15 Oct 2010), there are large numbers of Linux users in Poland and Russia.

Wednesday 6 October 2010

New Babbage Analytical Engine(?)

John Graham-Cumming proposes to build a working version of Babbage's Analytical Engine for public display [original article here and working project page here].



There's currently a Facebook and Twitter page, and a Pledgebank page.

Friday 24 September 2010

Hack: prevent screensaver from crashing fullscreen games on Ubuntu (II: xscreensaver)

I realised that this doesn't work if gnome-screensaver is disabled and xscreensaver put in its place.

In that case, preventing the screensaver from starting (and locking the system) during a fullscreen game can be accomplished with the following script:

#!/bin/bash
xscreensaver-command -exit
[COMMAND TO START GAME OR PROGRAM HERE]
xscreensaver -no-splash
[Ubuntu 10.04]

Humour: Dependencies

debian-main
http://xkcd.com/797/

Thursday 16 September 2010

Tip: How to backup blogger/blogspot

From meandthecomputer:
In your blog's control panel, if you look under the Settings tab, you will see Blog Tools section. Beside it you will see an option to Import Blog, Export Blog, and Delete Blog. Export Blog will allow you to save the contents of your blog in your hard disk. Import Blog will allow you to restore a previously saved copy. 

Hack: clearing out old entries from the "open with" window in Ubuntu

From OMGUbuntu:
 To clear out old entries (esp. wine) from your "open with" window, delete everything in ~/.local/share/applications
Cory Sadowski adds:
~/.local/share/applications/mimeapps.list is what stores certain file associations, notably the one that controls what application opens when you click a location in the Places bar. Install LXDE and suddenly find that PCManFM has taken over your Places menu? Look in mimeapps.list and introduce that jerk to your delete key.

Tip: Make sure non-Eastern non-European characters display in Linux

In order that characters used in and for transliterating non-Eastern non-European scripts/languages like Sanskrit, Egyptian, Sumerian, Akkadian, and Hittite be displayed properly in Linux, make sure to install (through the Synaptic Package Manager in Debian/Ubuntu) the ttf-ancient-fonts package.

You can test it by going to the Wikipedia page on Hittite cuneiform (there should be no little boxes in the text, but rather Hittite cuneiform characters).

Wednesday 15 September 2010

Hack: prevent screensaver from crashing fullscreen games on Ubuntu

Playing the Amnesia demo on Ubuntu, but after 5 mins the screensaver turns on and then the whole system locks up.

It seems that with some fullscreen games this happens.

Hack:
Create a shell-script:

#!/bin/bash
gconftool-2 --set /apps/gnome-screensaver/idle_activation_enabled --type bool 0
[COMMAND TO START GAME OR PROGRAM HERE]
gconftool-2 --set /apps/gnome-screensaver/idle_activation_enabled --type bool 1exit 0



And then make the shell-script executable, and link to it instead of to the game binary in the Games menu.

Seems to work so far.

[Ubuntu 10.04]