Skip to content

Instantly share code, notes, and snippets.

View shibz's full-sized avatar

Shibz shibz

  • Denver CO
View GitHub Profile
@shibz
shibz / python_resources.md
Last active February 8, 2016 01:51 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides

@shibz
shibz / get_asg_peers.py
Last active February 8, 2016 02:11
Python / Boto - Get Autoscaling Group Peers
import boto.ec2.autoscale
import boto.ec2
region = "us-east-1"
instance = "i-d5ba2255"
asc = boto.ec2.autoscale.connect_to_region(region)
asi = asc.get_all_autoscaling_instances(instance_ids=[instance])
if len(asi):
# From http://blog.mattvogt.net/2013/02/08/vms-grayed-out-after-nfs-datastore-restored/
#Get Inaccessible Virtual Machines
$VMs = Get-View -ViewType VirtualMachine | ?{$_.Runtime.ConnectionState -eq "invalid" -or $_.Runtime.ConnectionState -eq "inaccessible"} | select name,@{Name="GuestConnectionState";E={$_.Runtime.ConnectionState}}
write-host "---------------------------"
Write-host "Inaccessible VMs"
write-host "---------------------------"
$VMs
@shibz
shibz / stage0-installing-epel.sh
Last active December 16, 2015 21:58 — forked from premist/stage0-change-mirror-to-korean.sh
Just some notes on my own installation of GitLab on Scientific Linux 6.4
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
@shibz
shibz / gist:5195903
Created March 19, 2013 12:59
Patch to disable Guacamole authentication and allow users to connect to any host without needing it to be whitelisted in the configuration file.
diff -Naur guacamole-0.6.2/src/main/java/net/sourceforge/guacamole/net/basic/AuthenticatingHttpServlet.java guacamole-0.6.2-mod/src/main/java/net/sourceforge/guacamole/net/basic/AuthenticatingHttpServlet.java
--- guacamole-0.6.2/src/main/java/net/sourceforge/guacamole/net/basic/AuthenticatingHttpServlet.java 2012-10-16 21:21:38.000000000 -0400
+++ guacamole-0.6.2-mod/src/main/java/net/sourceforge/guacamole/net/basic/AuthenticatingHttpServlet.java 2012-10-24 11:55:50.156924252 -0400
@@ -173,93 +173,18 @@
HttpSession httpSession = request.getSession(true);
// Try to get configs from session
- Map<String, GuacamoleConfiguration> configs = getConfigurations(httpSession);
-
- // If no configs, try to authenticate the user to get the configs using
@shibz
shibz / cron_serial.py
Created March 5, 2013 23:04
Custom command for django-cronograph. Quick and dirty fix for multithreading issues. Just drop into chronograph/management/commands
from django.core.management.base import BaseCommand
import logging
import os
import sys
import time
logger = logging.getLogger('chronograph.commands.cron_serial')
class Command(BaseCommand):