Ein av dei tinga eg verkeleg likte hos Telenor var det udokumenterte HTTP GET-apiet for å sende SMS. Etter at eg bytta til OneCall på privattelefonen har eg brukt ting som Prowl og NotifyMyAndroid for å få kjappe meldinger til mobiltelefonane mine. Dette er vel og bra det, men dersom ein til dømes er i utlandet og har satt opp FTF-varsling på geocaching.com for det området ein befinn seg i ynskjer ein jo ikkje å pådra seg enorme utgifter ved å ha mobildata slått på.
Så, med litt hjelp frå Firebug i Firefox laga eg eit enkelt lite script for å sende SMS frå kommandolinja med ditt OneCall-abonnement. Enjoy!
Read more…
I have a case where a customer wants to block one of their many WordPress multisite blogs from all but some IP ranges. It turned out this could be quite easily solved with mod_rewrite in Apache – I know, the correct way to do it would probably be to set up a seperate virtualhost for that one URL and use allow from, but in a Plesk environment this is not always so easy…
The blog URL is intranet.domain.tld, and the allowed IPs should be 12.34.32.10 and the range 23.45.54.0/24. If the remote IP is not in the allowed range please go read the news…
The following snippet must be placed FIRST in the WordPress multisite .htaccess file
RewriteEngine on
RewriteBase /
RewriteCond %{REMOTE_ADDR} !12\.34\.32\.10$
RewriteCond %{REMOTE_ADDR} !23\.45\.54\..*$
RewriteCond %{HTTP_HOST} "intranet.domain.tld"
RewriteRule .* http://www.reddit.com [last]
Ever had a machine on a very locked down network where the network admins will not give you access to RedHat network for installing and updating packages with yum? If so, it sucks to be you. But do not despair, SSH to the rescue!
First, make sure you have an available http/https proxy. Setting up one of those is beyond the scope of this little reminder-to-self, so JFGI. Then, connect to the remote host with this command:
ssh -R 8080:<Adress to proxy server>:<proxy server port> root@remotehost
Then, on remotehost, make sure /etc/sysconfig/rhn/up2date contains the following (if your proxy needs authentication you will need additional configuration, that file is properly documented so just dive into it.):
# grep -e enableProxy= -e httpProxy= /etc/sysconfig/rhn/up2date
enableProxy=1
httpProxy=localhost:8080
Now you can run yum to your hearts content.
Two days ago I picked up a brand new MacBook Pro 15-inch with a Intel core i7 CPU from my local hardware pusher. I have to admit it’s a DAMN fast machine, especially after fitting it with a Corsair SSD disk. However, it has one major grievance in my opinion – the button-less multitouch trackpad. My old 2007 model MBP has a physical button located below the trackpad, and I have gotten accustomed to resting my right hand thumb there when using the trackpad.
The new multitouch trackpad does not come with a physical button, but it can detect “idle” fingers on the trackpad so when resting my thumb I can still use the trackpad as if the thumb was not in contact with the pad. Most of the time. If I am to move my thumb only the slightest – which I typically do when I try to tap-to-click with my index finger – it will start interpreting my movements as multitouch gestures and very diffrent things than I intended will start to happen. Most annoying.
After searching for a software solution to disable the lover one third of the trackpad I got pissed of and typed “I hate the macbook multitouch trackpad” and guess what, I am not the only one. First hit in the result list is Kustaa Nyholms site over at sparetimelabs.com, which on his Multitouch page explains why he hates the trackpad and what he did to fool it into behaving properly. I have to admit, It’s a sexy solution
Now my thumb rests nicely on a piece of former DVD case, and my erranous click rate has gone down to zero. It even looks good, although I will try to get some thinner double sided tape and do a better job with my scissors to get it perfect. Thanks Kusti!
EDIT: Oh well, I had to give up the DIY button, after some time it started misbehaving again. Could be that the double sided tape wasn’t really useful for this particular application..
As a little reminder to self, here is how you do it – from macosoxhints.com via Bytex. If you don’t limit the size of the DMG you will apparently run into problems with Time Machine (TM) killing off your entire backup. I currently use a smallish USB disk for backup, but I would much rather have TM back up over the network, preferrably via SSH. Unfortunately, ExpanDrive does not support this officially. I am planning on giving it a try over ordinary sshfs in Fuse. I’ll be back with more.