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
tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000' | |
#CDP packets offer some additional insight to the network you're on: | |
#The information contained in CDP announcements varies by the type of device and the version of the operating system running on it. Information contained includes the operating system version, hostname, every address for every protocol configured on the port where CDP frame is sent eg. IP address, the port identifier from which the announcement was sent, device type and model, duplex setting, VTP domain, native VLAN, power draw (for Power over Ethernet devices), and other device specific information. | |
#You tcpdump output might look something like (IP address XX'd out): | |
#14:42:57.087609 CDPv2, ttl: 180s, checksum: 692 (unverified), length 358 | |
# Device-ID (0x01), length: 11 bytes: 'Public_DMZ' | |
# Address (0x02), length: 13 bytes: IPv4 (1) XXX.XXX.XX.X | |
# Port-ID (0x03), length: 16 bytes: 'FastEthernet0/21' | |
# Capability (0x04), length: 4 bytes: (0x00000028): L2 Switc |
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
psql -h localhost -p 2544 -U admin ccdb | |
SELECT id,name FROM service_instances; | |
DELETE FROM service_instances WHERE id=X; | |
If that fails: | |
SELECT * FROM service_instance_operations WHERE service_instance_id=X; | |
DELETE FROM service_instance_operations WHERE service_instance_id=X; | |
DELETE FROM service_instances WHERE id=X; |
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
sed -n -e '/BEGIN CERTIFICATE/,/END CERTIFICATE/ p' <file> | sed -e 's/^ *//g' | sed -e 's/-----END CERTIFICATE-----/-----END CERTIFICATE-----,./' | tr , '\n' | while read -d $'.' var; do echo "$var" | openssl x509 -text -noout; done | grep "Subject:" |
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 | |
WEB=$(curl -v --silent https://bosh.io/d/stemcells/bosh-azure-hyperv-centos-7-go_agent 2>&1 | grep Location | awk '{print $3}' | cut -d '/' -f 5 | cut -d '-' -f 3) | |
CUR=$(bosh stemcells 2> /dev/null | grep bosh | awk '{print $6}' | tr -d '*') | |
if (( $WEB > $CUR )); then | |
echo "Update stemcell" | |
else | |
echo "Stemcell is fine" | |
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
[ req ] | |
distinguished_name = req_distinguished_name | |
req_extensions = server_req_extensions | |
prompt = no | |
[ req_distinguished_name ] | |
C = <Your country> # Only 2 characters | |
ST = <Your state> # Only 2 characters | |
L = <Your city> | |
O = <Your org> |
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
##### Commands to generate SSL certs/artifcts | |
# Download the temp.cnf file using the wget command below | |
# Edit temp.cnf and add your information | |
# Run the uncommented out commands to generate a self-signed cert (cert.pem) and private key (keyfile.pem) | |
wget https://gist.githubusercontent.com/dwallraff/c1ed31291ac7cf19304b/raw/e06feacbb85ac63659e6c1c40c70d5481522b390/temp.cnf | |
# Generate a new keyfile. A 2048 bit key size is TOTALLY fine. Jack it up to 4096 and wait if you must... | |
openssl genrsa -out keyfile.key 2048 |
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-get install apache2-utils | |
# ab -n <num_requests> -c <concurrency> <addr>:<port><path> | |
ab -n 1000 -c 100 http://localhost:4567/ |
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
azure vm list-usage <region> |
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
http://boshartifacts.cloudfoundry.org/file_collections?type=stemcells |
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
http://boshartifacts.cloudfoundry.org/file_collections?type=releases |