Asterisk 101 : How to troll telemarketers (aka automatically send hidden Caller ID to a waiting music forever)
If like me you get tons of telemarketers calls, there’s an easy way to get rid of them with a quick Asterisk hack. The following Asterisk configuration snippet will immediately send any hidden caller ID (99% telemarketers, and I have a general policy of not picking up the phone for hidden caller ID anyway) to a holding music making them waste money and time…
Unix 101 : Filesystem basics & Special files
This post is meant to clarify a few key concepts about Unix filesystems such as directory permissions, hardlinks and symlinks.
MisterHouse : Setting up “modes”
MisterHouse is a fantastic home automation software with an impressive out-of-the-box feature set, and it only gets better if you know a bit of Perl.
You can conveniently set “modes”, which are settings with states you can define and use. You can then fire events upon state change, and so are they very useful to define some sort of macros.
A few examples :
- the “Security” mode could be “on” or “off” : setting it “on” would close the shutters and activate the alarm system; setting it “off” would do the opposite;
- the “Heating” mode could be “day”, “night”, “frost protection only” : setting it on “day” would set the target temperature to 20â°C, “night” to 15â°C and “frost protection only” to 7â°C
- the “Cinema” mode could be “on” or “off” : setting it to “on” would close the blinds and dim the lights; “off” would bring those back to their former states.
Linux + Xorg : Remapping caps lock key to escape
In this post I’ll revisit the classical “how to remap caps lock into something useful” once again. In this post, I’ll show how to remap the caps lock key to have an extra Escape key, which is very useful for all VI/Vim users.
Facebook API : Exporting your friends birthdays into vCards format
The following sample Facebook desktop application exports your friends birthdays in a vCard file format. This file is suitable to be imported into your GMail contacts for example.
AutoHotkey : Copying without formatting
One of the common annoyances of copy-pasting on Windows is that it tries to copy-paste the formatting as well. This issue can easily be fixed by the following AutoHotkey macro, which will copy the selection to the clipboard as pure text.
Asterisk : Basic SOHO environment VoIP PABX configuration
Asterisk is a free telephony software. I’m posting here sample commented configuration files for reference purposes, hoping they will help you get kickstarted if needed.
This config sets up :
- SIP phones (for softphones or harware phones with SIP capabilities)
- Voice mails
- A few test phone numbers
- Forwarding of calls to a SIP provider for outbound and incoming calls (from/to PSTN)
That should be plenty already for a SOHO environment !
Note to French readers : Si votre FAI est Free, cette configuration fonctionne pour passer / recevoir des appels via le SIP de Free (Freephonie).
Gentoo + OpenVPN : getting things started in the correct order
I’m running an OpenVPN server, configured in bridging mode.
I had quite a bit of trouble getting OpenVPN to start after networking is up, but before the the bridge is setup so that the tap0 device, which is created by OpenVPN can be added to the bridge.
The solution is simpler : let the tap0 be automatically created and added to the bridge by Gentoo Linux, then start OpenVPN with a config file instructing to use the already created tap0 device.
This post shows the configuration snippets to get things started in the right order on Gentoo.
Bash / zsh : Using the history expansion
One of the features of bash I’ve too long overlooked is its history expansion. In this post I’ll show a few examples to get a grip at it.
Perl : Counting occurences of IP addresses in Apache logs
This Perl one-liner is intended to print the 10 most frequent client IP addresses in an Apache log file. It can easily be recycled to count anything, though.