Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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
#
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/opt/soft/modules/lib/libxml2/2.9.2-goolf-1.7.20.lua:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
help([[Libxml2 is the XML C parser and
toolchain developed for the Gnome project
(but usable outside of the Gnome platform). - Homepage: http://xmlsoft.org/]])
whatis("Name: libxml2")
whatis("Version: 2.9.2")
whatis("Description: Libxml2 is the
@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
@verdurin
verdurin / gist:053b9ba8b590fa2ec083
Created October 15, 2015 10:43 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.node.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@verdurin
verdurin / config.log
Created December 5, 2015 08:48
EasyBuild GCC/4.9.3-binutils-2.25 config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by fixincludes configure , which was
generated by GNU Autoconf 2.64. Invocation command line was
$ /home/adam/.local/easybuild/build/GCC/4.9.3/dummy--binutils-2.25/gcc-4.9.3/fixincludes/configure --cache-file=./config.cache --enable-lto --enable-checking=release --disable-multilib --enable-shared=yes --enable-static=yes --enable-threads=posix --enable-gold=default --enable-plugins --enable-ld --with-plugin-ld=ld.gold --enable-bootstrap --prefix=/home/adam/.local/easybuild/software/GCC/4.9.3-binutils-2.25 --with-local-prefix=/home/adam/.local/easybuild/software/GCC/4.9.3-binutils-2.25 --enable-languages=c,c++,fortran,lto --program-transform-name=s,y,y, --disable-option-checking --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu --srcdir=../../fixincludes
## --------- ##
## Platform. ##