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/sh | |
# My favourite flavour of git lg | |
git config --global alias.lga "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) -%C(bold yellow)%d%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset) %C(bold green)(%ar)%C(reset)' --all --date-order" | |
git config --global alias.lg "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) -%C(bold yellow)%d%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset) %C(bold green)(%ar)%C(reset)' --date-order" | |
# Rebase by default for all new branches | |
git config branch.autosetuprebase always | |
# Remember login details | |
git config --global credential.helper "store" |
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/sh | |
sudo add-apt-repository ppa:thopiekar/mt7601 | |
sudo apt-get update | |
sudo apt-get install build-essential # Without build-essential failed to compile on fresh Linux Mint installation | |
sudo apt-get install mt7601-sta-dkms | |
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
### This script retrieves the RTU course names corresponding to the RTU course codes | |
### Works as of 13.03.16. | |
### Coded by Linards Jukmanis - 0x4C4A.com | |
# Needs python, urllib2, cookielib and regular expressions | |
import urllib2 | |
import cookielib | |
import re | |
# Input your course codes |
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
# 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 |
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/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 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 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 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 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 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) | |
// ##################### |
OlderNewer