Skip to content

Instantly share code, notes, and snippets.

View AnotherKamila's full-sized avatar

Kamila Součková AnotherKamila

View GitHub Profile
@AnotherKamila
AnotherKamila / yubikey-ssh-tldr.txt
Created January 31, 2023 12:38
get a new-ish yubikey to work as an SSH key (2022)
ykman config usb --disable OTP
ykman fido set-pin
ssh-keygen -t ed25519-sk -O resident -f ~/.ssh/id_ed25519_sk
ssh-add -K
# Put me into /usr/local/etc/X11/xorg.conf.d/
# Replace XXX by the appropriate device:
# guess from `sudo libinput list-devices` (TODO I should write more precise instructions)
Section "ServerLayout"
Identifier ":-("
InputDevice "Trackpoint0" "CorePointer"
InputDevice "Touchpad0" "CorePointer"
EndSection
@AnotherKamila
AnotherKamila / screen.sh
Created December 1, 2019 12:31
some silly screen setup script
#!/bin/sh
MYSCREEN='eDP-1' # the laptop's built-in display
screens=` xrandr | grep ' connected' | grep -v $MYSCREEN | cut -d\ -f1`
notscreens=`xrandr | grep 'disconnected' | grep -v $MYSCREEN | cut -d\ -f1`
for s in $notscreens; do
xrandr --output $s --off
done
@AnotherKamila
AnotherKamila / very_meta_exporter
Created May 15, 2019 08:50
Prometheus exporter for stats *about* your code!
#!/usr/bin/env python3
# TODO publish this separately
#
# Needs packages:
# - ag (package probably named something like silversearcher)
# - cloc
# Uses prometheus_client Python library -- install with pip install --user prometheus_client, or use pipenv
#
# use with something like:
@AnotherKamila
AnotherKamila / mdl-custom-colours.md
Created January 10, 2019 13:27
Building MDL (Material Design Lite, https://getmdl.io/) CSS with custom colours
  1. Clone and prepare the repo:

    $ git clone https://github.com/google/material-design-lite.git
    $ cd material-design-lite
    $ npm install
    $ sudo npm install -g gulp  # needed to build
  2. Set your colors in src/src/material-design-lite.scss, BEFORE the @import "variables"; line.
    The colours must be in "R,G,B" format (values 0-255).

@AnotherKamila
AnotherKamila / myapp.py
Last active August 30, 2017 16:42
Demo app for showing off the Prometheus monitoring server
#!/usr/bin/env python3
import prometheus_client as prom
import random
import time
import sys
T = float(sys.argv[1]) if len(sys.argv) > 1 else 0.1
REQUEST_TIME = prom.Summary('processing_time_seconds', 'Time spent processing request')
@AnotherKamila
AnotherKamila / pushlink.sh
Created February 4, 2015 20:09
Quick script to push a link via Pushbullet
@AnotherKamila
AnotherKamila / allflac2ogg.sh
Created December 26, 2013 11:26
My shell scripts for music management
#!/bin/bash
DIR="`readlink -f \"${1:-.}\"`"
FLAC_MUSIC_DIR="`readlink -f \"${2:-$HOME/temp/flac_music/}\"`"
Q=8
echo " ** Encoding all FLAC files under $DIR as OGG at quality $Q **"
find "$DIR" -type f -name '*.flac' -print | while read -r f; do oggenc -q$Q -o "${f%.flac}.ogg" "$f"; done
echo " ** Moving all FLAC files to $FLAC_MUSIC_DIR **"
@AnotherKamila
AnotherKamila / homework.tex
Last active December 26, 2015 07:59
my homework template (e.g. for weekly assignments from algebra, formal languages etc.)
MOVED: I now have an (up-to-date!) repo with all my templates at https://github.com/AnotherKamila/templates.
PRESUNUTÉ: Po novom mám repozitár so všetkými mojimi templatami na https://github.com/AnotherKamila/templates.
@AnotherKamila
AnotherKamila / autopull.coffee
Created August 2, 2012 17:25
post-receive hook receiver to pull new revisions into the given repo
#!/usr/bin/coffee
# a small app to pull new revisions to a specified github repo
# to be used as the other end of post-receive hooks
#
# url should contain the (absolute) path to the repo in the `repo` parameter
# example: http://rhoeas.tk/pull?repo=~kamila/www/my.rhoeas.tk
http = require 'http'
url = require 'url'