Comments

I’ve finally had the time and the strength to get back to my old blog and give it a new look.

I feel guilty about having abandoned it for long time :(

I promise, blog, I won’t leave you alone again.

Comments

I’ve been delaying this migrations for ages now but here we are, it finally happened: I can write a blog post with my favourite editor now (Vim) and publish it to the web like a pro on my favourite dev website (GitHub) using git… that’s too many emotions for one single day :P

So, how did I do it?

There are tons of tutorials already on the net that explain very well how to migrate from Wordpress to Octopress so I’m not going to explain here all the details but make just a quick summary even for myself as a note:

  • Download, install and follow the instructions of exitwp
  • Run a regex to fix the code blocks like:
1
perl -pi -e 's/([^\`]|^)(\`)([^\`]|$)/$1\n\`\`\`\n$3/g' *
  • If you have been using Disqus on Wordpress before moving to Octopress, for some reason exitwp doesn’t add the comments: true parameter in the posts so use this sed command to fix it:
1
2
3
find _posts/ -type f -print0 | xargs -0 -I file sed -i '' '2 i\
comments: true
' file
  • Octopress posts url is different from the Wordpress one so you’re going to have to remap the Disqus comments using their migration tool and a bit of patience

The next step will be playing with the theme to make it more “personal” :)

Comments

Canonical, seriously, what’s wrong with you people? How dare you calling the 12.04 a LTS version? Have you testend on EC2? and cloud-init? It’s a bloody mess!

So, you upgraded and mod_rpaf behind your proxy is not working anymore? Do this:

FROM =====>

1
2
3
4
5
<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
</IfModule>

TO =======>

1
2
3
4
5
<IfModule mod_rpaf-2.0.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 127.0.0.1
</IfModule>

Find the differences and thank this guy that find it before me.

Comments

Just dont waste your life and use curl if you need to do that.

I know, this is a useless post but I just wasted a huge amount of time trying to find a solution and I feel like giving this advice to someone.

happy testing :)

Comments

Tired of this:

1
2
3
4
5
6
7
8
9
10
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_CTYPE = "en_GB.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

Do this:

1
2
3
4
5
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales

Be happy again :)

Comments

new ruby version is out and it’s time to upgrade! The first try gave me this error:

1
2
3
?  ~  rvm install 1.9.3-p125
Error running ' ./configure --prefix=/Users/antonio/.rvm/rubies/ruby-1.9.3-p125 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/antonio/.rvm/usr ', please read /Users/antonio/.rvm/log/ruby-1.9.3-p125/configure.log
There has been an error while running configure. Halting the installation.

Adding the compiler option “–with-gcc=clang” worked:

1
2
?  ~  rvm install 1.9.3-p125 --with-gcc=clang
Install of ruby-1.9.3-p125 - #complete

enjoy Ruby :)

Comments

Thanks to a gist (which I forked and slightly changed) I was able to finally install Nokogiri on my mac:

If you had MacPorts previously installed, it might still not work so

1
sudo mv /opt/local /opt/local_old

and try again.

Enjoy :)

mac
Comments

The easiest way of getting an OpenVPN client on mac is with Tunnelblick but you will join the VPN only when you have logged in. Sometimes you need your mac to connect at startup instead and I’ll show you how to do it:

create /etc/rc.local and copy/paste the following three lines in it:

1
2
3
#!/bin/bash
/sbin/kextload /Applications/Tunnelblick.app/Contents/Resources/tap.kext
/sbin/kextload /Applications/Tunnelblick.app/Contents/Resources/tun.kext

then create a Launch script like this for each of the vpn you want to connect to, replacing YOURVPNNAME, YOURCONFIGFILE, YOUR/CONFIG/FOLDER accordingly:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.openvpn.YOURVPNNAME</string>
<key>OnDemand</key>
<false/>
<key>Program</key>
<string>/Applications/Tunnelblick.app/Contents/Resources/openvpn</string>
<key>ProgramArguments</key>
<array>
<string>openvpn</string>
<string>--config</string>
<string>YOURCONFIGFILE.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>TimeOut</key>
<integer>90</integer>
<key>WorkingDirectory</key>
<string>YOUR/CONFIG/FOLDER</string>
</dict>
</plist>

save each script into /Library/LaunchDaemons/ folder using a name for the file like org.openvpn.YOURVPNNAME.plist, then change the user and group to root:wheel with the following command in a terminal window:

1
sudo chown root:wheel /Library/LaunchDaemon/org.openvpn.YOURVPNNAME

last commands to register and execute your Launch scripts are:

1
2
sudo launchctl load /Library/LaunchDaemon/org.openvpn.YOURVPNNAME.plist
sudo launchctl start org.openvpn.YOURVPNNAME

a restart should be the very last thing to do and once your mac has started you shoud be connected to your vpn network(s)!

enjoy ;)

UPDATE: the new version of tunnelblick 3.2beta26 does have the the “connect when computer starts” functionality that automatically makes this post obsolete. I’ll just keep it for the records :)

Comments

It would have made sense to use LocationMatch with a negative lookahead regex pattern like ”/(?!admin)” but that doesnt work. Neither work a rule like !”/admin” so here is a workaround:

1
2
3
4
5
6
7
8
9
10
11
12
<Location "/">  
AuthType Basic  
AuthName "Restricted Files"  
AuthUserFile /var/www/clients/client12/web17/passwd  
AuthGroupFile /dev/null  
Require valid-user  
SetEnvIf Request_URI "^/(admin|skin|js|index)(.*)$" allow  
SetEnvIf Request_URI "^/favicon.ico$" allow  
Order allow,deny  
Allow from env=allow  
Satisfy Any  
</Location>

This basically allow the access without authentication to the directories/files that start with admin, skin, js or index. The other rule allow the favicon too.