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
UPDATE casetracker_case SET pid='NEWPROJECTNID' WHERE pid='OLDPROJECTNID'; | |
UPDATE og_ancestry SET group_nid='OLDGROUPNID' WHERE nid in ('CASENODEID', 'OTHERCASENODEID'); |
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
/srv/salt/populate/init.sls: | |
{% set host_name = grains['host'] -%} | |
testfile: | |
file: | |
- managed | |
- name: /home/vagrant/testfile | |
- source: salt://populate/testfile | |
- template: jinja | |
- defaults: |
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 | |
board = [ ['-'] *3 for i in range(3) ] | |
for i, line in enumerate(board): | |
for char in line: | |
print char, | |
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
UPDATE `node` SET `comment` = '2' WHERE `type` = 'toolkit'; | |
UPDATE node_revision SET comment=2 WHERE nid IN (SELECT nid FROM node WHERE node.type='toolkit'); |
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 |