Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash -e
# user editable
local_dest=VenturePlan
wow="/mnt/c/Program Files (x86)/World of Warcraft/_retail_/Interface/AddOns"
# program editable
addon_whitelist=Addon
source=https://github.com/Gaboros/VenturePlan.git
addon_name=VenturePlan
var TP_Nightstand_Off_Timer = null
val TP_LOWER = 6.5
val FILENAME = "power.rules"
rule "scene - turn off nightstand when unused"
when
Item TP_Nightstand_Power received update
then
if (TP_Nightstand_Switch.state == OFF) {
logInfo(FILENAME, "nightstand already off")
@psychoticbeef
psychoticbeef / heating.rules
Created November 26, 2018 21:11
my heating rules
val Number tempShower = 23.0
val Number tempComfortBath = 22.0
val Number tempComfort = 21.5
val Number tempMid = 19.0
val Number tempSleep = 18.5
val Number tempLower = 17.0
val Number tempChill = 15.0
val Number tempAway = 15.0
val Number tempAwayLonger = 13.0
val Number tempOff = 10
@psychoticbeef
psychoticbeef / lastpass.sh
Created October 28, 2018 08:51
Get all stackexchange domains for lastpass (to treat them as a single entity)
curl https://stackexchange.com/sites?view=list|awk '/lv-item/{getline; print}'|cut -d '"' -f2|grep -o '[^.]*\.[^.]*$'|sed 's/https:\/\///g'|sort|uniq|tr '\n' ','
# output 10/28/2018: askubuntu.com,mathoverflow.net,serverfault.com,stackapps.com,stackexchange.com,stackoverflow.com,superuser.com
@psychoticbeef
psychoticbeef / create_mailboxes.sh
Created September 28, 2016 08:17
create standard RFC mailboxes in cyrus-imap and set proper permissions
#!/bin/bash
FOLDERS=( "" .Archive .Drafts .Flagged .Junk .Sent )
LOGIN=$1
BOSS=$2
CEO=
ACL_CYRUS=lrswipcda
ACL_SELF=lrswipkxtecd
ACL_BOSS=lrswipkxtecd
@psychoticbeef
psychoticbeef / snapper.php
Created May 30, 2016 18:41
convert ACTS / tarsnap-generations style backups to tarsnapper style backups
<?php
$machine = 'mycomputername';
$max_cmd_len = intval(shell_exec('getconf ARG_MAX'));
$commands = array();
$commands_del = array();
$cur_command = '';
$cur_command_del = ' -d ';
<?php
$json = file_get_contents('http://listen.di.fm/public3');
$j = json_decode($json, true);
$l = array();
foreach ($j as $item) {
$l []= $item['key'];
}
sort($l);
echo join(' ', $l);
@psychoticbeef
psychoticbeef / zshrc
Last active February 28, 2016 17:02
Use "play music_station" to play stuff from digitally imported (di.fm) via command line @see https://gist.github.com/psychoticbeef/3d9583f42f182f6eb0e8
play () { [[ -z $1 ]] && echo 00sclubhits ambient atmosphericbreaks bassline bassnjackinhouse bigbeat bigroomhouse breaks chillhop chillntropicalhouse chillout chilloutdreams chillstep classiceurodance classiceurodisco classictechno classictrance classicvocaltrance club clubdubstep darkdnb darkpsytrance deephouse deepnudisco deeptech detroithousentechno discohouse djmixes downtempolounge drumandbass drumstep dub dubstep dubtechno ebm eclectronica electro electronicpioneers electronics electropop electroswing epictrance eurodance funkyhouse futurebeats futuregarage futuresynthpop gabber glitchhop goapsy handsup hardcore harddance hardstyle hardtechno house idm indiebeats indiedance jazzhouse jungle latinhouse liquiddnb liquiddubstep liquidtrap lounge mainstage melodicprogressive minimal nightcore nudisco oldschoolacid oldschoolhouse oldschoolrave progressive progressivepsy psybient psychill russianclubhits soulfulhouse spacemusic techhouse techno trance trap tribalhouse umfradio undergroundtechno vocalchillout
#!/usr/bin/python
# setup: pip install requests beautifulsoup4
from decimal import Decimal
import requests
from bs4 import BeautifulSoup
import sys
import getpass