My Writings. My Thoughts.

I share

I share stuff: code, links, knowledge and files …
Below you can see some “articles” I wrote, don’t hesitate to comment! :)

jQuery Chosen fork

// januari 16th, 2012 // No Comments » // Development, Javascript, jQuery, plugin, script

Today I forked the jQuery plugin Chosen. The original code used some dirty code to show and hide the list-items and there were some additional options I added. Now it’s possible to specify if you want to hide or show the search field (default its off) and if you want the search function to look for you query string at the beginning of the list-item label, or wherever.

If you’re using Chosen in combination with SpModal, it’s now possible to have the Chosen list come out of the modal window, using this style:

<style>
#sp-modal-container { overflow: visible !important; }
#select_pln_chzn { position: absolute; }
</style>

Chosen + SimpleModal

search_enabled and search_at_start pretty much speak for themself.

Fork: https://github.com/klaascuvelier/chosen

Boxee 1.2.2 on Ubuntu Oneiric Minimal

// december 21st, 2011 // No Comments » // Boxee, Development, Ubuntu

Update: you can download Boxee 1.5 on their website now:
http://blog.boxee.tv/2011/12/26/boxee-1-5-fall-software-update/

 

Got @ 1.2.2 running on #ubuntu oneiroc minimal! Some playback issues. Altough I'm excited! http://t.co/M7Ph8gTM
@klaascuvelier
Klaas Cuvelier

Looking to fix the playback errors, and I’ll post a walk-through later!

Sublime Text 2 – rsync on save

// december 1st, 2011 // No Comments » // Development, plugin, Python

As I’m running an Ubuntu Server in a virtual machine as development test server and I develop on my local environment, I need to keep both repositories in sync.
Before, I shared the code on the development server to my local environment via NFS. The setup worked, but gave some complications with svn, and the auto mounting of the NFS-share after rebooting. So I started looking for a new way to keep all files in sync. I considered sharing via NFS the other way around, but that would make my test server very slow; all php files need to be loaded through NFS and all assets (images, css, javascript) too.
The easiest way to solve my problem was through the good old rsync. As I’m too lazy to run an rsync command every time before I want to load a page from my test-server, I wanted it to be done automatically when I saved a file.
As Sublime Text 2 is an awesome editor which supports plugins, I started surfing around looking for some examples which I then adapted for my own use..
This is the plugin I now use:

import sublime, sublime_plugin, subprocess

class RsyncOnSave(sublime_plugin.EventListener):
def on_post_save(self, view):

syncProject = “”"rsync -avz localpath remotepath &”"”
subprocess.call([syncProject],shell=True)

This code is put in a file named RsyncOnSave.py which is saved a folder named RsyncOnSave, in the Packages folder (for OSX thats: ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/). The plugin should automatically be loaded when you (re-)start Sublime Text.
localpath and remotepath obviously are the paths in your case. Note the ampersand at the end of the sync command, which makes sure your editor doesn’t freeze while the command is being executed.

Make sure you’ve put your public ssh-key in the authorized_keys on your server, so you don’t have to give your password when rsyncing.

Squeezebox server on Ubuntu Oneiric

// november 17th, 2011 // No Comments » // Ubuntu

I had some problems with my squeezebox server installation after upgrading to Oneiric.
When I tried starting the server, I got this error:

Starting Squeezebox Server: Use of inherited AUTOLOAD for non-method YAML::Syck::DumpYAML() is deprecated at /usr/share/squeezeboxserver/CPAN/YAML/Syck.pm line 65.
The following modules failed to load: DBI EV XML::Parser::Expat HTML::Parser JSON::XS Digest::SHA1 YAML::Syck Sub::Name
*******
NOTE:
If you’re running some unsupported Linux/Unix platform, please use the buildme.s
script located here:

http://svn.slimdevices.com/repos/slim/7.6/trunk/vendor/CPAN/

If 7.6 is outdated by the time you read this, Replace “7.6″ with the major versi
You should never need to do this if you’re on Windows or Mac OSX. If the install
don’t work for you, ask for help and/or report a bug.

of Squeezebox Server you are running.

*******
Exiting..

I read a lot on Google, about checking out a SVN repository and compiling stuff myself, but that failed for me.
Installing a nightly version of the server is what solved my problems, version 7.7 that is.
There doesn’t appear to be a “squeezeboxserver”, but installing “Logitech Media Server” instead worked perfectly in my case.

You can get it here:

http://downloads.slimdevices.com/nightly/?ver=7.7

Tethering on jailbroken iPhone 3G with IOS 4.2.1

// december 8th, 2010 // No Comments » // Cuvedev, iPhone, nohomepage

I was able to enable tethering on my iPhone 3G with IOS 4.2.1.
To do so, I had to jailbreak my iPhone and install Cydia. Using redsn0w 0.9.6b4 it was a piece of cake. Attention, I have an iPhone 3G, so this is a full jailbreak, not a tethered jailbreak. I haven’t tested this with a tethered jailbreak.
If you haven’t jailbroken your phone yet, here’s a guide.

Once you’ve jailbroken your phone, install openSSH (using Cydia), so you can ssh into your device.
Don’t forget to change your root password (more info on this here)!

Now to enable tethering, you’ll have to install an application called TetherMe. You can buy and install it on your iPhone using Cydia or you can look for the installer on the internet and do it for free (illegally off course).

If you want to do it for free, I’ll make it easy for you, you can download it here: TetherMe-xsellize.deb
When you have the .deb file, scp it onto your iPhone, and install it using ssh (instructions below).

To ssh and scp to your phone you’ll need the IP-address of your phone.
Go to Settings > Wi-Fi and click on the white arrow in the blue circle of the network you’re connected to, you’re IP-address should on the info page you get.
Then, on your computers console do this:

$ scp Downloads/TetherMe-xsellize.deb root@192.168.100.118:/private/var/mobile

Replace the IP-address above with yours and enter your root password (if you haven’t changed it, its alpine).

Then ssh into your iPhone to install it:

$ ssh root@192.168.100.118

And install the file:

# cd /private/var/mobile/
# dpkg -i TetherMe-xsellize.deb

When it’s installed you should reboot your iPhone, and tethering should be enabled.


Disclaimer:
I don’t encourage jailbreaking iPhones and installing illegal software. I’m just pointing out it can be done.
Also I don’t take any responsibility for anything if you fuck up your iPhone