Skip to content

Instantly share code, notes, and snippets.

@tobocop2
tobocop2 / Dockerfile
Last active February 23, 2024 18:57
portable act
# Specify the architecture for the builder stage
FROM --platform=linux/amd64 alpine:latest as builder
# Install Go and other build dependencies
RUN apk add --no-cache go git gcc g++ libc-dev docker-cli
# Set the environment variable for Go
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
@tobocop2
tobocop2 / README.md
Last active March 25, 2021 20:36
Github Audit Script

Usage

./audit.bash <repo name> <org name>

Will output all logs to the current working directory grouped by github workflow id

Will additionally output all of the unique shell commands ran on the affected date range

@tobocop2
tobocop2 / server_cp.sh
Created June 18, 2017 21:47
server_cp
# works best if you configure passwordless ssh by copying your ssh-key to the authorized_keys file on the remote machine
function server_cp()
{
scp $1 user@host
web_home=/path/to/web/home/
filename=`basename $1`
@tobocop2
tobocop2 / slammin.py
Last active January 18, 2016 21:19
slammin' it up 4 realz
import json
import requests
from bs4 import BeautifulSoup
result = {}
url = 'http://www.foopee.com/punk/the-list/by-date.0.html'
res = requests.get(url)
soup = BeautifulSoup(res.text)
@tobocop2
tobocop2 / moreslammin.py
Last active August 29, 2015 14:22
slammin' nyc metal bands
import re
from datetime import datetime
date = 'Fri. Nov. 30th, 2015'
def slammin_sammy(date):
date = re.sub(r"(st|nd|rd|th),", ",", date)
try:
slammin = datetime.strptime(date, '%a. %B. %d, %Y')
except ValueError:
@tobocop2
tobocop2 / birthday.py
Last active August 29, 2015 14:20
Thanks
from config import *
import arrow
import subprocess
import facebook
'''Comment and like all posts'''
def thank_friends():
gist = 'https://gist.github.com/T-G-P/0ff78a80fedde4d0a186'
message = """
Laziness got the best of me so I am having my server send thanks and likes for me.
@tobocop2
tobocop2 / best_wishes.py
Last active November 13, 2016 17:09
Only death is real...
import facebook
import config
import time
import platform
def best_wishes():
'''
This function loads an access token stored in a
text file (these expire so they need to be stored on disk somehow).
It then securly accesses the facebook graph api. Once connected,
import requests
from bs4 import BeautifulSoup
import wget
import os
url = 'http://www.cs.rutgers.edu/~vinodg/teaching/fall-2014-cs416/'
try:
os_dir = 'OS'
os.mkdirs(os_dir)
except OSError: