Skip to content

Instantly share code, notes, and snippets.

View mstyne's full-sized avatar
🐍
Improving my Python skills

Michael Styne mstyne

🐍
Improving my Python skills
View GitHub Profile
@KlausTrainer
KlausTrainer / delete_documents_from_view_result.rb
Created December 27, 2010 19:11
Delete all documents whose id appears in a given view result.
#!/usr/bin/env ruby
require 'rubygems'
require 'rest_client'
require 'json'
require 'cgi'
def bye
abort("Usage: #{$0} [view_url]\nExample: #{$0} http://admin:secret@127.0.0.1:5984/db/_design/ddoc/_view/recent-posts")
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@jtimberman
jtimberman / omnibus.erb
Created December 6, 2011 20:15
Omnibus Bootstrap Template, latest version I use.
# Refer to CHEF-2815. http://tickets.opscode.com/browse/CHEF-2815
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
exists() {
if command -v $1 &>/dev/null
then
return 0
else
<?xml version='1.0' encoding='ASCII'?>
<flow_graph>
<timestamp>Tue Apr 10 20:21:22 2012</timestamp>
<block>
<key>options</key>
<param>
<key>id</key>
<value>rtl_nfm_rx</value>
</param>
<param>
@jasonkeene
jasonkeene / uber_pass.py
Last active October 7, 2015 20:08
Generate and check password hashes for Ubersmith DE (salted sha1)
r"""Generate and check password hashes for Ubersmith DE (salted sha1).
Example use:
>>> my_new_hash = generate_hash('my_new_pass', 'salt')
>>> my_new_hash # store this in the database
'{ssha1}W77amZWRUSWjDLh04P/dlfsCvYdzYWx0\n'
>>> check_password('my_new_pass', my_new_hash)
True
>>> check_password('not_my_new_pass', my_new_hash)
@ricardobeat
ricardobeat / emoji.md
Created November 26, 2012 22:37
Why we can't process Emoji anymore - mirror of https://gist.github.com/1707371
From: Chris DeSalvo <chris.desalvo@voxer.com>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <AE459007-DF2E-4E41-B7A4-FA5C2A83025F@voxer.com>

--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
 charset=utf-8
@luk-
luk- / gist:4270276
Created December 12, 2012 18:26
What if it was written in ruby?
13:22 luke_: what if it was written in ruby
13:22 mstyne: oh jesus
13:23 mstyne: $ rake freeballin/dolphin_pants.rb --test --noop --trace --gemsgemsgems
13:23 luke_: ruby -ivrq rake::run_test_env guacamole:-:machine:fulfill --env=production_test_mock --debug-level-low=2 --debug=semi-true
@mstyne
mstyne / gist:4279272
Created December 13, 2012 19:57
Fix CentOS SSH key baloney
# restorecon -R -v /root/.ssh
@mstyne
mstyne / csr and key
Created December 14, 2012 17:19
openssl, generate csr and key
openssl req -new -nodes -keyout some.domain.com.key -out some.domain.com.csr -newkey rsa:2048
@mstyne
mstyne / hiring.md
Created February 20, 2013 20:20
Ubersmith, Inc. is hiring!

Ubersmith, Inc. is hiring! New York's premiere Data Center Management software company is looking to expand our operations team in beautiful downtown Troy, New York.

Our hard and fast requirements for this position:

  • Strong Linux system administration skills required. Super strong.
  • We're serious about that first one. If you are not comfortable with your Linux administration abilities, please do not apply for this position.
  • Significant experience deploying, configuring, and troubleshooting RHEL, CentOS, and Debian Linux distributions.
  • Significant experience troubleshooting and deploying Apache, MySQL, PHP, Tomcat, and Postfix on those platforms.
  • Experience troubleshooting the source of errors generated by PHP applications.
  • Experience working directly with customers to resolve their issues via both email and telephone.