Skip to content

Instantly share code, notes, and snippets.

View rmetzler's full-sized avatar
💭
Recruiters should mention the role and salary range if you spam me.

Richard Metzler rmetzler

💭
Recruiters should mention the role and salary range if you spam me.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am rmetzler on github.
  • I am rmetzler (https://keybase.io/rmetzler) on keybase.
  • I have a public key whose fingerprint is AD31 3E97 F146 C745 D6E8 23A5 D767 4359 03E4 62BA

To claim this, I am signing this object:

@rmetzler
rmetzler / jquery-mixing-sequential-and-parallel-promises.js
Last active August 29, 2015 14:01
Mixing parallel and sequential promises
var p1 = $.get('https://google.com/').then(function(){
console.log('p1a done');
return $.get('https://google.com/').done(function(){
console.log('p1b done');
});
}).done(function(){
console.log('p1 done');
});
var p2 = $.get('https://google.com/').done(
# Original Rails controller and action
class EmployeesController < ApplicationController
def create
@employee = Employee.new(employee_params)
if @employee.save
redirect_to @employee, notice: "Employee #{@employee.name} created"
else
render :new
end
alert();
@rmetzler
rmetzler / shellshock.diff
Created September 28, 2014 10:09
shellshock fix - remove the whole feature
#shellshock fix. Nuke the whole feature from orbit, it's the only way to be sure. -@andreasdotorg
diff --git a/variables.c b/variables.c
index cdc54bc..1a98efa 100644
--- a/variables.c
+++ b/variables.c
@@ -347,85 +347,25 @@ initialize_shell_variables (env, privmode)
temp_var = (SHELL_VAR *)NULL;
@rmetzler
rmetzler / ruby.yml
Last active August 29, 2015 14:14 — forked from owainlewis/ruby.yml
# Install Ruby
## ===============================================
- name: Install dependencies
apt: name={{ item }} state=latest update_cache=yes
with_items:
- bison
- openssl
- libyaml-dev
- autoconf
@rmetzler
rmetzler / dur.sh
Created February 11, 2015 18:35
your own command suite
function dur {
case $1 in
clone|cl)
git clone git@bitbucket.org:nicolapaolucci/$2.git
;;
move|mv)
git remote add bitbucket git@bitbucket.org:nicolapaolucci/$(basename $(pwd)).git
git push --all bitbucket
;;
trackall|tr)
@rmetzler
rmetzler / template.sh
Created February 18, 2015 13:13
spam templating
echo "{a|1} {error|bug}" | perl -ple 's^{(.*?)}^ @p=split("[|]",$1); $p[rand @p] ^eg'
@rmetzler
rmetzler / build_python.sh
Created April 8, 2015 09:35
Build Python from source on SLES
#!/bin/bash
#
# shamelessly copied from http://stackoverflow.com/a/11371726
#
# Install Python 2.7.2 alternatively
#
zypper install -t pattern sdk_c_c++ -y
zypper install readline-devel openssl-devel gmp-devel ncurses-devel gdbm-devel zlib-devel expat-devel libGL-devel tk tix gcc-c++ libX11-devel glibc-devel bzip2 tar tcl-devel tk-devel pkgconfig tix-devel bzip2-devel sqlite-devel autoconf db4-devel libffi-devel valgrind-devel -y
mkdir tmp
#!/usr/bin/python
"""
Exploit for Samba vulnerabilty (CVE-2015-0240) by sleepya
The exploit only targets vulnerable x86 smbd <3.6.24 which 'creds' is controlled by
ReferentID field of PrimaryName (ServerName). That means '_talloc_zero()'
in libtalloc does not write a value on 'creds' address.
Reference:
- https://securityblog.redhat.com/2015/02/23/samba-vulnerability-cve-2015-0240/