Thursday, October 24, 2013

Flash not working in Firefox on linux

i recently had an issue with successful playing youtube videos in my firefox browser on my debian linux machine. i previously installed the flashplugin-nonfree package to use as the flash plugin and everything worked fine for a while.

after googling around i came to the realization that the following packages

browser-plugin-gnash
gnash
gnash-common

were installed at some point and prevented the correct rendering of flash videos. so i removed the gnash packages with the following command.

aptitude purge browser-plugin-gnash gnash gnash-common


after removing the gnash packages, youtube and other flash videos began working again as expected.

so, how do i prevent gnash from being installed again and causing future problems. i found several interesting solutions, a few are listed at the bottom of this post. i decided to place a hold on the gnash packages (while uninstalled). below is the command i used.

aptitude hold browser-plugin-gnash gnash gnash-common


i've never used hold with apt before, so hopefully this will prevent any future installs of gnash. if anyone has a successful experience preventing specific packages from being installed, i would definitely like to hear your solution.

also check out:
http://tuxmark.blogspot.com/2013/11/update-flash-plugin-in-firefox-on.html


below are a few links i found while researching this issue.

http://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html
http://askubuntu.com/questions/75895/how-to-forbid-a-specific-package-to-be-installed
http://serverfault.com/questions/17046/preventing-specific-packages-from-getting-installed-in-debian

Wednesday, October 23, 2013

How to post json with curl

i needed to test a php script by posting a json body in the request with curl from the debian linux command line. below is the solution i found.

curl -X POST -H "Content-Type: application/json" -d '{"key": "value"}' http://localhost/myscript.php


info taken from:
http://stackoverflow.com/questions/7172784/how-to-post-json-data-with-curl-from-terminal-commandline-to-test-spring-rest

Tuesday, October 22, 2013

Building Mysql 5.5 from source

following are the steps I used to build from source and install mysql 5.5 on my debian system

download the Mysql 5.5 tarball from mysql.com . become the root user and move the downloaded tarball to /usr/local/src. unpack the mysql tarball with:
tar -xvzf mysql-5.5.xx.tar.gz

add specific user and group to run mysql as:
groupadd mysql
useradd -r -g mysql mysql 

change directory to be inside source tree
cd /usr/local/src/mysql-5.5.xx

execute make commands
cmake .
make
make install

change to install directory
cd /usr/local/mysql

execute post installation setup commands
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .
chwon -R mysql data
cp support-files/my-medium.cnf /etc/my.cnf
bin/mysqld_safe --user=mysql &
cp support-files/mysql.server /etc/init.d/mysql.server

login to mysql command line client and set passwords
mysql -u root -p
enter root password when prompted

display existing users
SELECT User, Host, Password FROM mysql.user;

assign password to the root user
UPDATE mysql.user SET Password = PASSWORD('newpassword') 
    WHERE User = 'root';
FLUSH PRIVILEGES;

assign password to the anonymous user
UPDATE mysql.user SET Password = PASSWORD('newpassword')  
    WHERE User = '';
FLUSH PRIVILEGES;

display existing users to verify passwords have been set
SELECT User, Host, Password FROM mysql.user;


exit mysql command line client
quit

add non-root user to mysql group
usermod -a -G mysql myUsername

add symlink to access mysql and mysqladmin
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
ln -s /usr/local/mysql/bin/mysqladming /usr/bin/mysqladmin



info taken from:
http://dev.mysql.com/doc/refman/5.5/en/installing-source-distribution.html