Phone: +65-8585-1750

Address: 30 Holland Close, Singapore

Fixing up Author and Committer emails in a Repo

Mon, Jul 14, 2014 mdda OSS Blog Comments
Fixing up Author and Committer emails in a Repo GitHub doesn’t add emails that it doesn’t recognize into your ‘contributor score’ (and activity calendar, etc). This can be a particular gotcha if one develops on a local machine and commits as ‘username@localhost’ for instance. Steps to Fix the emails First, get fully in-sync with the current GitHub state : git pull git push For certainty, update your .git/config to reflect the user you actually want to be : #more .git/config ...

Install nvidia Optimus drivers on Fedora FC20 Acer Notebook - BumbleBee

Sun, Jun 15, 2014 mdda OSS Blog Comments
Install nvidia Optimus drivers on Fedora FC20 Acer Notebook - BumbleBee The Acer i5 laptop comes with two graphics paths : The i5 associated (Intel) chipset, and A ‘discrete’ nVidia GT 750M / 4Gb graphics card (which looks like the more interesting OpenCL device) One issue, though, is that the Intel graphics chip is low-power, and I love the ~7hr battery life. Whereas running the NVidia card (according to people on the internet) reduces the laptop battery life to 1.5hr.

Install Radeon OpenCL drivers on Fedora FC20

Thu, Jun 5, 2014 mdda OSS Blog Comments
Install ATI Radeon OpenCL drivers on Fedora FC20 Basic steps : Install ATI Official Drivers (see other post) Install additional SDK stuff for OpenCL Prove that the install worked Get the OpenCL SDK File name (search on AMD site) : AMD-APP-SDK : http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/ There is a way to get wget to provide a suitable phoney browser user-agent, but it escapes me for now. It’s a 130Mb file… yum install opencl-headers mkdir AMD-APP-SDK mv AMD-APP-SDK-v2.9-lnx64.tgz AMD-APP-SDK/ cd AMD-APP-SDK/ tar -tzf AMD-APP-SDK-v2.9-lnx64.tgz more ReadMe.txt ./Install-AMD-APP.sh Check whether the icd files are right : more /etc/OpenCL/vendors/amdocl64.icd Checking whether the card is there Fedora has a clinfo package, which is useful : yum install clinfo clinfo Gives : No protocol specified Number of platforms 1 Platform Name AMD Accelerated Parallel Processing Platform Vendor Advanced Micro Devices, Inc.

Building VisualSFM on Fedora FC20

Tue, Jun 3, 2014 mdda OSS Blog Comments
Install the VisualSFM system on Fedora (FC20) The VisualSFM system is the recommended way to use PMVS and CMVS : http://www.di.ens.fr/pmvs/ http://www.di.ens.fr/cmvs/ So, download the Linux 64-bit source code from : http://ccwu.me/vsfm/ The Process for Running VisualSFM : The following have to be run in a coordinated fashion, which is what VisualSFM does : Bundler CMVS PMVS2 Emphasising this, the notes for CMVS state : You should ALWAYS use CMVS after Bundler and before PMVS2 (even when your image set is small), because : PMVS2 will run faster and produce more accurate results with the produced clusters (see the bullet below for the reasoning.) CMVS produces option files (option-0000, option-0001, …) for PMVS2 and a script file (pmvs.sh) containing PMVS2 commands.

Install Official Radeon Catalyst drivers on Fedora FC20

Fri, May 30, 2014 mdda OSS Blog Comments
Install ATI Radeon OpenCL drivers on Fedora FC20 Basic steps : Install ATI Official Drivers Fix the bugs Prove that the install worked Download the official drivers wget http://www2.ati.com/drivers/beta/linux-amd-catalyst-14.6-beta-v1.0-may23.zip unzip linux-amd-catalyst-14.6-beta-v1.0-may23.zip rm linux-amd-catalyst-14.6-beta-v1.0-may23.zip cd fglrx-14.20/ ./check.sh Then, as root, run the amd-driver-installer, and check that fglrx has been blacklisted : yum install kernel-devel kernel-headers gcc ./amd-driver-installer-14.20-x86.x86_64.run lsmod Success? : Next steps will be : joe /etc/modprobe.d/blacklist-fglrx.conf reboot No success? more /usr/share/ati/fglrx-install.log Fixing the bugs… Probably have to fix it up.

