Reference Chunks

Programming and data notes

Access Properties of R Crosstable

Included file ‘JB/setup’ not found in _includes directory

Accessing properties of CrossTable

conv_cross <- CrossTable(data_set$col1, data_set$col2)
conv_table <- conv_cross$prop.row

Start or Stop Mysql on Debian

Included file ‘JB/setup’ not found in _includes directory

If you can’t use init.d to stop/start/restart mysql server on Debian

Debian (or CrunchBang) repository installs of mysql create a debian-sys-maint user that is used to startup and shutdown the database server via the /etc/init.d/mysql script. If you import all databases from another server, including the mysql database, this will be overwritten and init.d won’t work. So either don’t import the users table or add the debian-sys-maint users back in at the end, the user should have SHUTDOWN and SELECT privileges but doesn’t need others.

http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix

mysql: debian-sys-maint password changed by accident, possible to change it back?

http://serverfault.com/questions/32692/cant-start-stop-mysql-service

http://www.debian-administration.org/articles/442

Start Denyhosts on Amazon Aws

Included file ‘JB/setup’ not found in _includes directory

Starting DenyHosts on Amazon AWS micro instance

If denyhosts is not starting with…

ImportError: No module named DenyHosts.python_version

After you install it with yum, copy the DenyHosts directory from the python2.4 (which may have come along in the install) site_packages directory to the python2.6 (or whatever) site_packages directory.

From: Reactive, unmediated, immediate opinion. » DenyHosts “ImportError: No module named DenyHosts.python_version

Ssh to Nat Virtualbox

Included file ‘JB/setup’ not found in _includes directory

Get to NAT networked Virtualbox guest from the host

Wanted to use Putty to get to an Ubuntu 11 server edition virtual machine guest running on VirtualBox Windows 7 host without using bridged networking.

Make sure that an ssh server is installed and running on the VM.

sudo apt-get install openssh-server

Shutdown the VM.

Then, in a windows command window, go to the VirtualBox program folder.

VBoxManage.exe modifyvm "VMnameInQuotes" --natpf1 "guestssh,tcp,,2222,,22"

To get access to a webserver like apache on the guest machine use…

VBoxManage.exe modifyvm "VMnameInQuotes" --natpf1 "guesthttp,tcp,,8080,,80"

If you want to use other ports, for Rails or Django or something, they will have to be set up to…

VBoxManage.exe modifyvm "VMnameInQuotes" --natpf1 "guestApp1,tcp,,8888,,8000"

Restart the VM.

Connect with Putty using localhost port 2222.

Connect with your browser using http://localhost:8080

How did I do that?: NAT Port forwarding in VirtualBox Windows Host

VirtualBox Manual - Configuring port forwarding with NAT

Sql to Remove Whitespace and Quotes

Included file ‘JB/setup’ not found in _includes directory

sql query to remove whitespace and quotation marks

works in sqlite and mysql, probably others.

UPDATE tablename SET colname=trim(replace(colname, '"',''));

Restore Internet Connection to Imported Virtualbox

Included file ‘JB/setup’ not found in _includes directory

restore Internet connection on imported virtualbox appliance

after importing a linux guest on a windows 7 host if there is no network connection available try…

rm /etc/udev/rules.d/70-persistent-net.rules

…and then reboot.

Seems to work without unintended consequences.

reference

networking - Internet connection fails in Ubuntu on VirtualBox when virtual machine is created from “Import appliance” - Super User