Skip to content

Instantly share code, notes, and snippets.

View Kautenja's full-sized avatar
:octocat:
$(git status)

Christian Kauten Kautenja

:octocat:
$(git status)
View GitHub Profile
@Kautenja
Kautenja / piflix.css
Last active March 31, 2025 09:20
styles to make emby look like netflix
/*
EMBY THEME : piflix
# Table of Contents
1. ACCENT COLORS
1.1 Buttons
1.1.1 Checkboxes
1.1.2 Rectangles
1.1.3 Links & Text buttons
@Kautenja
Kautenja / applet.icns
Last active August 31, 2021 19:30
an apple script to open a terminal window at the current working directory (a 64-bit replacement for Go2Shell)
6963 6e73 0000 4e48 544f 4320 0000 0030
6973 3332 0000 020f 7338 6d6b 0000 0108
6963 3131 0000 0507 6963 3037 0000 1592
6963 3133 0000 3060 6973 3332 0000 020f
8e00 030b 96c3 cd83 cf09 cec6 9c14 0000
9576 1d05 8303 0905 1d76 9c00 00bc 1814
2483 260b 2414 1dbc 0000 be05 24af 782e
8226 0a24 07be 0000 b903 2626 87da 8326
0903 b900 00b2 0326 b078 2e83 2605 03b2
0000 ab03 8126 01ff ff81 2605 03ab 0000
@Kautenja
Kautenja / multifile.sty
Last active October 28, 2019 18:00
LaTeX definitions for including subfiles (.tex, .bib)
% multifile.sty
\typeout{A Package for reading subfiles 'multifile' <28 October 2019>}
\ProvidesPackage{multifile}
\usepackage{subfiles}
% a command to run shell commands
% USAGE:
% \app@exe{<command>}
% where:
@Kautenja
Kautenja / [email protected]
Created October 5, 2019 00:23
A dropbox service file
[Unit]
Description=Dropbox as a system service user %i
After=network.target
[Service]
ExecStart=${HOME}/.dropbox-dist/dropboxd
ExecStop=cat ${HOME}/.dropbox/dropbox.pid | xargs kill
User=%i
Group=%i
PIDFile=${HOME}/.dropbox/dropbox.pid
@Kautenja
Kautenja / scrape_deviant_art.py
Last active June 13, 2019 13:44
A script to search and scrape DeviantArt.com
"""A tool for scraping images from DeviantArt.com"""
import argparse
import logging
import multiprocessing
import os
import shutil
import re
import bs4
import requests
import tqdm
@Kautenja
Kautenja / infer_column_dtype.py
Created May 21, 2019 23:21
A method to infer the datatype of a pandas Series.
"""A method for inferring the data type of Series/ndarrays."""
import pandas as pd
# the type cast methods to attempt (in order)
_TYPE_CASTS = [pd.to_datetime, pd.to_numeric, pd.to_timedelta]
def infer_column_dtype(column):
"""
@Kautenja
Kautenja / upgrade.sh
Created March 17, 2019 17:29
a script to upgrade packages on Debian systems one at a time
for package in $(apt list --upgradable | cut -d "/" -f1); do
sudo apt-get install --only-upgrade -y $package;
done;
@Kautenja
Kautenja / tar-progress.md
Last active November 12, 2024 22:00
one-liners for using tar with gzip and pv for a progress bar

Compress

tar cf - <files> -P | pv -s $(du -sb <files> | awk '{print $1}') | gzip > <some .tar.gz file>

where:

  • `` is the root-mounted (i.e. starts with /) path to the files
@Kautenja
Kautenja / get_tf_gpu_models.py
Last active October 27, 2018 21:28
Methods to get the model name of GPUs used by TensorFlow.
"""Methods to get the model name of GPUs used by TensorFlow."""
from tensorflow.python.client import device_lib
def get_device_model(device) -> str:
"""
Return the model of a TensorFlow device.
Args:
device: the device to get the model name of
@Kautenja
Kautenja / iou.py
Last active June 1, 2021 12:10
An implementation of the Intersection over Union (IoU) metric for Keras.
"""An implementation of the Intersection over Union (IoU) metric for Keras."""
from keras import backend as K
def iou(y_true, y_pred, label: int):
"""
Return the Intersection over Union (IoU) for a given label.
Args:
y_true: the expected y values as a one-hot