This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From SO: http://stackoverflow.com/questions/3987683/homebrew-install-specific-version-of-formula | |
# Or just: brew install https://raw.github.com/Homebrew/homebrew-versions/master/yourpkg-version.rb | |
Simple Workflow | |
Step 1: | |
Navigate to your homebrew base directory (usually this is /usr/local) Example: | |
cd /usr/local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rpm2cpio my-rpm-file-name.rpm | cpio -idmv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a table with the following SQL syntax: | |
# $ sqlite3 db/testing.db | |
# create table places(id integer primary key, name text, xloc int, yloc int); | |
# insert into places values(NULL, 'Stream', 300.3, 100.4); | |
# select * from places; | |
# 1|Stream|300.3|100.4 | |
# for NULL in SQL, use the Python None | |
import sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Usage: | |
python timed_capture.py | |
''' | |
import datetime | |
from time import sleep | |
import subprocess | |
fps = 1 # The number of frames to capture per second. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import android | |
droid = android.Android() | |
scan = droid.scanBarcode().result | |
result = [(scan['extras']['SCAN_RESULT'])] | |
droid.dialogCreateAlert('u'.join(result)) | |
droid.dialogShow() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup the CentOS Base with helpful utilities | |
#!/bin/bash | |
yum update -y | |
yum install system-config-firewall-tui vim screen sudo man git -y | |
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
rpm -Uvh epel-release-6-8.noarch.rpm | |
yum install salt-minion --enablerepo=epel -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate a file of a specified size | |
# Use if=/dev/urandom for random stuff in the file | |
# This creates a file that is 3mb seek=$[1024*x] where x is the size in MB's you want it to be. | |
dd if=/dev/zero of=3mbfile.png bs=1024 count=0 seek=$[1024*3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Drupal 6 NGINX Configuration File | |
# Enable www.mysite.com or mysite.com to be served | |
server { | |
server_name www.mysite.com; | |
rewrite ^/(.*) $scheme://mysite.com/$1 permanent; | |
} | |
server { | |
server_name mysite.com; | |
access_log /var/log/nginx/mysite.com-access.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'select mail from users' | mysql -u root -p DBNAME > /home/yourhomedirectory/users.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
path = 'data' | |
os.chdir(path) | |
files = sorted(os.listdir(os.getcwd()), key=os.path.getmtime) | |
oldest = files[0] | |
newest = files[-1] |