Skip to content

Instantly share code, notes, and snippets.

View lsaffie's full-sized avatar

Luis Saffie lsaffie

View GitHub Profile
@lsaffie
lsaffie / hs-bootstrap
Last active December 27, 2015 22:29
hs-bootstrap
echo "base packages"
sudo apt-get -y install curl libncurses-dev libgnome2-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev \
libx11-dev libxpm-dev libxt-dev ruby-dev memcached build-essential openssl libssl-dev python
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -q -y install mysql-server mysql-client libmysqlclient-dev
# ruby developer packages
@lsaffie
lsaffie / hs-bootstrap-ec2
Last active December 29, 2015 14:28
hs-bootstrap-ec2
#Make sure github is trusted prior to running this
# ssh github.com
#Usage wget --no-check-certificate -O - https://gist.github.com/lsaffie/7683731/raw/hs-bootstrap-ec2 |bash
sudo apt-get update
echo "base packages"
sudo apt-get -y install curl libncurses-dev libgnome2-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev \
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "homestars-devbox-vagrant"
config.vm.network :private_network, ip: "10.0.0.100"
@lsaffie
lsaffie / Vagrantfile
Created December 18, 2013 01:41
Vagrantfile with public networking
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
#VM name
config.vm.box = "homestars-devbox-vagrant"
@lsaffie
lsaffie / gist:9622244
Last active September 23, 2015 16:51
get count of tables
DBUSER="root"
DBPASS=""
DBNAME="dbname"
array=( a b c )
for i in "${array[@]}"
do
echo $i
mysql -u$DBUSER $DBNAME -p$DBPASS -e "select count(*) from $i"
done
@lsaffie
lsaffie / gist:3ed8cb57f2446482661d
Last active August 29, 2015 14:06
upgrade vm to Wheezy and install mysql 5.6
#Let's back up just in case
sudo mv /var/lib/mysql /var/lib/mysql-saved
#replace your /etc/apt/sources.list with the lines below: (beetween BEGIN/END)
#---BEGIN
deb http://ftp.us.debian.org/debian/ wheezy main
deb-src http://ftp.us.debian.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
@lsaffie
lsaffie / hsdevbox
Last active August 29, 2015 14:07
build hsdevbox
#Make sure github is trusted prior to running this
# ssh github.com
#Usage wget --no-check-certificate -O - https://gist.github.com/lsaffie/5259be3fd24008ebb7db/raw/hsdevbox |bash
#using dotdeb
echo 'deb http://packages.dotdeb.org wheezy all' | sudo tee --append /etc/apt/sources.list
echo 'deb-src http://packages.dotdeb.org wheezy all' | sudo tee --append /etc/apt/sources.list
sudo apt-get update
@lsaffie
lsaffie / gist:e4c303adf60c0e7b1f12
Last active August 29, 2015 14:11
EC2 instance - ubuntu
#Make sure github is trusted prior to running this
# ssh github.com
#Usage wget --no-check-certificate -O - https://gist.github.com/lsaffie/5259be3fd24008ebb7db/raw/hsdevbox |bash
apt-get update
echo "base packages"
@lsaffie
lsaffie / prepare-commit-msg
Last active November 4, 2016 21:25
git hook: appends branch name on every commit
#!/bin/bash
# Place this in <project_name>/.git/hooks/prepare-commit-msg
git branch | sed -n '/\* /s///p' >> $1
%h1 Tmux cheatsheet
https://github.com/lsaffie/tmux
Prefix:
<pre><code>ctrl+a</code></pre>
Moving aroud:
right:
<pre><code>ctrl+a + l</code></pre>