Skip to content

Instantly share code, notes, and snippets.

View lindhe's full-sized avatar
🦥

Andreas Lindhé lindhe

🦥
View GitHub Profile
@lindhe
lindhe / config.js
Created February 6, 2019 19:45
teleirc config
var config = {};
module.exports = config;
/////////////////////
// General config //
/////////////////////
// verbosity of console output
// possible options from most to least verbose:
// silly, debug, verbose, info, warn, error
@lindhe
lindhe / keybase.md
Created March 17, 2018 10:41
My keybase.io proof

Keybase proof

I hereby claim:

  • I am lindhe on github.
  • I am lindhe (https://keybase.io/lindhe) on keybase.
  • I have a public key whose fingerprint is 4EEE CFA0 147F 7121 5C72 CF2E 34C1 4B69 96D5 B89E

To claim this, I am signing this object:

@lindhe
lindhe / email.sh
Created December 21, 2017 18:17
Send an email via cli
echo "message" | mail -s "Subject line" email@example.com
@lindhe
lindhe / subscribe.sh
Created December 17, 2017 12:42
Bash script to subscribe people to a mailman mailing list (at least on chs.chalmers.se)
#!/bin/bash
domain='example.com'
list='list-name'
password=''
file='./members.txt'
echo "Logging in..."
curl -v -L -X POST -j -b non-existing -c './'$list'.cookie' --data 'adminpw='$password'&admlogin=Let me in...' 'http://lists.'$domain'/mailman/admin/'$list
echo "Logged in!"
@lindhe
lindhe / dark-ritch-text-fastmail.css
Created August 2, 2017 22:00
Override ritch text white background on Fastmiail (Stylish Userstyle CSS)
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.fastmail.com") {
.v-Message-body--html {
border-color: transparent !important;
background-color: transparent !important;
}
.v-Message-body--html p {
color: #fff !important;
}
@lindhe
lindhe / weeknumber.gs
Last active January 5, 2019 21:03
Prints Week number from date in Google Sheets
function printWeek() {
var settings = SpreadsheetApp.getActive().getSheetByName('settings');
var sheet = SpreadsheetApp.getActive().getSheetByName('test');
const DATE = 0;
const WEEK = 1;
const START_ROW = 2; // First row of data to process
// Fetch settings:
var config = settings.getRange(2,1,10,2).getValues(); // change range dependign on need
var numRows = config[0][1]; // Number of rows to process
if (typeof(numRows) !== 'number') {
@lindhe
lindhe / gist:11fb9c4c5f4ee29e3ece1ab4181bb8ba
Created July 7, 2017 14:17
The mighty "arrange all photos in new corresponding direcotires" one liner
find . -type f -print | perl -ne '/(.*IMG_(\d{4})(\d{2})(\d{2}).*)/ && print `mkdir -p $2/$2-$3/$2-$3-$4; mv $1 $2/$2-$3/$2-$3-$4`'
@lindhe
lindhe / check_network_before_backup.sh
Last active July 2, 2017 17:56
Checks for authorized Wi-Fi SSID or connected Ethernet before performing backup.
#!/bin/bash
# Checks for authorized Wi-Fi SSID or connected Ethernet before performing
# backup.
RUN=false;
AUTHFILE=~/.config/authorized_netwoks.txt;
WIFI=$(iwgetid --raw);
ETH_IF=eth0;
ETH=$(ip link show $ETH_IF | perl -n -e'/state (\w+)/ && print $1');
@lindhe
lindhe / Validity90-prototype_e9dd5ba
Created June 12, 2017 20:04
Output from reverse engineered diver for finger print reader
Prototype version 10
Found device 138a:0097
This device is not supported, but lets try anyway
Index 1, size 12
0000 66 30 64 66 38 63 65 64 35 34 32 36
usb write:
0000 01
usb read:
0000 00 00 f0 b0 5e 54 a4 00 00 00 06 07 01 30 00 01
@lindhe
lindhe / Validity90-prototype_2273db1
Created June 11, 2017 12:08
Output from reverse engineered diver for finger print reader
Prototype version 7
Found device 138a:0097
This device is not supported, but lets try anyway
[C]
Index 1, size 12
0000 66 30 64 66 38 63 65 64 35 34 32 36
usb write:
0000 01
usb read:
0000 00 00 f0 b0 5e 54 a4 00 00 00 06 07 01 30 00 01