Connect to MySQL from R

I initially attempted to install via: sudo apt-get build-dep r-cran-rmysql But I received an error trying to access MySQL from R: Error in library(RMySQL) : there is no package called ‘RMySQL’ colin@mikrojenkins:~/mikroR$ cat installer.r #!/usr/bin/r install.packages(‘RMySQL’,type=’source’, repos=’http://cran.cnr.berkeley.edu/’) *It hosed on me if I didn’t specify a repos arg* Once RMySQL was installed, I was able[…]

Call R from Python

colin@mikrojenkins:~$ mkdir mikroR colin@mikrojenkins:~$ cd mikroR colin@mikrojenkins:~/mikroR$ virtualenv . New python executable in ./bin/python Installing setuptools, pip…done. colin@mikrojenkins:~/mikroR$ . bin/activate (mikroR)colin@mikrojenkins:~/mikroR$ pip install rpy2 …. error: Setup script exited with Error: Tried to guess R’s HOME but no R command in the PATH. (mikroR)colin@mikrojenkins:~/mikroR$ sudo apt-get update [sudo] password for colin: (mikroR)colin@mikrojenkins:~/mikroR$ sudo apt-get install[…]

Netflix on Ubuntu 14.04 LTS Trusty Tahr

I upgraded from 13.04 to 14.04… Already had Netflix-desktop installed… but was running into errors with DRM… So I installed Pipelight: #apt-add-repository ppa:pipelight/stable #apt-get update #apt-get install pipelight-multi #pipelight-plugin –enable silverlight Still had errors, so I cleared Silverlight Storage and deleted: #rm -rf /home/colin/.wine-browser/drive_c/users/Public/Application\ Data/Microsoft/PlayReady/* w00t – Netflix on Linux!

AWSPlay (Python CSV Parsing)

#csvCreds.py import csv def getSecret(file=”C:\Users\cstgeorge\Downloads\credentials.csv”): with open(file, “rb”) as ofile: reader = csv.DictReader(ofile, delimiter=’,’) for row in reader: return row[‘Secret Access Key’] def getID(file=”C:\Users\cstgeorge\Downloads\credentials.csv”): with open(file, “rb”) as ofile: reader = csv.DictReader(ofile, delimiter=’,’) for row in reader: return row[‘Access Key Id’] #awsPlay.py import csvCreds import boto from boto.s3.key import Key if __name__ == “__main__”: conn[…]

s3fs on Ubuntu

#To install and mount s3fs on Ubuntu: root@mikrojenkins:/usr/src# apt-get remove fuse root@mikrojenkins:/usr/src# apt-get install build-essential libcurl4-openssl-dev libxml2-dev mime-support root@mikrojenkins:/usr/src# wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.9.3/fuse-2.9.3.tar.gz root@mikrojenkins:/usr/src# tar xzf fuse-2.9.3.tar.gz root@mikrojenkins:/usr/src# cd fuse-2.9.3 root@mikrojenkins:/usr/src/fuse-2.9.3# ./configure –prefix=/usr/local root@mikrojenkins:/usr/src/fuse-2.9.3# make && make install root@mikrojenkins:/usr/src/fuse-2.9.3# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig root@mikrojenkins:/usr/src/fuse-2.9.3# ldconfig root@mikrojenkins:/usr/src/fuse-2.9.3# modprobe fuse root@mikrojenkins:/usr/src# wget https://s3fs.googlecode.com/files/s3fs-1.74.tar.gz root@mikrojenkins:/usr/src# tar xzf s3fs-1.74.tar.gz root@mikrojenkins:/usr/src/s3fs-1.74# cd s3fs-1.74 root@mikrojenkins:/usr/src/s3fs-1.74#[…]

s3cmd on Windows

#s3cmd on Windows Install Python 2.7: https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi Add ;C:\Python27;C:\Python27\Scripts to PATH environment variable #setx /m PATH “%PATH%;C:\Python27;C:\Python27\Scripts;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Git\bin” Download pip: https://bootstrap.pypa.io/get-pip.py python get-pip.py Install: http://files.gpg4win.org/gpg4win-2.2.1.exe #git clone https://github.com/s3tools/s3cmd.git c:\s3cmd Download and unpack: https://github.com/s3tools/s3cmd/archive/master.zip pip install python-dateutil pip install python-magic c:\s3cmd>python s3cmd –configure ERROR: Option –preserve is not yet supported on MS Windows[…]

Ruby Slack Notifier

Register at Slack.com Create a channel for your Team Configure a Custom Incoming WebHooks Integration Install the app on your phone (Optional, but it will receive push notifications) ##Replace Your Unique Webhook URL accordingly (In @@uri)! root@mikrodash:/opt/dashing/rmm_hud# cat jobs/SlackNotifier.rb require ‘net/http’ require ‘json’ require ‘uri’ class SlackNotifier @@uri = URI.parse(“PASTE_URI_HERE”) @@header = {‘Content-Type’ => “text/json”}[…]

Backticks or exec?! Silly Ruby

Found this awesome post explaining external calls with ruby: [mentalized.net](http://mentalized.net/journal/2010/03/08/5_ways_to_run_commands_from_ruby/) My Dashing app kept hosing when calling python for some data. I was using result = exec(“python getTicketCount.py”) which REPLACES current process… result = `python getTicketCount.py` worked like a champ