Skip to content

Instantly share code, notes, and snippets.

@brsnik
brsnik / VPN Auto Reconnect Script for Windows.md
Last active November 8, 2024 14:48
A simple script that will force reconnect your VPN when it disconnects. Optionally it can also send a notification to the user after multiple failed attempts.

VPN Auto Reconnect Script for Windows

1. Setup Your VPN

  1. Open VPN Settings

    • Open the Settings app by pressing Windows + I on your keyboard.

    • Or go to Network & Internet.

@shiwork
shiwork / gist:5562220
Last active December 17, 2015 05:59
foltiaのエンコードプロセスが12000秒超えている場合に殺す
for i in `ps aux | egrep 'ffmpeg|mplayer' | grep foltia | gawk '{print $2}'`
do
TIME=`ps -o lstart --noheader -p $i`;
START=`date +%s -d "$TIME"`;
NOW=`date +%s`;
PASSTIME=`expr $NOW - $START`;
if [ $PASSTIME -gt 12000 ]; then
kill $i;
echo "kill $i at "`date`;
@VoQn
VoQn / rgb_to_hex.rb
Created January 6, 2012 11:18
Interactive RGB Color Hex Convert
# Interactive RGB Color Hex Convert
# usage:
# $ ruby rgb_to_hex.rb
# r g b > 255 51 234
# hex: #ff33aa
# r g b > 0
# ### Please type 3 int values: red green blue
# r g b > 132 256 -1
# ### Please type 3 int values: (0 <= x <= 255)
# r g b > quit