Skip to content

Instantly share code, notes, and snippets.

View danieljimenez's full-sized avatar

Daniel danieljimenez

  • Texas
  • 01:36 (UTC -05:00)
View GitHub Profile
@jwhiting
jwhiting / warmup.rb
Created May 14, 2018 22:00
Warming up EBS volumes on RDS replicas/snapshots (ruby script)
#!/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
anonymous
anonymous / config.json
Created May 29, 2017 18:11
{
"bridge": {
"name": "HomekitBridge",
"username": "CC:FF:3D:E3:CE:01",
"port": 51826,
"pin": "000-55-321"
},
"description": "DJ's house",
"platforms": [
{
anonymous
anonymous / homebridge
Created May 29, 2017 18:10
#!/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
anonymous
anonymous / ebbootstrap.sh
Created February 15, 2017 07:55
#!/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"
@zvaavtre
zvaavtre / gist:e63cafb6c6c3a68b14be7bb86c12077f
Created November 4, 2016 21:29
IDEBuildOperationMaxNumberOfConcurrentCompileTask
#!/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`
@heri16
heri16 / bgpd.conf
Last active February 21, 2023 05:40
AWS VPC VPN StrongSwan Virtual Tunnel Interface (VTI)
#@ /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
@lox
lox / cloudformation_tail.sh
Created August 3, 2015 04:08
A bash script to tail CloudFormation events
#!/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
@scarolan
scarolan / #1 - Chef Windows Workstation
Last active January 28, 2016 12:44
Ten Quick Tips to Improve your Chef Workflow
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
@chengfred
chengfred / gist:08ca1c8ad81543309421
Created August 29, 2014 19:28
manually generate cv for Aug.1 2014
$ 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')
@ndbroadbent
ndbroadbent / unicorn_init_script.sh
Last active January 24, 2018 22:43
Unicorn init.d script, with support for RVM (system-wide), and cold restarts whenever the Ruby version changes (in .ruby-version)
#!/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.