This file contains hidden or 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 | |
# Decrypt PDF by password stored in the Spotlight comment. | |
read -d '' Script << EOF | |
tell application "Finder" | |
set Comm to comment of (POSIX file "$1" as alias) | |
end tell | |
return Comm | |
EOF |
This file contains hidden or 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
# Revolut | |
DOMAIN-SUFFIX,revolut.com | |
DOMAIN-SUFFIX,revolutlabs.com | |
# assets.bwbx.io | |
# IP-CIDR,185.76.151.0/24,no-resolve | |
# IP-CIDR6,2001:b28:f23d::/48,no-resolve |
This file contains hidden or 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
# Barclays Mobile Banking | |
DOMAIN-SUFFIX,barclays.com | |
DOMAIN-SUFFIX,barclays.mobi | |
DOMAIN-SUFFIX,barclays.co.uk | |
DOMAIN-SUFFIX,barclays | |
DOMAIN-KEYWORD,barc.ly | |
DOMAIN-KEYWORD,bclays-ads | |
DOMAIN-KEYWORD,barclaysuk | |
# Other domains |
This file contains hidden or 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
function check_install { | |
output="$($1 --version)" | |
output_size=${#output} | |
if [ $output_size -eq 0 ]; then | |
echo '0' | |
else | |
echo '1' | |
fi | |
} |
This file contains hidden or 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
note_type = 'Basic' | |
regex = r'\[sound:.*\]' | |
field_from = 'Back' | |
field_to = 'Pronunciation' | |
model = mw.col.models.by_name(note_type) | |
notes = mw.col.models.nids(model) | |
for nid in notes: | |
note = mw.col.get_note(nid) |
This file contains hidden or 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
alias undock='f() { | |
if sudo docker kill $1; then | |
echo "[+] Successfully killed: $1" | |
else | |
echo "[-] Failed to kill: $1" | |
fi | |
if sudo docker rm $1; then | |
echo "[+] Successfully removed: $1" | |
else |
This file contains hidden or 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
function git_user_switcher() { | |
# Define an associative array to store the user settings | |
typeset -A -g git_users | |
# Add the users to the dictionary | |
# Format: username "name email gpg_key" | |
git_users=( | |
adam "adam [email protected]" | |
) |
This file contains hidden or 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 | |
# Get the architecture of the machine | |
arch=$(uname -m) | |
os=$(uname -s) | |
# Download the Zellij binary | |
if [ "$os" == "Darwin" ]; then | |
filename="zellij-${arch}-apple-darwin.tar.gz" | |
url="https://github.com/zellij-org/zellij/releases/latest/download/$filename" |
This file contains hidden or 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
load_func() { | |
local CMD_NAME="$1" | |
local SCRIPT_URL="$2" | |
local SAFETY_CHECK="${3:-true}" | |
local script=$(curl -fsSL $SCRIPT_URL) | |
if [[ "$SAFETY_CHECK" == "true" && $script =~ "rm " ]]; then | |
echo "Failed to load command $CMD_NAME: Harmful command detected in script." | |
return 1 | |
else |
This file contains hidden or 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
function ipinfo() { | |
ip_address=${1:-$(curl -s ipinfo.io/ip)} | |
while (( "$#" )); do | |
case $1 in | |
-h|--help) | |
echo "Command: ip-info IP_ADDRESS\n" | |
echo "Default: your ip address" | |
echo "Option -s or --simple" | |
echo "==>Print only Your address" |