Skip to content

Instantly share code, notes, and snippets.

@Makeshift
Makeshift / s3-delete_noncurrent_versions.py
Created April 2, 2023 00:06
A script that deletes all noncurrent versions of files and delete markers in an S3 bucket
#!/usr/bin/env python3
# This script adapted from https://wasabi-support.zendesk.com/hc/en-us/articles/360058028992-How-do-I-mass-delete-non-current-versions-inside-a-bucket-
# This script is used to delete non-current versions of objects in a bucket. It will not delete the current version of an object.
# I also implemented refreshable sessions from here https://stackoverflow.com/a/69226170
"""
This scripts first argument must be an S3 URI (s3://bucket-name/<optional path>) from where to begin searching for noncurrent versions.
It will enumerate all objects under that prefix and delete all noncurrent versions.
Credentials are gathered automatically from the environment.
Wrap this script with aws-vault if that's how you get your credentials.
@wzyboy
wzyboy / amortize_over.py
Last active March 20, 2024 16:29 — forked from cdjk/amortize_over.py
amortize_over beancount plugin
# Copyright (c) 2017 Cary Kempston
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
Requirements:
============
I'm not even sure all the requirements, I might miss some of them.
* GNU date from Homebrew
* curl and xmllint - might be part of base MacOS install, or might be XCode. Dunno.
Put both scripts in the same directory - I use the "bin" subdir under my homedir. Call the "zwift" script.
Ride On!
@ivy
ivy / chasepdf2csv
Last active March 22, 2024 20:47
Convert Chase credit card statements from PDF to CSV. Useful for importing old transactions into QuickBooks Online/Self-Employed.
#!/usr/bin/env ruby
# chasepdf2csv -- Convert Chase credit card statements from PDF to CSV. Written
# to easily import older statements into QuickBooks Online/Self-Employed. Chase
# unfortunately only offers statements up to 6 months in the past, making it a
# huge chore to synchronize past transactions.
#
# How to Use
# ----------
# This script requires Ruby >2.0.0 and pdftotext. Copy this script somewhere and
# make it executable. Run it like any other command.
@mzhukovs
mzhukovs / Chase_BankStatement_Checking_PDF_Parser.py
Created September 8, 2018 13:07
Python Script to Scrape Transaction Records from Chase Bank Checking Account Statement PDFs
import os
import argparse
import re
import csv
from datetime import datetime as dt
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.converter import PDFPageAggregator
from pdfminer.layout import LTPage, LTChar, LTAnno, LAParams, LTTextBox, LTTextLine
from pdfminer.pdfpage import PDFPage
@eirikb
eirikb / clicktest.md
Last active April 9, 2021 16:49
Automated click testing in bash

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies

@ismaelgaudioso
ismaelgaudioso / discovery-test.py
Last active May 4, 2022 07:52 — forked from provegard/ssdp-test.py
Small SSDP server/client test in Python
import socket
import struct
import sys
from httplib import HTTPResponse
from BaseHTTPServer import BaseHTTPRequestHandler
from StringIO import StringIO
import gtk
import gobject
@deckar01
deckar01 / transcend_wifi_sd_channel_config_root.md
Last active May 3, 2024 20:28
Rooting the Transcend WiFi SD card by injecting commands into the wifi channel config

Other languages:

Rooting the Transcend WiFi SD card

by injecting commands into the wifi channel config

sd

This exploit requires opening the "Files" page of the card's web interface and escaping to the root of the file system.

public static boolean setProxy(WebView webview, String host, int port, String applicationClassName="android.app.Application") {
// 3.2 (HC) or lower
if (Build.VERSION.SDK_INT <= 13) {
return setProxyUpToHC(webview, host, port);
}
// ICS: 4.0
else if (Build.VERSION.SDK_INT <= 15) {
return setProxyICS(webview, host, port);
}
// 4.1-4.3 (JB)
@wbroek
wbroek / genymotionwithplay.txt
Last active August 12, 2024 07:34
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)