Skip to content

Instantly share code, notes, and snippets.

View ralic's full-sized avatar
🏠
Working from home

Ralic Lo ralic

🏠
Working from home
View GitHub Profile
@ralic
ralic / .bashrc
Created November 10, 2015 04:00 — forked from vsouza/.bashrc
Golang 1.4.1 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@ralic
ralic / hdfs-mesos.md
Created January 11, 2016 06:42 — forked from samklr/hdfs-mesos.md
Setup HDFS on Mesos, Run Spark Cluster dispatcher via Marathon

Setup Mesos-DNS

Scripts for setting up

sudo mkdir /etc/mesos-dns
sudo vi /etc/mesos-dns/config.json
@ralic
ralic / README.md
Created January 13, 2016 13:31 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@ralic
ralic / mesos-jenkins-marathon
Created May 14, 2016 06:32 — forked from diatmpravin/mesos-jenkins-marathon
mesos-jenkins-marathon json
{
"id": "jenkins",
"cmd": "cd jenkins-standalone-master && ./jenkins-standalone.sh -z $(cat /etc/mesos/zk) -r 127.0.0.1:6379",
"cpus": 0.5,
"mem": 256,
"disk": 1024,
"instances": 1,
"ports": [
0
],
@ralic
ralic / go-install.md
Created May 21, 2016 15:45 — forked from diegopacheco/go-install.md
How to Install GO Lang on CentOS / Amazon Linux?

How to Install GO Lang on CentOS / Amazon Linux?

sudo wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz
tar -xzf go1.4.2.linux-amd64.tar.gz 
export GOROOT=PATH_WHERE_YOU_EXTRACT_GO
export PATH=$PATH:$GOROOT/bin 
export GOBIN=$GOROOT/bin 
mkdir ~/golang/ 
export GOPATH=~/golang/ 
@ralic
ralic / golang-tls.md
Created May 21, 2016 16:40 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https

@ralic
ralic / docker.json
Created June 26, 2016 07:45 — forked from hitsujiwool/docker.json
docker + docker-compose on Amazon Linux
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
},
"builders": [
{
"type": "amazon-ebs",
"ssh_pty": true,
"access_key": "{{user `aws_access_key`}}",
@ralic
ralic / osx_uninstall_mysql_install_mariadb_homebrew.md
Created June 28, 2016 03:38 — forked from brandonsimpson/osx_uninstall_mysql_install_mariadb_homebrew.md
OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

OSX How To: Uninstall native MySQL and install MariaDB via Homebrew

This is a short overview on how to completely remove any old mysql server installs in OSX and upgrade to MariaDB without conflicts. Things can get a bit weird when you have various old installs of MySQL server floating around, and utilizing homebrew to install and upgrade MariaDB as a drop in replacement for MySQL has worked well, especially if you're used to managing MySQL installs via yum in linux.

First: Backup Your Data!

Backup all of your current databases with mysqldump

This isn't a tutorial on backups, and there are many ways to do it. You should know how to backup your data anyway. For this example, we'll do a full backup of our InnoDB databases.

#!/bin/bash
for n in $(chrome-cli list tabs | awk '{print $1}' | sed -e 's/\[//' | sed -e 's/\]//'); do
chrome-cli execute '$("#run-code-button").click()' -t $n > /dev/null
done
@ralic
ralic / startRstudio.sh
Created July 9, 2016 08:35 — forked from mchirico/startRstudio.sh
Steps for accessing Rstudio using Kaggle's image
#!/bin/bash
# Set the environment - my env is big2 (Change this!)
eval $(docker-machine env big2)
# Launch browser for your environment (Again, change this to match your environment)
(sleep 3 && open "http://$(docker-machine ip big2):8787")&
# Run the image to pickup your local directory.
# Here I have my files stored in /Users/mchirico/Dropbox/kaggle/death