Archive

Archive for the ‘TricksAndTips’ Category

WordPress Multisite IP block

January 20th, 2011 No comments

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]

Categories: TechStuff, TricksAndTips Tags:

Getting yum on RHEL to work with a proxy over ssh

September 21st, 2010 No comments

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.

Categories: Things Lunix, TricksAndTips Tags:

Multitouch trackpad DIY button

June 30th, 2010 No comments

IMG_0011.jpgTwo 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..

Categories: TechStuff, Things Mac, TricksAndTips Tags:

How to limit the size of a Time Machine networked backup

February 2nd, 2009 No comments

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.

Categories: Things Mac, TricksAndTips Tags:

Topp-posting – det eg kaster bort mest tid på i løpet av dagen.

December 7th, 2007 1 comment

I forretningsverda er det blitt slik at det er vanleg å topp-poste. Dette medfører at istadenfor ein vanleg tekstflyt lyt ein begynne nederst i eposten og lese oppover for å få med seg heile historien. Personleg brukar eg utruleg mykje tid på dette i høve til å kunne lese ein korrekt sitert epost. Difor oppmodar eg alle om å legge til denne vesle tankevekkjaren i signaturen sin – på fritt vald målføre:

  A: Fordi det er heilt motsett av den måten menneske vanlegvis les tekst.
  Q: Kvifor det?
  A: Topp-posting.
  Q: Kva er det mest slitsame i epost og på news?

  A: Fordi det er helt motsatt av den måten mennesker vanligvis leser tekst.
  Q: Hvorfor det?
  A: Topp-posting.
  Q: Hva er det mest slitsomme i epost og på news?

  A: Because it messes up the order in which people normally read text.
  Q: Why is top-posting such a bad thing?
  A: Top-posting.
  Q: What is the most annoying thing on usenet and in e-mail?

Meir om det same:

http://audun.norblogg.net/2007/01/10/sitering-av-epost/
http://home.online.no/~vidaandr/news/OBSquoting.html
http://antibiomatika.net/usenet/quoting.html

Categories: Things Mac, TricksAndTips Tags: