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/local/bin/python | |
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
k = 3 | |
team_size = 10 | |
new_team = [] |
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
import random | |
import numpy | |
managers = [ | |
'amit', | |
'andrew', | |
'harry' , | |
'jason', | |
'ryan', | |
'mike', |
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 (OSX) - Mount a remote servers directory locally to my workstation on /mnt/test/ | |
# name_of_this_script remote_server.com:/var/cache /mnt/test | |
user=$(whoami) | |
ssh_identity_file="/Users/${user}/.ssh/id_rsa" | |
remote_host_and_path="${1}" | |
mount_locally="${2}" |
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
docker create \ | |
--name pihole \ | |
-p 53:53/tcp -p 53:53/udp -p 80:80 \ | |
-v "/data/.docker_config/pihole/:/etc/pihole/" \ | |
-v "/data/.docker_config/dnsmasq.d/:/etc/dnsmasq.d/" \ | |
-e ServerIP="192.168.86.111" \ | |
-e --cap-add=NET_ADMIN \ | |
-e --dns=127.0.0.1 --dns=1.1.1.1 \ | |
-e WEBPASSWORD=xxxx \ | |
-e TZ=America/New_York \ |
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
DISPLAY=:0 chromium-browser --noerrdialogs --kiosk \ | |
'https://d' \ | |
'https://b' \ | |
'https://a' | |
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 | |
# ec2 metadata | |
instance_document=$(curl -s 'http://169.254.169.254/latest/dynamic/instance-identity/document') | |
instance_id=$(echo ${instance_document} | jq -r .instanceId) | |
instance_region=$(echo ${instance_document} | jq -r .region) | |
# AWS COMMAND | |
AWS_BIN="$(which aws) --region ${instance_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
INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
AWS_AZ=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone) | |
AWS_REGION="${AWS_AZ::-1}" | |
AWS_CMD="aws --region ${AWS_REGION} --output json" |
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
# need ruby version for 2.4.2 for i2cssh at the time I wrote this | |
# install | |
brew upgrade rbenv ruby-build | |
# setup ebenv | |
rbenv install 2.4.2 | |
rbenv global 2.4.2 | |
rbenv rehash |
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
# Get some info on cert (SAN cert details like DNS, etc..) | |
nmap --script ssl-cert -p 443 some.com | |
# Get ciphers available | |
nmap --script ssl-enum-ciphers -p 443 some.com | |
# Get info on cert file | |
openssl x509 -in some.crt -text -noout | |
# Verify key matches cert by seeing if modulus matches between the two |
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
# install fish | |
brew update && brew install fish | |
# plugin manager | |
https://github.com/fisherman/fisherman | |
# run bash in fish | |
# powerline bobthefish (git plugin) |
NewerOlder