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 ruby | |
require 'pg' | |
=begin | |
when creating a postgres db replica in RDS, or restoring from a snapshot, the | |
underlying EBS volume of the new instance must be initialized by reading every | |
block, otherwise the blocks will be lazy-initialized by production queries | |
which will be extremely latent. (i've seen normally 50ms queries take 30s in |
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
{ | |
"bridge": { | |
"name": "HomekitBridge", | |
"username": "CC:FF:3D:E3:CE:01", | |
"port": 51826, | |
"pin": "000-55-321" | |
}, | |
"description": "DJ's house", | |
"platforms": [ | |
{ |
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/sh | |
### BEGIN INIT INFO | |
# Provides: homebridge | |
# Required-Start: $network $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start daemon at boot time | |
# Description: Enable service provided by daemon. | |
### END INIT INFO |
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 | |
set -e | |
exec > >(tee -a /var/log/eb-cfn-init.log|logger -t [eb-cfn-init] -s 2>/dev/console) 2>&1 | |
PREINIT_CMD=' | |
{ | |
"api_version" : "1.0", | |
"request_id": "0", | |
"command_name": "CMD-PreInit" |
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 | |
# | |
# Look, you are not supoposed to do this. But dang it, it speeds up recompiles by a lot. | |
# | |
echo "job count is: " `defaults read com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTask` | |
echo "Changing to: $1" | |
defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTask $1 | |
echo "job count is now: " `defaults read com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTask` |
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
#@ /etc/quagga/bgpd.conf (Centos & Ubuntu) | |
hostname <Local OS hostname> | |
password <Any random phrase> | |
enable password <Any random phrase> | |
! | |
log file /var/log/quagga/bgpd | |
!debug bgp events | |
!debug bgp zebra | |
debug bgp updates |
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 -eu | |
# Show all events for CF stack until update completes or fails. | |
cf_tail() { | |
local stack="$1" | |
local current | |
local final_line | |
local output | |
local previous | |
until echo "$current" | egrep -q "${stack}.*_(COMPLETE|FAILED)" ; do |
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
Contributor: Adam Edwards | |
1. Install chocolatey – http://chocolatey.org | |
2. Install PSReadline to give PowerShell readline power – use the –emacs mode in your PowerShell profile so you have history search and other keyboard behavior like bash: https://github.com/lzybkr/PSReadLine | |
3. Use chocolatey to install ConEmu, a terminal replacement that supports ANSI colors, dynamic resizing, “normal” text selection and cut and paste, and lots of other customizations: cinst conemu. And set the startup shell for ConEmu to PowerShell (not cmd.exe) | |
4. Use chocolatey to install an editor – if you’re not already an emacs or vim person, use it to install Atom or Sublime, or Notepad++ | |
5. Always use PowerShell – do not use cmd.exe | |
6. Install ChefDK and use chef shell-init powershell to get at your Chef Ruby environment. | |
7. Use Pantry – it can automate #1, 3, 4, and 6 and will probably have support for #2. https://github.com/chef/pantry-chef-repo | |
8. If you get stuck on a box where you don’t an editor or chocolatey and need to e |
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
$ python | |
Python 2.7.8 (default, Jul 2 2014, 10:14:46) | |
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from bson.objectid import ObjectId | |
>>> import datetime | |
>>> ObjectId.from_datetime(datetime.datetime(2014, 8, 1)) | |
ObjectId('53dad8800000000000000000') |
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 | |
### BEGIN INIT INFO | |
#### BASED ON THE GIST: https://gist.github.com/2623205 | |
# Provides: unicorn | |
# Required-Start: $all | |
# Required-Stop: $network $local_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start the unicorns at boot | |
# Description: Enable at boot time. |
NewerOlder