Install nvidia drivers on Fedora FC20

Wed, May 28, 2014 mdda OSS Blog Comments
Install nvidia OpenCL drivers on Fedora FC20 Basic steps : Install nvidia Proprietary Drivers (mainly CUDA-oriented instructions) Install additional SDK stuff for OpenCL Prove that the install worked Download and install the nVidia driver For the official links, see : https://developer.nvidia.com/opencl http://www.nvidia.com/Download/index.aspx?lang=en-us The 64-bit linux driver takes me to : http://www.nvidia.com/download/driverResults.aspx/75019/en-us So that I can download : NVIDIA-Linux-x86_64-331.67.run NB : This has to be downloaded via a browser, so, since the target machine is (essentially) headless, I have to download to a regular machine and then rsync it over.

ARM Toolchain for STM32-F3 Discovery on Fedora

Thu, Mar 21, 2013 mdda OSS Blog Comments
ARM Toolchain for STM32-F3 Discovery on Fedora Basic steps : Install stlink, so that linux recognizes the STM32 card over USB Install OpenOCD, which provides a ‘virtual JTAG’ debugging environment Redherring : CodeSourcery Install ARM gnu tools ‘gcc-arm-embedded’ Download the STM32-F3 supplier code (includes the demo .hex file, for instance) Get the STM32-F3-Discovery template Make the template’s simple blinking LED demo work Reflash the initial demo using stlink Off to do our own projects… Install stlink Have a look at the stlink github site.

Building CIFS.ko for a no-name Android TV device

Thu, Jul 26, 2012 mdda OSS Blog Comments
Building CIFS.ko for a no-name Android TV device Much more fill-in detail to follow… mkdir 2-kernel cd 2-kernel/ # http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source scp root@wifitv.herald:/proc/config.gz .. git clone https://android.googlesource.com/platform/prebuilt git clone git://github.com/madmaze/Meson-3-Kernel.git gunzip config.gz cp config Meson-3-Kernel/.config cd Meson-3-Kernel more .config git log export PATH=$(pwd)/../prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH export ARCH=arm export SUBARCH=arm export CROSS_COMPILE=arm-eabi- # Hmmm - someone misplaced a folder... mkdir -p ../out/target/product/f16ref/root make menuconfig # Set 'M' next to CIFS (not '*' or 'Y') # http://forum.xda-developers.com/showthread.php?t=1113191 cp kernel/slow-work.{c,h} fs/cifs/ CREATE fs/cifs/slow-work-addon.c cat fs/cifs/slow-work-addon.c >> fs/cifs/slow-work.c scite fs/cifs/Makefile obj-$(CONFIG_CIFS) += cifs.o slow-work.o make scp fs/cifs/*.ko root@wifitv.herald:/mnt/sda1/2-Kernel/ # On android device : insmod /mnt/sda1/2-Kernel/slow-work.ko insmod /mnt/sda1/2-Kernel/cifs.ko cp /mnt/sda1/2-Kernel/*.ko /boot/ insmod /boot/slow-work.ko insmod /boot/cifs.ko 130|root@android:/data/local # cat /proc/kmsg 720 more .config 721 cp ../config .config 722 make menuconfig # Select the option to create a standalone CIFS module 723 make 728 cp kernel/slow-work.{c,h} fs/cifs/ 729 scite fs/cifs/slow-work.c 730 scite fs/cifs/slow-work-addon.c 732 cat fs/cifs/slow-work-addon.c >> fs/cifs/slow-work.c 733 scite fs/cifs/Makefile 734 make 741 more /etc/fstab 742 more /home/andrewsm/.cifs/bigdisk 743 man mount.cifs [andrewsm@square ~]$ cd ./Downloads/Android/root-tv-device/2-kernel/Meson-3-Kernel/fs/cifs/ [andrewsm@square cifs]$ ls -l *.ko -rw-r--r--.

