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 | |
# I wanted a script to pull secrets from 1Password and use them | |
# to perform a backup with restic. Putting this up as an example | |
# in case it's useful to other people. This script expects a | |
# file in your $HOME named .restic_excludes.txt which will | |
# allow you to list paths you want to skip | |
export AWS_ACCESS_KEY_ID="op://vault/AWS S3/username" # AWS IAM Cred from 1Password | |
export AWS_SECRET_ACCESS_KEY="op://vault/AWS S3/credential" # AWS IAM Cred from 1Password |
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
from rich import print | |
import pathlib | |
import hashlib | |
import pprint | |
# Simple script to hash a diretory and it's subdirectories to see if there are any dupes | |
# Here's an example awk to take the output report and get the first match in each of the duplicate files found | |
# | |
# awk '/hash matched/ { getline ; print $0 }' |
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 time | |
import logging | |
from functools import wraps | |
def retry_errors(exceptions, timeout=300, wait_time=10): | |
"""Catch exceptions and retry until the timeout is reached. | |
exceptions: An Exception object or tuple of exception objects. | |
timeout: Integer, defaults to 300 seconds. Time to attempt call before failing. |
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
""" | |
I order https://www.amazon.com/Zeiss-Pre-Moistened-Cleaning-Wipes-count/dp/B01E9NC2Z4/ref=sr_1_3_a_it?ie=UTF8&qid=1544464237&sr=8-3&keywords=zeiss+wipes | |
from Amazon pretty regularly. | |
The packets come with 2 attached together. When I pull one out that's still 2 | |
attached, I tear off one of them to use and put the other back in the box. | |
I wanted to know how many times I have to pull a packet from the box before | |
I am more likely to pull a single packet instead of a double. | |
An example of how to run this is |
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
########################################################## | |
# Question 1 # | |
########################################################## | |
# What will the output of the following be? | |
for x in $(seq 1 10);do | |
echo $x; | |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$attacker_script = <<SCRIPT | |
# Add "firewall" as the default gateway | |
route add default gw 192.168.102.10 | |
# Make the above step persist across reboots | |
echo " gateway 192.168.102.10" >> /etc/network/interfaces | |
SCRIPT |
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
### Keybase proof | |
I hereby claim: | |
* I am gekitsuu on github. | |
* I am gekitsuu (https://keybase.io/gekitsuu) on keybase. | |
* I have a public key whose fingerprint is ABA4 1406 510C EA49 1E3B 20DF 7D33 A1FE F23C D61E | |
To claim this, I am signing this object: |
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 | |
# Author: Adam Glenn | |
# Email : gekitsuu@gmail.com | |
# | |
# To update this Gist run | |
# gist --login # if not already logged in | |
# gist -u e3dd4378878c1e7ec7f62e2d04d50884 ./setup_my_mac.sh | |
install_homebrew(){ |
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
from gevent import monkey | |
from libcloud.compute.deployment import MultiStepDeployment | |
from libcloud.compute.deployment import ScriptDeployment | |
from libcloud.compute.deployment import SSHKeyDeployment | |
import gevent | |
import json | |
import libcloud.security | |
import libcloud.compute.providers | |
import libcloud.compute.types |