This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect #Where the script should be run from. | |
# Copied from http://osix.net/modules/article/?id=30 | |
#If it all goes pear shaped the script will timeout after 20 seconds. | |
set timeout 20 | |
#First argument is assigned to the variable name | |
set name [lindex $argv 0] | |
#Second argument is assigned to the variable user | |
set user [lindex $argv 1] | |
#Third argument is assigned to the variable password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
if [[ "$#" -eq 1 ]] && [[ -r "$1" ]]; then | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
echo "$line" | python -m json.tool | |
done < "$1" | |
else | |
echo "jsonview.sh" | |
echo "Usage: jsonview.sh <jsonfile>" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbstractRouter(object): | |
""" | |
A router to control all database operations on models in the | |
application. | |
""" | |
def __init__(self, app, schema): | |
self.app = app | |
self.schema = schema | |
def db_for_read(self, model, **hints): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install build-essential pyqt4-dev-tools libusb-dev libjack-dev libbluetooth-dev python-dbus | |
# add "#include <unistd.h>" to shared.h | |
# vim sixad/shared.h | |
# make | |
# sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to filter mac from OCS exported file and prints | |
# OFFICESCAN exported file without mac matched lines | |
# Need csvkit installed: pip install csvkit | |
set -e | |
OFFICESCAN="OfficeScan agent listing.csv" | |
OCS="export.csv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""A simple python script template. | |
""" | |
from __future__ import print_function | |
import os | |
import sys | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Ask Switches | |
Usage: | |
ask-switches.py <csvfile> [-u <user>] [-p <password>] [-o <output_file>] | |
ask-switches.py -h | --help | |
Identify enabled|disabled vlan authorization and disabled radius fe*.* ports | |
Arguments: | |
<csvfile> NetSight auto export csv file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# system_page - A script to produce an system information HTML file | |
##### Constants | |
TITLE="System Information for $HOSTNAME" | |
RIGHT_NOW=$(date +"%x %r %Z") | |
TIME_STAMP="Updated on $RIGHT_NOW by $USER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Check differences between ldap master and slave(s) searches. | |
#Change the `LDAPMASTER` and `BASEDN` variables suitting to your environment. | |
#Tested on CentOS. | |
LDAPMASTER="ldapmaster_ip" | |
LDAPSLAVES=$(host ldap | gawk -F' ' '{print $4}') | |
BASEDN="ou=Users,dc=DomainComponent,dc=DistinguishedName" | |
ARGS="(&(uid=${1}))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
# set -o xtrace | |
# Set magic variables for current file & dir | |
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
OlderNewer