Skip to content

Instantly share code, notes, and snippets.

@kitten77
kitten77 / dd
Created April 18, 2019 06:21
dd example with progress bar
root@hq:/home/root/Downloads # dd if=kali-linux-xfce-2019.1a-amd64.iso of=/dev/da0 bs=1M status=progress
@kitten77
kitten77 / coutner.py
Last active December 17, 2018 09:27
quick collection counter
import collections
string = "aaaBBBcccDDD"
line = str()
counter = collections.Counter(string)
for key, value in counter.items():
line +=(f'{key}: {value} ')
print(line)
@kitten77
kitten77 / SickGear emby watched fails.md
Last active December 3, 2018 17:48
SG Emby watched state not working as expected

If all dirs are enabled on the user in Emby the EnabledFolders returns a empty list []. Because Emby expect you to get all LibraryFolders This is done with api call to http://192.168.1.6:8096/emby/Library/MediaFolders The data returned on this is:

{'Items': [{'Name': 'custom added folder', 
            'ServerId': '98ffcead6abf4e1785aebfc328eb64d0', 
            'Id': '4e57254b22890e8821d40369b5fbc5f6', 
            'Etag': 'cf80ced1811a32f28483093ad517d5f3', 
            'DateCreated': '2018-12-02T18:37:20.0000000+00:00', 
@kitten77
kitten77 / freebsd.py
Created September 24, 2018 13:35
get this on freebsd
ERROR asyncio Exception in callback Commands.command_callback(('send', 'l6'), 'l6')(<Task finishe...supported'),)>)
handle: <Handle Commands.command_callback(('send', 'l6'), 'l6')(<Task finishe...supported'),)>)>
Traceback (most recent call last):
File "/usr/local/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/usr/local/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.6/http/client.py", line 1234, in endheaders
(venv) muad@podde:~/workbench/THcrm$ pip freeze
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
(venv) muad@podde:~/workbench/THcrm$ pip3 freeze
Brlapi==0.6.5
certifi==2018.4.16
chardet==3.0.4
@kitten77
kitten77 / tk_hello_world.py
Last active January 10, 2018 10:37
simple hello world tkinter
import sys
from tkinter import *
"""
A simple hello world written in python and tkinter
"""
#setup size for the root window
width = 200
height = 100
root = Tk() #Creates a root window
@kitten77
kitten77 / interfaces
Last active November 3, 2017 08:49
debian 9 network problem
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
Operations to perform:
Apply all migrations: admin, auth, contenttypes, host_manager, sessions
Running migrations:
Applying host_manager.0002_auto_20170515_0805...Traceback (most recent call last):
File "/home/admin/.env/lib/python3.6/site-packages/django/db/models/fields/__init__.py", line 2392, in to_python
return uuid.UUID(value)
File "/usr/local/lib/python3.6/uuid.py", line 140, in __init__
raise ValueError('badly formed hexadecimal UUID string')
ValueError: badly formed hexadecimal UUID string
@kitten77
kitten77 / aka.theme
Last active April 16, 2017 19:02
screen has no colors
#################################################################
# aka theme (v1.00) #
# by curson [navaeg@gmail.com] - http://www.the-shrike.net #
#################################################################
#################################################################
# This is the first version of this theme I finally decided to #
# release to the "public". The original base of the theme is #
# strongly inspired by lilah.theme, but I'm not sure how much #
# of it is actually left here. #
@kitten77
kitten77 / etc_jail_conf
Last active April 14, 2017 07:30
iocage startup error
## created too test iocage startup without using iocage.
# Typical static defaults:
# Use the rc scripts to start and stop jails. Mount jail's /dev.
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown";
exec.clean;
mount.devfs;
# Dynamic wildcard parameter: