Skip to content

Instantly share code, notes, and snippets.

@mttaggart
mttaggart / electron-versions.csv
Last active August 27, 2024 23:34
CVE-2023-4863 Electron App Tracker | THIS LIST IS NOW DEPRECATED. PLEASE VISIT https://github.com/mttaggart/electron-app-tracker FOR THE LATEST DATA
app_name repo electron_version vulnerable
1Clipboard https://github.com/wiziple/1clipboard
1Password None 25.8.1 FALSE
3CX Desktop App 19.0.8 TRUE
5EClient None
Abstract None
Account Surfer None
Advanced REST Client https://github.com/advanced-rest-client/arc-electron ^17.0.0 TRUE
Aedron Shrine None
Aeon https://github.com/leinelissen/aeon 23.2.0 TRUE
@haron
haron / tmstatus.py
Last active September 30, 2023 20:11
Command line tool to show Time Machine backup progress in a human-readable form (Python 3.8+)
#!/usr/bin/env python
import plistlib
import subprocess
res = subprocess.run("tmutil status -X", shell=True, capture_output=True).stdout
data = plistlib.loads(res)
if running := data["Running"]:
print("Backup is running")
print("Progress: %s%%" % (round(data.get("Progress", {}).get("Percent", -1) * 100, 2)))
print("BackupPhase:", data["BackupPhase"])
@drmalex07
drmalex07 / README-flyway-migration-from-docker.md
Last active February 14, 2023 12:36
Run flyway migration from a Docker container. #flyway

README - Run a Flyway migration from a Docker container

See also: https://flywaydb.org/documentation/configuration/configfile

Prepare basic Flyway configuration (no sensitive data inside), say at config/flyway.conf:

# vim: set syntax=jproperties:
# See https://flywaydb.org/documentation/configuration/configfile
flyway.schemas = foo
flyway.defaultSchema = foo
@JujuDel
JujuDel / coinMarketCapRTD.py
Last active January 24, 2022 10:30
Using python, get real time crypto prices and conversion rates in excel
from pyxll import xl_func, RTD
import threading
import time
import requests
from bs4 import BeautifulSoup
'''
Date: 19-April-2021
coin_rtd(crypto: str):
@jamesmacfie
jamesmacfie / README.md
Created October 22, 2019 02:53
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@datacharmer
datacharmer / clone.sh
Last active August 13, 2019 10:34
test MySQL 8.0.17 CLONE
#!/bin/bash
set -x
dbdeployer deploy single 5.7.26 --master --sandbox-directory=master_5_7_26 --port=18000 --db-password=different --db-user=different
dbdeployer deploy single 8.0.17 --master --sandbox-directory=master_8_0_17 --port=18001 --db-password=different --db-user=different
dbdeployer deploy single 8.0.17 --master --sandbox-directory=slave_8_0_17 --port=18002
~/sandboxes/master_5_7_26/use -t < fill.sql
du -sh ~/sandboxes/*/data
def page_scrape():
"""This function takes care of the scraping part"""
xp_sections = '//*[@class="section duration"]'
sections = driver.find_elements_by_xpath(xp_sections)
sections_list = [value.text for value in sections]
section_a_list = sections_list[::2] # This is to separate the two flights
section_b_list = sections_list[1::2] # This is to separate the two flights
# if you run into a reCaptcha, you might want to do something about it
@ahadsheriff
ahadsheriff / mapper_tutorial.py
Created March 28, 2019 21:28
Crawl and scrape URLs to map a website
from bs4 import BeautifulSoup
import requests
import requests.exceptions
from urllib.parse import urlsplit
from urllib.parse import urlparse
from collections import deque
import re
url = "https://scrapethissite.com"
# a queue of urls to be crawled
@FradSer
FradSer / iterm2_switch_automatic.md
Last active April 6, 2025 09:19
Switch iTerm2 color preset automatic base on macOS dark mode.

The latest beta (3.5) includes separate color settings for light & dark mode. Toggling dark mode automatically switches colors.

Vist iTerm2 homepage or use brew install iterm2-beta to download the beta. Thanks @stefanwascoding.


  1. Add switch_automatic.py to ~/Library/ApplicationSupport/iTerm2/Scripts/AutoLaunch with:
@hobbsh
hobbsh / redshift_unload_wrapper.sh
Last active November 29, 2019 17:54
Wrapper for redshift_unload_copy.py to unload/copy multiple tables in a loop
#!/bin/bash
# Wylie Hobbs - 2018
# Copy multiple tables at once with redshift unload-copy utility
# Usage: ./redshift_unload_wrapper.sh
# Requires a clone of amazon-redshift-utils and the packages: jq, awscli
# Create redshift_unload_wrapper.sh, tables.txt and config.json in src/UnloadCopyUtility and run this script
#tables.txt is newline delimited list of tables in SCHEMA.TABLE notation
TABLES=$(cat tables.txt)