G2X connecting in developer mode

Sat, Jan 7, 2012 mdda OSS Blog Comments
G2X connecting in developer mode On Fedora, I was having issues getting my T-Mobile G2X to connect in developer mode. For sure, I was setting Settings-Applications-USBdebugging to Checked. And when plugging in the device, the SD card (and/or) internal memory space was showing up on the desktop (and the output in /var/log/messages looked equivalent to that from my working G1) - but no joy with : adb devices. The Fix : Eventually, after trying everything I could think of, to no avail, I finally toggled Settings-Applications-USBdebugging off-and-on while the phone is connected via USB.

MythBackend service not starting

Fri, Nov 25, 2011 mdda OSS Blog Comments
MythBackend service not starting /var/log/messages complains : Nov 24 23:52:54 myth systemd[1]: mythbackend.service: control process exited, code=exited status=235 Nov 24 23:52:54 myth systemd[1]: Unit mythbackend.service entered failed state. Simple solution (not tested whether this survives reboot) : # touch /var/run/mythbackend.pid; chown mythtv:mythtv /var/run/mythbackend.pid # systemctl start mythbackend.service # grep mythbackend

nginx configuration for uwsgi for Flask

Fri, Nov 18, 2011 mdda OSS Blog Comments
nginx configuration for uwsgi for Flask /etc/nginx/conf.d/site.conf : server { server_name example.com www.example.com; root home/example/flask/static; location ~ ^/(img|js|css)/ { # |pi||ext|theme root /home/example/flask/static; add_header Cache-Control public; #expires 30d; #access_log off; } location / { try_files $uri @yourapplication; } location @yourapplication { include uwsgi_params; uwsgi_pass unix:/tmp/uwsgi_example.sock; } } This must be married with a uwsgi service started by a script in /etc/init.d/ : #!/bin/bash # uwsgi - Use uwsgi to run python and wsgi web apps.

Building uwsgi from src.rpm without Python 3

Wed, Nov 16, 2011 mdda OSS Blog Comments
Building uwsgi from src.rpm without Python 3 To build uwsgi on Fedora 12 (which has no easy-to-find python3 rpm), run through the rpmbuild process (shown in a previous post in more detail for nginx) and make the following changes : wget http://kad.fedorapeople.org/packages/uwsgi/uwsgi-0.9.9.2-2.fc15.src.rpm rpm -ivh uwsgi-0.9.9.2-2.fc15.src.rpm rpmbuild -bb ~/rpmbuild/SPECS/uwsgi.spec yum install python-devel libuuid-devel jansson-devel libyaml-devel ruby-devel python3-devel python-greenlet-devel lua-devel ruby # NB: python3-devel doesn't exist... # Need to fix up the fedora configuration file : joe ~/rpmbuild/SOURCES/fedora.ini # Take out the reference to python32 [uwsgi] inherit = default embedded_plugins = echo, ping, http #plugins = rack, psgi, python, nagios, fastrouter, admin, python32, ruby19, cache, cgi, rpc, ugreen, greenlet, lua plugins = rack, psgi, python, nagios, fastrouter, admin, ruby19, cache, cgi, rpc, ugreen, greenlet, lua # Similarly, edit the spec file (), to take out the installation of the python3 files : joe ~/rpmbuild/SPECS/uwsgi.spec # Take out the reference to python32 # %files -n %{name}-plugin-python3 # %{_libdir}/%{name}/python32_plugin.so # Then, building should work...

Updating nginx (with uwsgi) for Fedora 12 from src.rpm

Mon, Nov 14, 2011 mdda OSS Blog Comments
Updating nginx (with uwsgi) for Fedora 12 from src.rpm In order to get access to uwsgi (useful for deploying python flask projects, for instance), one needs a version of nginx > 0.8 or so. But Fedora 12 doesn’t have such a modern version : Here’s how to build it from a src.rpm from a more recent Fedora release. # First, make sure we have the rpm-build tools : yum install rpm-build # Download a suitable src.rpm (look at the dependencies : # nginx doesn't really care about which version of fedora it's for wget ftp://ftp.muug.mb.ca/mirror/fedora/linux/development/rawhide/source/SRPMS/nginx-1.0.5-1.fc16.src.rpm # This installs the source into ~/rpmbuild/BUILD/nginx-1.0.5/ rpm -ivh nginx-1.0.5-1.fc16.src.rpm # Now, do a test build to see what we're missing rpmbuild -bb ~/rpmbuild/SPECS/nginx.spec # This complains about missing dependencies : Do a copy-paste as necessary yum install pcre-devel zlib-devel openssl-devel 'perl(ExtUtils::Embed)' libxslt-devel GeoIP-devel gd-devel # Rebuild again (installing more packages if this fails) rpmbuild -bb ~/rpmbuild/SPECS/nginx.spec # Now install nginx from the brand new rpm just created: rpm -Uvh ~/rpmbuild/RPMS/i386/nginx-1.0.5-1.fc12.i386.rpm # Attempt a restart : /etc/init.d/nginx restart # ...

Compiling nginx (with uwsgi) for Fedora 12

Tue, Oct 18, 2011 mdda OSS Blog Comments
Compiling nginx (with uwsgi) for Fedora 12 In order to get access to uwsgi (useful for deploying python flask projects, for instance), one needs a version of nginx > 0.8 or so. But Fedora 12 doesn’t have such a modern version : Here’s how to compile it from source : Actually, a less hacky approach is to simply back-port (trivially) a src.rpm from Fedora 16 : That’s in a newer

Laptop Data Security

Fri, Nov 5, 2010 mdda OSS Blog Comments
Laptop Data Security This should be a no-brainer for anyone carrying anything important around on a laptop. IMHO, relying on a user password (like a login password) is not a great idea, since anyone with physical access to the disk can get to your data easily. OTOH, using disk encryption seems like overkill - since if you want to hand your laptop to someone for a little web browsing, you shouldn’t have to reveal all the ‘secrets’ to do so.

Running rsync from a webserver (using sudo)

Wed, Oct 21, 2009 mdda OSS Blog Comments
Running rsync from a webserver (using sudo) Situation I want to have ‘rsync’ run when a user presses a button on the webserver. The software stack is as follows (though this was largely a red-herring, see below) : Fedora - server lighttpd - webserver Twiki - intranet setup perl - plugin language for Twiki bash - perl launches a script to run the rsync sudo - to ‘change user’ to the one with the correct permissions for the source folder rsync - the actual backup utility ssh - file transfer mechanism, and auto-login (via its private key) to the remote server Solution It turns out that it wasn’t perl ‘Taint’ that was stopping the rsync from running… Nor lighttpd, nor the ‘user’ for the ‘ssh’ embedded in the rsync command… To cut a long story short, the final solution revolved around understanding the additional ‘requiretty’ constraints that Fedora (and maybe other distributions) has for sudo.

lmms with Fedora - compile source

Sun, Mar 29, 2009 mdda OSS Blog Comments
lmms with Fedora - compile source lmms has some dependencies that are not so easy to determine for Fedora Basic setup : yum install cmake git yum install qt qt-devel Synth extras : yum install libsndfile libsndfile-devel yum install fluidsynth fluidsynth-devel yum install stk stk-devel yum install fftw-devel Importantly for wine VST(i) : yum install wine wine-devel yum install glibc-devel.i386 Hope this helps

Gateway GM6543E Linux Installation

Sat, Oct 4, 2008 mdda OSS Blog Comments
Gateway GM6543E Linux Installation Initial Boot Problems Booting kernel on stock Fedora 9 x64 DVD requires the kernel option : ‘intel_iommu=off’ to be appended to the kernel boot line. Updated kernels (after, say, 2.2.26), no longer need this extra parameter. USB Keyboard Unless ‘Legacy USB’ is set in the BIOS (which it is by default), the USB keyboard can’t be used to change GRUB selections. Hibernate Seems to work. Suspend Arrrrgh!

Mount Windows (or Samba) share on Linux

Sun, Sep 7, 2008 mdda OSS Blog Comments
Mount Windows (or Samba) share on Linux After a suitable mount-point is created (in this example mkdir -p /mnt/fscapital_server/), into /etc/fstab put the following (all on one line) : # Mount windows Server drive : //192.168.10.120/server /mnt/fscapital_server/ cifs username=andrewsm,password=whatever 0 0 where each of the spaces above is really a cntrl-t (Tab) - just for neatness, really. Then one can mount /mnt/fscapital_server/ and see the drive immediately with ls -l /mnt/fscapital_server/.

Linux Screen Capture for YouTube

Sun, Sep 7, 2008 mdda OSS Blog Comments
Linux Screen Capture for YouTube ffmpeg is the command line utility I chose - does enough, but not too much (like mplayer, for instance). YouTube and Google ideal input video 640x480 @ 30 fps MPEG4 Preparation Grab the ffmpeg package from ATrpms. # rpm --import http://ATrpms.net/RPM-GPG-KEY.atrpms # scite /etc/yum.repos.d/atrpms.repo # yum install ffmpeg For speed of capture : # Mount a RAM disk (as su) : mkdir /media/ffmpeg mount -t tmpfs tmpfs /media/ffmpeg exit Capture Grabbing the screen (the data rate of 1Mb/sec set with ‘-b’ option) # Grab a standard 640x480 screen from top-left of screen (choose frame rate with '-r') ffmpeg -f x11grab -r 15 -s 640x480 -i :0.0+5,20 -b 1M /media/ffmpeg/grab.flv Test the grab - to make sure it’s what’s needed : ffplay /media/ffmpeg/grab.flv In order to play around with different scenes, or intro and lead-out title frames : # Convert frames to mpeg (can be concatenated easily, output framerate set with '-r') ffmpeg -i /media/ffmpeg/grab.flv -r 30 /media/ffmpeg/grab.mpg Making a Title Sequence # Create title.png from title.svg (inkscape - number of frames=100, at 30fps) ffmpeg -loop_input -vframes 100 -i title.png -r 30 title.mpg Join the Scenes together… # mpg files can be simply 'cat'd together cat title.mpg frames.mpg > joined.mpg Test the movie (and/or upload to youtube) : ffplay joined.mpg Alternative - build the movie out of frames… Create frames for movie via drawstuff… Cntrl-W : this is a feature of the drawstuff GUI front-end for ODE - it creates a sequence of .ppm files from the frames of the simulation.

Extra keys on Belkin MediaPilot (linux)

Tue, Nov 6, 2007 mdda OSS Blog Comments
Extra keys on Belkin MediaPilot (linux) Here are the keycodes that I was able to uncover using showkey -k. Unfortunately, the kernel logs don’t complain when I hit the unknown keys so there’s probably no point in setting up the extra scancodes (particularly since this Belkin MediaPilot keyboard is not the primary keyboard in the system, and the setkeycodes documentation suggests that it only works on the primary keyboard). I’ve tried to use useful codes out of linux/input.h, and can confirm that these actually feed through to MythTV, so that they can be used as JumpPoints, or whatever.

Verizon USB720 on Fedora

Thu, Aug 30, 2007 mdda OSS Blog Comments
Verizon USB720 on Fedora The device was initially registered with Verizon using the VZaccess application on Windows. This may be a step that requires their annoy-ware. After that initial stage, the device contains an embedded phone number, that is required to do proper logging-in for National Access / Broadband Access. Plugging this into a spare USB port on my Fedora Linux laptop (and looking in /var/log/messages) showed that Fedora 7 recognizes the device ‘out of the box’, without any special modifications.

Air-H Edge Card H407P Setup

Sat, Jul 21, 2007 mdda OSS Blog Comments
Air-H Edge Card H407P Setup Situation Trusting to the power of Linux on my laptop, I blindly ordered an AirH Edge connectivity card from JCR (Air-H (Edge) Data Card for Laptops - No Airtime or Data Charges). Prior to leaving the US, I downloaded a few things, anticipating that I’d be ‘flying blind’ since I wouldn’t be able to connect until it actually worked. I was able to get it working eventually, but the following shows the results of a process that wasn’t plain sailing at all.