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 sh | |
# Script to update nsupdate.info IP when it has changed or if a week has passed. | |
# Will send an update on reboot, even if the IP is current. | |
# A nice quick snippet to add to your NAS, I run this on my Synology devices | |
# Slightly modified from https://www.raphael.li/blog/2015/03/custom-ddns-service-provider/ | |
# - Added weekly update even if no IP change detected | |
DOMAIN="your-full-domain-here.nsupdate.info" | |
TOKEN="your-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
import sys | |
import calendar | |
if len(sys.argv) != 2: | |
print("Expecting year to be input!") | |
sys.exit(1) | |
year = int(sys.argv[1]) | |
weekNum = 1 |
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 | |
colorread(){ | |
case "$1" in | |
red|alert) local COLOR=$(printf "\\e[1;31m");; | |
green|attention) local COLOR=$(printf "\\e[1;32m");; | |
yellow|warn) local COLOR=$(printf "\\e[1;33m");; | |
blue|question) local COLOR=$(printf "\\e[1;34m");; | |
purple|info) local COLOR=$(printf "\\e[1;35m");; | |
cyan|notice) local COLOR=$(printf "\\e[1;36m");; |
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
// Based on http://www.jamesphoughton.com/2012/10/10/linear-interpolation-with-dates-in.html | |
// Added some extra error checks, refactored a bit | |
// ##################### | |
// How To Use | |
// 1. In google sheets, open Tools -> Script Editor | |
// 2. Copy this code in the Script Editor | |
// 3. Save | |
// 4. Enjoy using this as you would any other function in the sheet (the app will show that it doesn't know this function, but if you typed it correctly it will work) | |
// Example cell content: =interpolate(A2:A15, B2:B15, 13) | |
// ##################### |
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
// nextafter implemented in vanilla js without dependancies | |
// No license, use as you wish. | |
function nextafter(from, to){ | |
if(isNaN(from) || isNaN(to)) | |
return NaN; | |
if(from === to) | |
return to; |
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 | |
if [ "$1" = "projector" ]; then | |
xrandr --output DP-1 --off | |
xrandr --output DP-3 --off | |
xrandr --output DP-5 --off | |
xrandr --output HDMI-0 --auto | |
elif [ "$1" = "screens" ]; then | |
xrandr --output HDMI-0 --off | |
xrandr --output DP-3 --auto --primary |
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/python3 | |
import requests | |
import re | |
import time | |
import sys | |
projectorAddress = 'http://192.168.1.87' | |
username = 'EPSONWEB' | |
password = 'admin' |
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
[Nemo Action] | |
Name=Open with Sublime | |
Exec=subl %F | |
Extensions=any | |
Icon-Name=sublimetext | |
Quote=double | |
Selection=Any |
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/expect -f | |
# Runs bluetoothctl and attempts to connect with bluetooth device | |
# If connection fails, tries to unpair, pair and then connect again | |
# My specific device apparently can't be paired to multiple hosts, so it needs this | |
# Change this to whatever your device's bluetooth ID is | |
set ID "BC:FD:5B:00:14:28" | |
spawn "bluetoothctl" |
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
# Taken from (huge thanks to Sob) http://forum.mikrotik.com/viewtopic.php?t=107142#p532709 | |
# This is for two ports only, however can be altered for whatever number the router has | |
/ip address | |
add address=192.168.1.11/24 interface=ether1 network=192.168.1.0 | |
add address=192.168.1.12/24 interface=ether1 network=192.168.1.0 | |
add address=192.168.0.1 interface=ether2 network=192.168.0.1 | |
add address=192.168.0.1 interface=ether3 network=192.168.0.1 | |
/ip firewall mangle | |
add action=mark-connection chain=prerouting dst-address=192.168.1.11 new-connection-mark=port1 |
NewerOlder