Skip to content

Instantly share code, notes, and snippets.

View kevmo's full-sized avatar
🔭

kevin moore kevmo

🔭
View GitHub Profile
@kevmo
kevmo / gist:11a52cf6d70b83af5969
Created March 18, 2016 20:05
Get a pg_dump from a remote server to your local machine
`ssh -i whatever.pem centos@93.93.1.203`
`sudo -su postgres`
`cd ~` # gotta get out of the centos home directory
`exit`
`exit`
From your local machine:
git checkout master
git pull origin master
npm install
gulp
git add <-f> dist
git commit -m "Add /dist commit for gh-pages deployment"
git subtree split --prefix dist <master>
@kevmo
kevmo / postgres-cheatsheet.md
Last active December 9, 2015 19:15 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

Magic words:

sudo -su postgres
psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

  • \q: Quit/Exit
@kevmo
kevmo / Vagrantfile
Created December 4, 2015 14:14
Using an ansible master machine
Vagrant.configure(2) do |config|
config.vm.define "webserver" do |webserver|
webserver.vm.box = "bento/centos-7.1"
webserver.vm.network "private_network", ip: "192.168.0.2"
webserver.vm.hostname = "webserver"
end
config.vm.define "ansible" do |ansible|
webserver.vm.box = "bento/centos-7.1"
webserver.vm.network "private_network", ip: "192.168.0.254"
@kevmo
kevmo / yum_build-essential.sh
Created December 3, 2015 02:09
Installing build-essential on yum
sudo yum install -y libxml2 libxml2-devel libxslt libxslt-devel
@kevmo
kevmo / Vagrantfile
Last active December 2, 2015 04:54
bootstrap.sh file for Vagrantfile provisioning CentOS env for Node Express app
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
Vagrant.configure(2) do |config|
config.vm.define "webserver" do |webserver|
webserver.vm.box = "ubuntu/trusty64"
webserver.vm.network "private_network", ip: "192.168.0.2"
webserver.vm.hostname = "webserver"
end
config.vm.define "ansible" do |ansible|
ansible.vm.box = "ubuntu/trusty64"
@kevmo
kevmo / README.md
Created October 26, 2015 21:49
fresh block
@kevmo
kevmo / gist:513b5d34c8ed74e44334
Created December 12, 2014 20:54
Scrape a page for images using BeautifulSoup
import sys
import urllib2
import contextlib
from bs4 import BeautifulSoup
if len(sys.argv) < 2:
print 'Error: Please provide a URL to scrape.'
sys.exit(1)
<!doctype html>
<html>
<head>
<style>
.hidden { display: none; }
#dead-drop { height: 200px; width: 200px; border: 1px solid #333; }
</style>
</head>
<body>
<form enctype="multipart/form-data" action="#" method="post">