RSS feed
  • service error when starting mongodb

    I was trying to start mongodb just now and couldn't understand why it wasn't working. Turns out I needed to be sudo - not the most clear error message ...

     
    $ service mongodb start
    start: Rejected send message, 1 matched rules; type="method_call", sender=":1.11
    212" (uid=1000 pid=1360 comm="start) interface="com.ubuntu.Upstart0_6.Job" membe
    r="Start" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart
    " (uid=0 pid=1 comm="/sbin/init"))
    $ sudo service mongodb start
    mongodb start/running, process 1326
    
  • Ubuntu 11.04 on Thinkpad T420s

    Just bought this thinkpad 420s. The first thing I did when I got it was install Ubuntu 11.04 on it. Most everything worked on first install, including things which many people seemed to have problems with on the forums.

    Working:

    • Displays work fine with 3d effects and everything (dual monitor with and without docking station) (Intel HD Graphics 3000)
    • Built in speakers and headphone jack both work
    • Built-in mic and web-cam both work - I used skype and google hangouts and both worked flawlessly.
    • wireless worked with my open network connection (I haven't yet tried it on secure networks)
    • Bay battery seems to work.

    Not Working:

    • Audio output on docking station
    • Dual Displays sometimes reset to showing the same image on both rather than two seperate displays. This has always been fixed by reseting the settings in the Monitor configuration page.

    I am impressed with how flawless the install was. I was dreading it because last time I did this on my last laptop 4 years ago, I spent a few hours getting everything in working order. So far I have not yet had to do any custom installation. Everything that I needed working, worked out of the box!

    Let me know if you want me to test anything out and I'll try if I can.

  • PiCloud Simulation: OSError: [errno 13] permission denied

    I tried running a PiCloud simulation on Ubuntu 10.04 on linode and got the following error:

    OSError: [errno 13] permission denied

    I found the solution here:

    add the following line to your fstab and reboot:

    none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0

    If you don't want to reboot, a temporary fix might be:

    sudo chgrp $GROUP /dev/shm
    sudo chmod g+w /dev/shm

    That last part might not be the best way to do it, but it worked for me.

  • TP-Link TL-WN722N on Ubuntu 10.04

    Note: according this guy this set of steps also works for Fedora 15.

    I had a lot of trouble getting this card to work. Here is how I finally got it.

    I am running 2.6.32-30-generic-pae #59-Ubuntu SMP
    running "lsusb" shows the following line for my device: 0cf3:9271 Atheros Communications, Inc.

    I tried a bunch of different compat-wireless versions and this one finally did it. At the time, it was the latest stable release. The daily snapshots were causing kernel panics ... Download it, decompress it and build it:


    $ tar xvf compat-wireless-2.6.38.2-2.tar.bz2
    $ cd compat-wireless-2.6.38.2-2
    $ ./scripts/driver-select ath9k_htc
    $ sudo make
    $ sudo make install

    I had to download version 1.2 of htc_9271.fw the firmware from here and copied the file to /lib/firmware.

    I was getting wlan%d instead of something reasonable like wlan0. Running sudo ifconfig wlan%d showed me the mac address which I could use to add an entry to /etc/udev/rules.d/70-persistent-net.rules. Heres the entry I added: (note that the browser adds newlines here, but you should add just two lines: one for the comment, and one for the rule)


    # USB device 0x0cf3:0x9271 (usb)
    SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="54:e6:fc:94:91:35", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan2"

    reload the drivers by running:

    sudo modprobe ath9k_htc

    Now plug in the device. There were a lot of other steps that I followed while trying to get this to work, so I may have left something out.

  • MySQL Permission Errors After Moving Datadir

    I wanted to make space on my root partition and so moved my mysql data dir to /home/mysql in /etc/mysql/my.conf and received the following errors:

    dwiel@dwiel:~$ sudo mysqld
    091111 20:39:16 [Warning] Can't create test file /home/mysql/dwiel.lower-test
    091111 20:39:16 [Warning] Can't create test file /home/mysql/dwiel.lower-test
    091111 20:39:16 [Note] Plugin 'FEDERATED' is disabled.
    mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
    091111 20:39:16 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    091111 20:39:16 InnoDB: Operating system error number 13 in a file operation.
    InnoDB: The error means mysqld does not have the access rights to
    InnoDB: the directory.
    InnoDB: File name ./ibdata1
    InnoDB: File operation call: 'open'.
    InnoDB: Cannot continue operation.

    The problem was with apparmor. It was restricting mysql from reading and writing to /home/mysql. To correct this I edited the file /etc/apparmor.d/usr.sbin.mysqld and added:


    /home/mysql r,
    /home/mysql** rwk,

    to the end of the file. Then restarted apparmor:


    sudo /etc/init.d/apparmor restart

    and then restarted apache with no problem

  • Build tolua++ files with makefile

    Here is how you can have your makefile build your tolua++ .cpp and .h files for you. It should work for plain tolua also.

    TOLUA = tolua++5.1
     
    tolua_%.cpp tolua_%.h : %.pkg
    	$(TOLUA) -o $(@:%.h=%.cpp) -H $(@:%.cpp=%.h) $<

    this will generate tolua_file.cpp and tolua_file.h files from corresponding file.pkg files anytime they the .cpp or .h file is depended on somewhere else in the file. In my case I just added tolua_file.o to my list of objects. Here is the full makefile for the project which required this - for reference:

     
     
    # LINUX
    LIBLUA=lua5.1
    # MAC OSX
    #LIBLUA=lua
     
    # LDFLAGS=-arch x86_64
    OBJS = swarm.o group.o scene.o vmath.o tolua_group.o tolua_swarm.o tolua_vmath.o
    CXX = g++
    CXXFLAGS = -Wall -c -O2 `sdl-config --cflags`
    LDFLAGS = -Wall `sdl-config --libs`
    INCLUDES = -I./include -I/usr/include/lua5.1 -I/opt/local/include
    LIBS = -L./lib -lANN -lGL -lGLU -llo -ltolua++5.1 -l$(LIBLUA)
    TOLUA = tolua++5.1
     
    tolua_%.cpp tolua_%.h : %.pkg
    	$(TOLUA) -o $(@:%.h=%.cpp) -H $(@:%.cpp=%.h) $<
     
    %.o: %.cpp
    	$(CXX) $(INCLUDES) $(CXXFLAGS) -c $< -o $@
     
    # the executable
    swarm: $(OBJS)
    	$(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
     

    download

  • Howto install pyclutter 0.8.2 on Ubuntu

    Ubuntu 8.04 has pyclutter 0.6.2 in the repositories while the current stable version is 0.8.2. Here is how I installed pyclutter 0.8.2 with all of the extra available libraries (gtk, gst, cairo):

    download:

    also make sure you have python-cairo-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev installed. There may be more required, but these were the only ones I didn't already have installed.

    For some reason I had to configure all of these libraries with --prefix /usr to get pycluster to see all of them.

    Also, configure pycluster with --enable-docs if you want any documentation.

    have fun!

  • JQuery + Greasemonkey

    Had to look around to figure out how to include jquery in greasemonkey. Should have just guessed this first; Just use the @require, and your standard jquery document ready code. Heres my template anyway.

     
    // ==UserScript==
    // @name           JQuery Template
    // @author         Zach Dwiel
    // @description    Provide a basic template for using jquery in greasemonkey
    // @include        *://*
    // @require        http://code.jquery.com/jquery-latest.js
    // ==/UserScript==
     
    $(document).ready( function() {
        // your jquery code here
    }
     
  • Controlling Samples by Spitting Them

    Last night, Nate and I were able to sucessfully and intuitively control up to 3 or 4 individual drums based on different sounds vocalized into a mic. The bass drum would play when 'oooh' was sung, a snare when 'eee' was sung and a cymbal when 'aaah' was sung.  There are still some kinks in the system, but as a proof of concept, it works fairly well.  The mapping between input sound and MIDI event are learned in real time so you are not restricted to different vowel sounds.  The 3 distinguishing sounds could have just as easily been a clap, growl and whistle.  The code: fftknn.

  • Passwordless login for SSH not working

    I have not been able to login to my system with passwordless SSH for some time now and finally figured out the problem.  I had to change the permissions of my home directory to disallow writing by everyone.  I knew that ~/.ssh and the files in it required specific permissions to be set, but I hadn't heard about the home directory having similar requirements.