This tweet has to have been the most popular thing I have ever said. At time of posting it has gained 80 retweets, 25 favourites and many replies/questions. Work recently bought me a new workstation, so the 1st thing I always do is to dual boot with Ubuntu. Some might consider me an edge case user. [...]
Archive for the ‘Computers’ Category
Symfony2 pagination
Using Symfony2, DQL and knplabs/knp-paginator-bundle – how to get around “Cannot count query which selects two FROM components, cannot make distinction”
Chroot SFTP home dir
Example user ‘iain’ sudo mkdir -p /chroot/iain/home/iain sudo useradd -M -d /home/iain iain sudo passwd iain sudo chwon iain: /chroot/iain/home/iain sudo nano -w /etc/ssh/sshd_config # At the end of the file, add: Match User paypoint ChrootDirectory /chroot/iain AllowTCPForwarding no X11Forwarding no ForceCommand internal-sftp sudo /etc/init.d/ssh restart
Making an entity repository container aware in Symfony2.1
I had a need to add ACL rules to entities at the repository level. My biggest struggle was getting dependancy injection working. This is what I finally came up with after a fresh mind and an instant coffee:
Adding extra fields to FOSUserBundle / SonataUserBundle
Sadly, this isn’t really documented (at time of writing). Adding new protected variables to your User.php entity will not actually create database entries when you try to do a doctrine:schema:update. While one still needs to have the protected variables in this entity class, along with getters and setters, the actual creation work is within UserBundle/Resources/config/doctrine/User.orm.xml [...]
Ubuntu 12.04 LTS on Bytemark VM
If, like me, you can’t wait for Ubuntu 12.04.1 to be released, you can force an upgrade of your favourite OS OS. sudo apt-get update; sudo do-release-upgrade -d If you are going from the previous LTS 10.04, then the -d is important. Otherwise there would be no upgrade to offer. The upgrade process should go smoothly [...]
Updating a WordPress database with new domain details
Further to my original quick db update queries, I found the need for a more in-depth approach. A WordPress site my father works on has weekly backups, but he wanted to see that they actually worked. To do so, I set up a subdomain vhost on my bytemark server and set about getting the back to work [...]
PPTP tunnels and if-up.d
Current project requires a couple of VPN tunnels to be set up. An IPsec and a PPTP. The IPsec will wait for another day, the PPTP is set up and ready to go. One thing that wasn’t quite right with the tunnel though, is the static route created by PPTP missed out a large chunk [...]
Symfony 1.4 Doctrine 1.2 MS SQL Server
Web server: Linux (Ubuntu on my dev setup), Apache, PHP 5.3, Symfony 1.4, Doctrine 1.2. Database server: Microsoft Windows 2008 Server, MS SQL Server Trying to get Symfony to talk to the database server has been a painful experience for the last few days. But perseverance has paid off. Lots of Googling with trial & [...]
Google calendar in Mozilla Thunderbird on Ubuntu 11.10
Via the Ubuntu Software Centre: Search for thunderbird Click on the search result “Thunderbird Email” and then on the “More Info” button Enable at least the “Calendar Extension for Thunderbird – Google Calendar support (xul-ext-gdata-provider)” Install the add-ons Open your Google Calendar in your web browser In the left-hand column, under “My calendars”, hover over [...]

