Skip to content

Instantly share code, notes, and snippets.

@verdurin
verdurin / gist:2883422
Created June 6, 2012 17:27
Check LinkedIn password hash dump (combo_not.txt) for a particular string
"""
Save this file as linkedin_hash.py and ensure it's
in the same folder as combo_not.txt
Usage: python linkedin_hash.py hunter2
"""
from hashlib import sha1
import sys
# Name: EXIFmover.py
# Author: Brian Klug (@nerdtalker / brian@brianklug.org)
# Purpose:
# Move Files into directory based on EXIF data make and model
# Designed to un-clusterfuck the Dropbox camera upload directory which is a mess of every
# JPEG and PNG ever if you use it like I do on a bunch of phones, and thus totally unwieldy
# and full of images sorted by date or else nothing sometimes, dropbox seems nondeterminstic
# Moves files into /[Image Make]+[Image Model]/ eg /Camera Uploads/LGE Nexus 4/
#!/bin/sh
# Warranty request script for Dell PCs
# Written by Adam Nielsen <adam.nielsen@uq.edu.au>
# This code is in the public domain, and is supplied with no warranty.
#
# This script uses Dell's web service to retrieve the most distant warranty expiration
# date for a given machine, as identified by its service tag. It requires curl and awk.
# It doesn't parse the WSDL or anything nice like that, it just sends a precomposed
# request to the server and extracts the relevant info from the response.
#!/bin/bash
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
# Directory where everything happens
DIR=~/work/virt-install
# The image downloaded from the http://fedoraproject.org/en/get-fedora#clouds site
@verdurin
verdurin / ganglia-openstack.sh
Created March 13, 2014 11:33
Run OpenStack checks and send the output to Ganglia
#!/bin/bash
# Script to check some OpenStack values
. /root/keystonerc_admin
INSTANCES_ERROR=$(nova list --all-tenants|grep ERROR|wc -l)
INSTANCES_ACTIVE=$(nova list --all-tenants |grep ACTIVE|wc -l)
INSTANCES_BUILD=$(nova list --all-tenants |grep BUILD|wc -l)
INSTANCES_SHUTOFF=$(nova list --all-tenants |grep SHUTOFF|wc -l)
@verdurin
verdurin / check_openstack.cfg
Created March 13, 2014 11:55
In Nagios define a service that checks whether some OpenStack values exceed given thresholds
define service {
use default-service
service_description INSTANCES ERROR
servicegroups cloud
check_command check_with_gmond!instances_error!5!10
notification_options c,w,f,s,r
host_name host.to.be.checked
normal_check_interval 30
}
@verdurin
verdurin / delete.sh
Last active August 29, 2015 14:07 — forked from arxcruz/delete.sh
Delete zombie instances from the OpenStack database
#!/bin/bash
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@verdurin
verdurin / deletesparecindervols.sh
Created July 20, 2015 08:16
One-liner to delete unused Cinder volumes in OpenStack
for vol in $(cinder list --status available | tail -n +4 | awk '{ print $2 }'); do cinder delete $vol; done
@verdurin
verdurin / tcltk-directory-listing.txt
Created August 14, 2015 13:42
/srv/data/sw/eb/software/R/3.2.0-goolf-1.7.20/lib64/R/library/tcltk
[operations@snap-boot-test-2 easybuild-easyconfigs]$ ls -lR /srv/data/sw/eb/software/R/3.2.0-goolf-1.7.20/lib64/R/library/tcltk
/srv/data/sw/eb/software/R/3.2.0-goolf-1.7.20/lib64/R/library/tcltk:
total 24
-rw-r--r--. 1 operations operations 317 Aug 12 15:09 DESCRIPTION
-rw-r--r--. 1 operations operations 626 Aug 12 15:09 INDEX
drwxr-xr-x. 2 operations operations 4096 Aug 12 15:09 Meta
-rw-r--r--. 1 operations operations 980 Aug 12 15:09 NAMESPACE
drwxr-xr-x. 2 operations operations 26 Aug 12 15:09 R
drwxr-xr-x. 2 operations operations 91 Aug 12 15:09 demo
drwxr-xr-x. 2 operations operations 4096 Aug 12 15:09 exec
@verdurin
verdurin / dynmotd
Last active August 29, 2015 14:27 — forked from cha55son/dynmotd
RHEL (Centos/Fedora) dynamic motd
#!/bin/bash
# Installation:
#
# 1. vim /etc/ssh/sshd_config
# PrintMotd no
#
# 2. vim /etc/pam.d/login
# # session optional pam_motd.so
#