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/perl -w | |
# William Lam | |
# 12/10/2009 | |
# http://engineering.ucsb.edu/~duonglt/vmware/ | |
# http://communities.vmware.com/docs/DOC-9852 | |
use strict; | |
use warnings; | |
use IO::Socket::SSL; | |
use Term::ANSIColor; |
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
use strict; | |
use warnings; | |
open INPUT, "./robtest.txt"; | |
while(<INPUT) { | |
chomp; | |
print "line: '$_'\n"; | |
} |
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 | |
# put new bonded configuration in interfaces.bonded and cd into /etc/network | |
ifdown -a; mv interfaces interfaces.old; mv interfaces.new interfaces; ifup lo; ifup bond0 & ifup eth0; ifup eth1; |
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 | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options | |
This script set ownership for all table, sequence and views for a given database | |
Credit: Based on http://stackoverflow.com/a/2686185/305019 by Alex Soto |
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 | |
[[ -z "$1" || -z "$2" ]] && echo "Please specify a certificate and keyfile (in that order)" && exit 1; | |
diff -sq <(openssl x509 -noout -modulus -in "$1" | openssl md5) <(openssl rsa -noout -modulus -in "$2" | openssl md5) > /dev/null; | |
[[ $? == 0 ]] && echo "Keys Match" || echo "Keys do NOT Match"; |
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
APT | |
{ | |
Install-Recommends "false"; | |
Install-Suggests "false"; | |
} | |
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 | |
if [[ ! -e "$1" ]] || [[ ! -e "$2" ]]; then | |
echo -e "Please specify files that exist:"; | |
echo -e "\tFor example: $0 fileOne fileTwo\n"; | |
exit 1; | |
fi | |
echo "Swapping Files: $1 $2"; | |
mv "$1" ".tmp.$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/perl | |
$svr="localhost"; | |
$dbname="rob"; | |
for $x (1..10) { | |
open(CMD, " | psql -h $svr $dbname"); | |
print CMD <<END; | |
BEGIN TRANSACTION; | |
INSERT INTO insert_log ("when") VALUES(NOW()); |
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
openssl speed md5 sha1 sha256 sha512 des des-ede3 aes-128-cbc aes-192-cbc aes-256-cbc rsa2048 dsa2048 |
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
$connectionString = "Data Source=cidbsql.cwserverfarm.local;Initial Catalog=workdb;Integrated Security=True;Application Name=PowerSheQL"; | |
$SQL = "SELECT TOP 5 * FROM dbo.RE_Trace;"; | |
$dbc = New-Object System.Data.SqlClient.SqlConnection($connectionString); | |
$dbc.Open(); | |
$sqlcmd = $dbc.CreateCommand(); | |
$sqlcmd.CommandTimeout = 1; | |
$sqlcmd.CommandText = $SQL; | |
$sqlcmd.Prepare(); |
OlderNewer