Skip to content

Instantly share code, notes, and snippets.

@nilya
nilya / detect_unsafe_aws_sg.sh
Created September 13, 2013 12:32
Script finds AWS Security Groups (SG) with potentially unsafe rules and lists instances that use such security groups.
#!/bin/sh
# Script finds AWS Security Groups with potentially unsafe rules and lists instances that use such security groups.
#
# Unsafe security group rules are:
# 1. open to the world (0.0.0.0/0),
# 2. not restricted to another security group,
# 3. not use safe ports (22,80,443; you can set SAFE_PORTS environment variable to override).
#
# To run this script:
@nilya
nilya / wave_gadget_stub.js
Created April 8, 2013 11:36
Helper script, allows to debug gadget locally without setting up a proper environment (gadget container, etc.). Include this script into your HTML-file with gadget code. More info at https://rizzoma.com/!/ec233aca0354f039c71c3e38bb5a3c696cc7bd/2J
var Participant = function(id, name, avatar) {
this.getId = function() {
return id;
};
this.getDisplayName = function() {
return name;
};
this.getThumbnailUrl = function() {
return avatar;
};
@nilya
nilya / gist:4380689
Created December 26, 2012 14:44
"vgaswitch" script to turn on/off discrete videocard under Linux.
#!/bin/bash
# Place this file under /usr/local/bin/vgaswitch
# load module (without this module "vgaswitcheroo" isn't available on my system)
modprobe radeon
# switch
SWITCH=/sys/kernel/debug/vgaswitcheroo/switch
if [ $# -eq 1 ]; then
if [ "$1" == "low" ]; then