Skip to content

Instantly share code, notes, and snippets.

View sbussetti's full-sized avatar

Steve Bussetti sbussetti

  • New Jersey, USA
View GitHub Profile
@sbussetti
sbussetti / shieldsmasher.sh
Last active May 2, 2018 19:09
shieldsmasher
#!/usr/bin/env bash
MAX_PROCS=${1:-10};
ispinner () {
i=1
sp="/-\|"
while true; do
echo -en "\033[0;0f"
printf "\b${sp:i++%${#sp}:1}"
@sbussetti
sbussetti / postgres_queries_and_commands.sql
Last active February 22, 2018 14:48 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- All commands assume 9.2 +
-- show running queries
SELECT pid, age(query_start, clock_timestamp()), state, waiting, usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>'
AND query NOT ILIKE '%pg_stat_activity%'
AND state != 'idle'
ORDER BY query_start desc;
@sbussetti
sbussetti / options.py
Last active December 14, 2015 20:06
InheritedModelAdmin - model admin that redirects all requests to "subclass_model" attribute.
from functools import update_wrapper
from django.conf.urls import patterns, url
from django.contrib import admin
class BounceDetailedAdmin(admin.ModelAdmin):
subclass_model = None
def get_model_perms(self, request):