Skip to content

Instantly share code, notes, and snippets.

View omar-yassin's full-sized avatar

Omar Yassin omar-yassin

View GitHub Profile
#!/usr/local/bin/python
arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
k = 3
team_size = 10
new_team = []
@omar-yassin
omar-yassin / gist:1bde00b5d7d8f12257cd866539daa4f7
Last active August 27, 2019 14:21
Fantasy Football Division Generator + Draft Orderer
import random
import numpy
managers = [
'amit',
'andrew',
'harry' ,
'jason',
'ryan',
'mike',
#!/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}"
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 \
@omar-yassin
omar-yassin / gist:1ea5f7a9d6a0fd0079f230deb8e1eec6
Created January 24, 2019 15:07
raspbian chromium notepad
DISPLAY=:0 chromium-browser --noerrdialogs --kiosk \
'https://d' \
'https://b' \
'https://a'
@omar-yassin
omar-yassin / gist:5689d8a2f2fbe935330f9c8bafcfbcf8
Created December 20, 2018 21:33
expand ebs and xfs filesystem
#!/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}"
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"
# 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
# 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
# install fish
brew update && brew install fish
# plugin manager
https://github.com/fisherman/fisherman
# run bash in fish
# powerline bobthefish (git plugin)