Skip to content

Instantly share code, notes, and snippets.

@avielsh
avielsh / test_inet
Last active April 10, 2020 08:07
A simple internet connectivity test script
#!/usr/bin/env zsh
#!/usr/bin/env bash
#Configure these as needed
host="google.com"
ping="ping -c1 -W1000 $host > /dev/null"
#Status update interval (In seconds)
statusinterval=300
dndstart="23:50"
dndend="09:30"
#reset wifi script - change this for a quick connection fix
@pirate
pirate / alfred-clipboard.sh
Last active June 7, 2024 08:52
Script to manage searching, backing up, and collecting infinite clipboard history from the Alfred Clipboard History on macOS.
#!/usr/bin/env bash
# This is a script that provides infinite history to get around Alfred's 3-month limit.
# It works by regularly backing up and appending the items in the alfred db to a
# sqlite database in the user's home folder. It also provides search functionality.
# https://www.alfredforum.com/topic/10969-keep-clipboard-history-forever/?tab=comments#comment-68859
# https://www.reddit.com/r/Alfred/comments/cde29x/script_to_manage_searching_backing_up_and/
# Example Usage:
# alfred-clipboard.sh backup
@avielsh
avielsh / tmux-mouse.md
Last active February 6, 2019 18:42
A simple hack to toggle mouse on/off for easier clipboard functionality #tmux

Tmux bind m to toggle mouse on/off

Run this on terminal to add to your .tmux.conf:

cat - <<-EOF
#bind m to Enable/Disable mouse (change to whatever you fancy)
bind m if-shell 'tmux show-options -vg mouse | grep on' \
"set -g mouse off \; display \"Mouse is off\"" \
"display \"Mouse is on\" \; set -g mouse on"
EOF &gt;&gt; ~/.tmux.conf