Skip to content

Instantly share code, notes, and snippets.

View Kagee's full-sized avatar
👾
Still working from home, what about you?

Anders Einar Hilden Kagee

👾
Still working from home, what about you?
View GitHub Profile
- id: 'cube-toggle-office'
alias: Toggle lights on double tap
description: 'Toggle lights on double tap (desc)'
trigger:
- event_data:
gesture: 6
id: mi_magic_cube
event_type: deconz_event
platform: event
condition:
- id: 'cube-adjust-brightness-rotation'
alias: Adjust brightness based on rotation
description: 'Adjust brightness based on rotation (desc)'
trigger:
- platform: event
event_type: deconz_event
event_data:
id: switch_6 # analog events
condition:
condition: template
guessit CSI\ Crime\ Scene\ Investigation\ -\ S11E10\ -\ 418-427.avi
For: CSI Crime Scene Investigation - S11E10 - 418-427.avi
GuessIt found: {
"title": "CSI Crime Scene Investigation",
"season": 11,
"episode": [
10,
418,
419,
420,
2018-12-01 21:58:02 DEBUG SHOWQUEUE-ADD :: [54da0c7] Parsed CSI Crime Scene Investigation - S11E10 - 418-427 into title: CSI Crime Scene Investigation, season: 11, episode: [10, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427], type: episode, parsing_time: 0.0228800773621, total_time: 0.0232539176941, absolute_episode: [], quality: Unknown
2018-12-01 21:41:03 DEBUG SHOWQUEUE-REFRESH :: [54da0c7] Parsed Grey's Anatomy - S14E09 - 1-800-799-7233 into title: Grey's Anatomy, season: 14, episode: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
config.txt: dtoverlay=dwc2
cmdline.txt: modules-load=dwc2,g_ether g_ether.host_addr=5a:53:4c:b9:75:cf g_ether.dev_addr=5a:77:1e:af:8e:9e
ssh: 1
/etc/network/interfaces.d/usb0
auto usb0
allow-hotplug usb0
iface usb0 inet dhcp
i1s16:TDRawDeviceEvent95:class:command
protocol:arctech
model:selflearning
house:12910990
unit:11
group:0
method:turnon
i1s13:TDDeviceEventi2si1s0:16:TDRawDeviceEvent94:class:command
protocol:arctech
model:selflearning
what happens:
>>> a = [ "ø", "å" ]
b = [ "\\x{F8}", "\\x{E5}" ]
>>> b
['\\x{F8}', '\\x{E5}']
>>> "øremål".replace(a,b)
Traceback (most recent call last):
get_non_ascii():
File "<stdin>", line 1, in <module>
à \x{E0}
á \x{E1}
ä \x{E4}
å \x{E5}
æ \x{E6}
ç \x{E7}
è \x{E8}
é \x{E9}
ê \x{EA}
ï \x{EF}
def get_cat_domains():
#whois = telnetlib.Telnet("whois.norid.no", 43)
#whois.write("-c utf-8 NNRI4O-NORID\n".encode('ascii'))
#result = whois.read_all()
#whois.close()
#print(result.decode('utf-8'))
a_file = open('whois.txt', encoding='utf-8')
s = a_file.read()
#print(s)
r = re.search('^Domains\.*: (.*)', s, re.MULTILINE)
echo '-c utf-8 NNRI4O-NORID' | nc whois.norid.no 43 > whois2.txt
a_file = open('whois2.txt', encoding='utf-8')
s = a_file.read()
r = re.search('Domains(.*)', s)
r.group(1)
''
r = re.search('Domains(..*)', s)
r.group(1)
'....................: aa.no aar <etc>