Skip to content

Instantly share code, notes, and snippets.

View micksmix's full-sized avatar

Mick micksmix

  • MongoDB
  • Seattle, WA
View GitHub Profile
@micksmix
micksmix / gist:8528e11265d84377dae351dd6b54d92d
Created July 23, 2018 21:11
Recommend CSP - Chrome/FF Bookmark
javascript:function%20getElements%28tags%29%7Bvar%20arr%3D%5B%5D%3Btags%3Dtags.split%28%22%2C%22%29%3Bfor%28var%20i%3D0%3Bi%3Ctags.length%3Bi%2B%2B%29%7Bvar%20elems%3Ddocument.getElementsByTagName%28tags%5Bi%5D%29%3Bfor%28var%20j%3D0%3Bj%3Celems.length%3Bj%2B%2B%29arr.push%28elems%5Bj%5D%29%7D%0Areturn%20arr%3B%7D%0Afunction%20parseUri%28str%29%7Bvar%20o%3DparseUri.options%2Cm%3Do.parser%5Bo.strictMode%3F%22strict%22%3A%22loose%22%5D.exec%28str%29%2Curi%3D%7B%7D%2Ci%3D14%3Bwhile%28i--%29uri%5Bo.key%5Bi%5D%5D%3Dm%5Bi%5D%7C%7C%22%22%3Buri%5Bo.q.name%5D%3D%7B%7D%3Buri%5Bo.key%5B12%5D%5D.replace%28o.q.parser%2Cfunction%28%240%2C%241%2C%242%29%7Bif%28%241%29uri%5Bo.q.name%5D%5B%241%5D%3D%242%3B%7D%29%3Breturn%20uri%3B%7D%3BparseUri.options%3D%7BstrictMode%3Afalse%2Ckey%3A%5B%22source%22%2C%22protocol%22%2C%22authority%22%2C%22userInfo%22%2C%22user%22%2C%22password%22%2C%22host%22%2C%22port%22%2C%22relative%22%2C%22path%22%2C%22directory%22%2C%22file%22%2C%22query%22%2C%22anchor%22%5D%2Cq%3A%7Bname%3A%22queryKey%22
@micksmix
micksmix / ag-replace.bat
Created November 13, 2018 07:03
ag-replace on Windows (with gnu on windows tools installed)
echo off
set arg1=%1
set arg2=%2
ag -0 -l %arg1% | xargs -0 sed -ri.bak -e "s/%arg1%/%arg2%/g"
@micksmix
micksmix / clrtmp.bat
Created November 13, 2018 07:05
Batch file to clear out temp files on Windows
REM clrtmp.bat
@echo off
del "%TEMP%\*.*" /s /f /q
for /d %%d in (%TEMP%\*) do rmdir "%%d" /s /q
del "%WINDIR%\TEMP\*.*" /s /f /q
for /d %%d in (%WINDIR%\TEMP\*) do rmdir "%%d" /s /q
@micksmix
micksmix / runchrome.sh
Last active February 4, 2020 04:35
chromium-launch
#!/usr/bin/env bash
chromium --no-sandbox --password-store=basic --user-data-dir=~/.config/chromium -ignore-certificate-errors  --disable-xss-auditor  --no-default-browser-check  --no-first-run  --disable-background-networking  --disable-client-side-phishing-detection  --disable-component-update  --disable-sync  --disable-translate  --disable-web-resources  --safebrowsing-disable-auto-update  --safebrowsing-disable-download-protection &
#alias chromeburp='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --no-sandbox --password-store=basic --ignore-certificate-errors --disable-xss-auditor --no-default-browser-check --no-first-run --disable-background-networking --disable-client-side-phishing-detection --disable-component-update --disable-sync --disable-translate --disable-web-resources --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection &'
@micksmix
micksmix / burp-random
Last active December 31, 2019 01:46
random Burp setup and plugin information
# Get Firefox Developer Edition
```
wget --content-disposition "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=osx&lang=en-US"
wget --content-disposition "https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-US"
wget --content-disposition "https://download.mozilla.org/?product=firefox-devedition-stub&os=win&lang=en-US"
```
Create a new Firefox Developer Edition profile and use user.js from the link below:
- https://bitbucket.org/mrbbking/quieter-firefox/src/master/
```
@micksmix
micksmix / aws_cli_pyenv
Created August 19, 2020 19:42 — forked from sjjohansen/aws_cli_pyenv
Adding AWS CLI in Python Virtualenv on MacOS X
# create a directory for you Python Virtual Environments
mkdir -p ~/pyenvs
# create one for the AWS cli then install the CLI
virtualenv ~/pyenvs/aws
~/pyenvs/aws/bin/pip install awscli
~/pyenvs/aws/bin/pip install boto
@micksmix
micksmix / heic_to_jpeg.sh
Created September 7, 2022 04:02 — forked from ccnokes/heic_to_jpeg.sh
Bash script that converts .HEIC to .jpg files
#!/bin/bash
set -eu -o pipefail
count=$(find . -depth 1 -name "*.HEIC" | wc -l | sed 's/[[:space:]]*//')
echo "converting $count files .HEIC files to .jpg"
magick mogrify -monitor -format jpg *.HEIC
echo "Remove .HEIC files? [y/n]"
@micksmix
micksmix / remove_tmp_containers.py
Last active December 9, 2024 15:43
Removes temporary containers in firefox
#!/usr/bin/env python3
"""
This script is designed to help users find their Firefox profiles and create
a backup of the `containers.json` file, especially if they use the 'Temporary Containers' extension.
Once the user selects the desired profile using arrow keys, the script does the following:
1. Identifies and removes any 'Temporary Containers' entries (those starting with 'tmp') from the `containers.json` file.
2. Creates a backup of the original `containers.json` file. If a backup already exists, it appends a timestamp to the new backup to avoid overwrites.
3. Overwrites the `containers.json` file with the cleaned data.
@micksmix
micksmix / userChrome.css
Created June 23, 2023 18:05 — forked from hallettj/userChrome.css
Customize Firefox Quantum to hide tab bar, and to hide navigation bar when it is not focused. Press Ctrl+L to reveal navigation bar. To make this work you must open about:config and set toolkit.legacyUserProfileCustomizations.stylesheets to true with. This version is tested with Firefox v78.
@-moz-document url(chrome://browser/content/browser.xul),
url(chrome://browser/content/browser.xhtml) {
/* hide horizontal tabs at the top of the window */
#TabsToolbar > * {
visibility: collapse;
}
/* hide navigation bar when it is not focused; use Ctrl+L to get focus */
#main-window:not([customizing]) #navigator-toolbox:not(:focus-within):not(:hover) {
@micksmix
micksmix / config
Last active December 27, 2024 23:10
ghostty config
theme="MaterialDesignColors"
font-family = Fira Code
font-style = Regular
font-size = 14
keybind = global:cmd+`=toggle_quick_terminal
quick-terminal-animation-duration = 0.1