All posts tagged: howto

Pair view fields content on a Drupal 7 view quick howto

Leave a comment
Drupal

Valid for: Drupal 7, Views 3. I have two multiple text fields on a Drupal 7 content type. I want to display those fields paired by delta in a view. Here the code I used in my module named mymodule.module. Thanks to hook_views_pre_render(). I use this piece of code to pair Youtube URLs and plain text description  for a JSON output generated via Views Datasource. Remember to disallow multiple values when adding these fields to […]

Django development on Virtualbox: step by step setup

Leave a comment
Coding / django / Howtos / Python

I had a bad morning trying to repair my Cygwin installation from a virtualenv mess. It’s time to get a Debian and install it on a Virtualbox for my new django project! Windows: host Debian: guest Choosing the distro: what I want Python 2.6 Django 1.4 Apache + Mysql I’m a Debian fan from years so I go to the Debian website and download Wheezy netinst iso (32 bit, since I’m on a 32 bit OS […]

Turn Raspberry into a small NAS with samba

comments 13
Howtos

I got a Raspberry Pi Model B. It’s cheap and I want to do some experiments for fun. Experiment #1: I have a 1T external HDD (FAT) and I want to turn Raspberry into a very basic NAS. I used: 1 External USB HDD (with external power supply) 1 ethernet cable CAT. 5 (10/100) or better 1 HDMI cable and monitor / tv 1 smartphone microusb battery charger 1 SDHC (for the OS) Raspbian “wheezy” […]

Disable upload and comment for a new content type programmatically

comments 9
Drupal

Following code is useful when installing a module that create a new content type programmatically on Drupal 6.x. Basically, it adds two variables setting default values for comments (core Comment module) and attachments (core Upload module). Code to write on my_funny_module/my_funny_module.install. function my_funny_module_install() { // Disable attachments // Read http://api.drupal.org/api/function/upload_nodeapi/6 on "load" variable_set("upload_my_content_type", 0); // Disable comments for this content type // Read http://api.drupal.org/api/function/comment_form_alter/6 variable_set('comment_my_content_type', COMMENT_NODE_DISABLED); // Install schema as usual (if any) drupal_install_schema('my_funny_module'); } […]

Howto extract tracks from mkv and avi

comments 4
Howtos

This howto requires: mplayer mkvtoolnix your Linux box 😉 Audio from Avi files (es. Xvid + MP3): mplayer -dumpaudio "mymovie.avi" -dumpfile mymovie_audio_track.mp3 Tracks from Matroska MKV file: List all tracks: mkvmerge -i mymovie.mkv File 'mymovie.mkv': container: Matroska Track ID 1: video (V_MS/VFW/FOURCC, XVID) Track ID 2: audio (A_VORBIS) Track ID 3: audio (A_VORBIS) Track ID 4: subtitles (S_TEXT/UTF8) Track ID 5: subtitles (S_TEXT/UTF8) mkvextract tracks *.mkv 3:mymovie_audio_track.ogg 4:mymovie_subtitle.srt Creates two files, mymovie_audio_track.ogg (track 3) and […]