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
| #coding: utf-8 | |
| # python 3 | |
| # This script is an editor action, called "Serve Files." It has three improvements over existing implementations: | |
| # Serve every file from the directory of your script at its filename | |
| # Serve a zip of the entire directory in which your script is contained at /. This is useful for copying a lot of files to a computer at once | |
| # Printing your local IP to the console, to make it easier to see where you should go on your computer | |
| # It will also clean up the zip it creates after you stop the server. | |
| import os | |
| import shutil |
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
| #coding: utf-8 | |
| #python 3 | |
| from __future__ import absolute_import | |
| import keychain | |
| import requests | |
| from urllib.parse import quote | |
| import os | |
| import ui |
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
| #scraps text from web page, puts in new Draft | |
| import sys | |
| import requests | |
| import html2text | |
| import clipboard | |
| import webbrowser | |
| import urllib | |
| def get_page(url): | |
| try: |
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
| #!/usr/bin/env python3 | |
| # coding: utf-8 | |
| # various algos counting prime numbers < N | |
| # each better or more pythonic then previous | |
| import itertools | |
| import numpy as np | |
| import datetime | |
| from operator import mul | |
| from functools import reduce |
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 | |
| echo "I feel like napping right now..." | |
| echo $(date +"%c") | |
| ADAPTER=$(networksetup -listallhardwareports | grep -A1 Wi-Fi | awk '/Device:/ {print $2}') | |
| CONN=$(networksetup -getairportnetwork "$ADAPTER") | |
| echo "$CONN" | |
| # switch OFF WiFi first | |
| networksetup -setairportpower "$ADAPTER" off |
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 | |
| echo "I've been napping. Waking up now..." | |
| echo $(date +"%c") | |
| # Switch WiFi ON | |
| # ADAPTER=en0 | |
| ADAPTER=$(networksetup -listallhardwareports | grep -A1 Wi-Fi | awk '/Device:/ {print $2}') | |
| echo "$ADAPTER" | |
| # check wifi MAC | |
| MAC=$(/usr/local/bin/spoof-mac list --wifi) |
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
| #!/usr/bin/env python | |
| # Takes hosts file and converts to DNSCrypt blacklist-domains file | |
| # so you could block malicious hosts on DNSCrypt | |
| # (when alternating to DNSCrypt instead of dnsmasq in my scenario) | |
| # hosts file from https://github.com/StevenBlack/hosts | |
| # See https://dnscrypt.org/ IP/domain names blocking | |
| import re |
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
| on run {input, parameters} | |
| if application "Google Chrome" is running then | |
| tell application "Google Chrome" to tell window 1 to close (tabs whose id is not (get id of active tab)) | |
| tell application "Google Chrome" | |
| tell window 1 to make new tab with properties {URL:"http://localhost:8123/Chrome.html"} | |
| end tell | |
| else | |
| do shell script "open -n -a 'Google Chrome' --args --disable-async-dns" | |
| end if | |
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
| # coding: utf-8 | |
| # send Pushover notifications | |
| import requests | |
| import keychain | |
| def pushNotification(message, title='', url='', url_title=''): | |
| pushover_url = 'https://api.pushover.net/1/messages.json' | |
| payload = { | |
| 'token': keychain.get_password('Pushover', 'token'), |
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
| #!/usr/bin/env zsh | |
| # MODIFY SETTINGS VIA THE CONFIGURATION FILES IN | |
| # conf/ | |
| # eval PATH=/opt/usr/sbin:/opt/etc/init.d:$PATH | |
| # CHECK FOR NEEDED AND OPTIONAL UTILITIES AND PERMISSIONS | |
| # if [ `whoami` != "root" ]; then | |
| # echo "Insufficient permissions. Run as root." |