Skip to content

Instantly share code, notes, and snippets.

@vivekdurai
vivekdurai / savetheinternetbuttons
Last active August 29, 2015 14:19
Save the Internet buttons for your website
<style>
@import url('//fonts.googleapis.com/css?family=Noto+Sans:400,700');
/* The ribbons */
.corner-ribbon{
width: 200px;
background: #e43;
position: absolute;
@vivekdurai
vivekdurai / patch_shellshock
Last active August 29, 2015 14:06
Steps to patch OS X for 'shellshock' bash vulnerability
As posted on http://apple.stackexchange.com/questions/146849/how-do-i-recompile-bash-to-avoid-the-remote-exploit-cve-2014-6271-and-cve-2014-7/146851#146851 by http://apple.stackexchange.com/users/1573/alblue
$ mkdir bash-fix
$ cd bash-fix
$ curl https://opensource.apple.com/tarballs/bash/bash-92.tar.gz | tar zxf -
$ cd bash-92/bash-3.2
$ curl https://ftp.gnu.org/pub/gnu/bash/bash-3.2-patches/bash32-052 | patch -p0
$ cd ..
$ xcodebuild
$ sudo cp /bin/bash /bin/bash.old
@vivekdurai
vivekdurai / views.py
Created May 30, 2012 12:19
Server Side (Django) Juggernaut Style Websockets
from django.contrib.sessions.models import Session
from django.contrib.auth import get_user
from django.contrib.auth.models import User
from juggernaut import Juggernaut
jug = Juggernaut()
def get_current_sessions(uid):
class Dummy(object): pass
django_request = Dummy()
s = Session.objects.all()