This file contains 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 | |
SSID=mywifi | |
uuid=$(nmcli c | grep $SSID | tr -s ' ' | cut -d\ -f3) | |
while :; do | |
sleep 1s | |
ping $(ip r | grep -oP "(?<=default via )[0-9.]*") -c2 -w8 > /dev/null | |
if [[ $? -ne 0 ]]; then | |
notify-send "Disconnected" | |
echo "==> " $(date) " Reconnecting" | |
nmcli c up uuid ${uuid} |
This file contains 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
#!/usr/bin/python2 | |
from __future__ import print_function | |
# https://github.com/benslk/chrome_remote_shell | |
# should be installed from git. Using PIP to install will only get older, not working version | |
import chrome_remote_shell, json | |
import re | |
shell = chrome_remote_shell.Shell(host='localhost', port=9222) | |
shell.connect(0) |
This file contains 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
(defvar ac-source-chrome-cache nil) | |
(defvar ac-source-chrome-complete | |
'((candidates . (ac-chrome-candidate)) | |
(symbol . "w"))) | |
(defun clear-chrome-cache () | |
(setq ac-source-chrome-cache nil)) | |
(add-hook 'focus-in-hook 'clear-chrome-cache) |