-
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)
-
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.
