Skip to content

Instantly share code, notes, and snippets.

@syz3r
syz3r / extract.py
Created October 12, 2018 12:18
iphone-backup-extractor python 3 script
# Original project https://github.com/alexisrozhkov/extract_media_from_backup
import os
import shutil
import sqlite3
import argparse
# http://stackoverflow.com/questions/12517451/python-automatically-creating-directories-with-file-output
def copy_file_create_subdirs(src_file, dst_file):
anonymous
anonymous / init.sls
Created June 8, 2015 16:40
# Location: /srv/salt/raidarray/
## notice namespacing at top-level of each block, followed by the module.function
raid-create-array:
cmd.script:
- source: salt://raidarray/create_raid.sh
- cwd: /
- user: root
# here I am calling the pkg module and installed function but it requires first that cmd module ran previously on namespaced
@obfusk
obfusk / break.py
Last active July 16, 2024 11:26
python "breakpoint" (more or less equivalent to ruby's binding.pry); for a proper debugger, use https://docs.python.org/3/library/pdb.html
import code; code.interact(local=dict(globals(), **locals()))
@trey
trey / hubot-slack-heroku.md
Last active October 25, 2021 03:18
Steps to Install Hubot in Slack using Heroku
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@mclosson
mclosson / Espresso-Howto.md
Last active December 18, 2015 00:59
How to make Coffee, Lattes and Cappucinos with the Envy Labs Espresso Machine

Coffee

  • Check appropriate water level (ensure not empty)
  • Check for coffee beans (fill hopper if not full, close to lid not completely though, beans are in cabinet above)
  • Remove porta-filter from espresso machine (this is the thing which holds the coffee grounds / cakes)
  • Press Espresso on grinder to select espresso mode (its timing should be preconfigured for you)
  • Hold porta-filter under grinder and press start (angle porta-filter up to hold mess in)
  • Tap and level off coffee grindings a bit manually
  • Remove tamper from espresso machine and push it down on top of the porta-filter so the line between the black and metal is right at the top and make it level
  • Tap off flattener and return to espresso machine
@wpeterson
wpeterson / git_capistrano_tasks.rb
Created February 7, 2013 20:26
Useful capistrano tasks for git cache_copy maintenance
namespace :git do
desc "Prune remote git cached copy (fixes errors with deleted branches)"
task :prune do
repository_cache = File.join(shared_path, 'cached-copy')
logger.info "Pruning origin in remote cached-copy..."
run "cd #{repository_cache}; git remote prune origin"
end
desc "Clear Capistrano Git cached-copy"
task :clear_cache do
@joel
joel / gist:2909289
Created June 11, 2012 09:25
Make You Own Gem
http://guides.rubygems.org/make-your-own-gem/
rvm use ruby-1.9.3-p0@lorem --create
echo "rvm use ruby-1.9.3-p0@lorem --create" >> lorem/.rvmrc
bundle gem lorem
gem build lorem.gemspec
git tag -a v0.0.1 -m 'version 0.0.1'
git push --tags
gem push lorem-0.0.1.gem
@danielberlinger
danielberlinger / performance.rb
Created March 27, 2012 20:10
A Rails initializer for using Rails 3 notifications and statsd
require 'statsd'
$statsd = Statsd.new('your_host_here')
ActiveSupport::Notifications.subscribe /process_action.action_controller/ do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
controller = event.payload[:controller]
action = event.payload[:action]
format = event.payload[:format] || "all"
format = "all" if format == "*/*"
status = event.payload[:status]
@nherment
nherment / backup.sh
Created February 29, 2012 10:42
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`