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" ]] && echo "Please specify a .pfx file!" && exit 1; | |
#combined format: | |
openssl pkcs12 -in "$1" -out "${1%.pfx}.key_cert.pem" -nodes | |
#extract certificate/public key | |
openssl x509 -in "${1%.pfx}.key_cert.pem" -out "${1%.pfx}.cert" |
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(); |
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 | |
db="postgres" | |
psql -qAt -c "SELECT tablename FROM pg_tables WHERE schemaname='public';" $db | while read line; do | |
psql -qAt -c "ANALYZE $line;" $db; | |
done |
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 tcpdump -i eth1 -c 100000 -w $(date '+%F_%H-%M-%S').pcap 'tcp port 80' |
OlderNewer