Skip to content

Instantly share code, notes, and snippets.

View v6ak's full-sized avatar

Vít Šesták v6ak

View GitHub Profile
# yubihsm-shell (auth params) -a put-wrap-key -i 20 -c all --delegated all --informat bin --in wrap.key --verbose=0xff
[LIB - INF 09:50:58.762905] yubihsm.c:4052 (yh_init_connector): Loading http backend
[LIB - INF 09:50:58.768291] yubihsm_curl.c:88 (backend_connect): Trying to connect to http://AAA.BBB.CCC.DDD:12345/connector/status
[LIB - INF 09:50:58.798654] lib_util.c:129 (parse_status_data): response from connector
[LIB - INF 09:50:58.798682] lib_util.c:130 (parse_status_data): has device: yes
[LIB - INF 09:50:58.798691] lib_util.c:132 (parse_status_data): version: 2.0.0
[LIB - INF 09:50:58.798701] lib_util.c:133 (parse_status_data): pid: 17400
[LIB - INF 09:50:58.798706] lib_util.c:134 (parse_status_data): address: 0.0.0.0
[LIB - INF 09:50:58.798710] lib_util.c:135 (parse_status_data): port: 12345
[LIB - INF 09:50:58.798715] yubihsm_curl.c:129 (backend_connect): Found working connector
@v6ak
v6ak / keymap.c
Last active May 14, 2019 20:43
Attempt to create an one-handed layout for Ergodox
#define MIRRORED( \
\
/* left hand, spatial positions */ \
k00,k01,k02,k03,k04,k05,k06, \
k10,k11,k12,k13,k14,k15,k16, \
k20,k21,k22,k23,k24,k25, \
k30,k31,k32,k33,k34,k35,k36, \
k40,k41,k42,k43,k44, \
k55,k56, \
k54, \
EVENT type 22 (RawTouchBegin)
device: 2 (15)
detail: 2082
valuators:
0: 18367.72 (18367.72)
1: 51967.21 (51967.21)
EVENT type 6 (Motion)
device: 15 (15)
detail: 0
@v6ak
v6ak / gridify-svg.py
Last active March 12, 2019 09:13
Creates grid from SVG. Note that full image can be recovered from any piece, because any piece contain the full image just with modified boundaries.
#!/usr/bin/env python3
import argparse
import xml.etree.ElementTree
import re
import os
from collections import namedtuple
from decimal import Decimal
from fractions import Fraction
@v6ak
v6ak / ms-force-en.user.js
Last active November 14, 2018 13:40
Forces desired language on MS website. You need GreaseMonkey / TamperMonkey. Then click the “RAW” button to install it.
// ==UserScript==
// @name Microsoft: force desired language
// @version 1
// @grant none
// @include https://docs.microsoft.com/*/*
// ==/UserScript==
const DESIRED_LANGUAGE='en-us';
var locParts = /^(https:\/\/docs\.microsoft.com)\/([a-z]+-[a-z]+)\/(.*)$/.exec(location.href);
if(locParts){
@v6ak
v6ak / webex-teams-notifications-icon.user.js
Last active November 5, 2018 10:23
Webex Teams notification icon adjustment. Needs GreaseMonkey (or equivalent). After installing GM, just click the “Raw” button.
// ==UserScript==
// @name WebEx Teams notification icon
// @version 1
// @namespace v6ak
// @description This script will show a notification icon on WebEx Teams when there is a new message. It distinguishes between direct messages (or mentions or other higher-priority messages) and group messages.
// @grant none
// @include https://teams.webex.com/*
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am v6ak on github.
  • I am v6ak (https://keybase.io/v6ak) on keybase.
  • I have a public key ASDURjCbEyGvCwJmhptv8h0d4O8Xux6si85udZiFyvM3Ego

To claim this, I am signing this object:

#!/bin/bash
# safety settings
set -u
set -e
set -o pipefail
VERSION="$(sed -n 's#^.*bin/robozonky-app-\([0-9a-z.-]\+\).jar.*$#\1# p' Dist/robozonky.sh | head -n1)"
echo Trying to build native image for RoboZonky version $VERSION…
@v6ak
v6ak / gist:b6e1c18b85ad2dc19c03cac1669b65d0
Created May 19, 2018 21:56
Removes titlebar from maximized windows
#!/bin/bash
# Inspired by https://gist.github.com/tuxor1337/74e76d3d153c67593454
# Replaced polling by events
xdotool getwindowfocus behave %@ blur get_num_desktops | while read _; do
for id in $(xdotool search --class '.*'); do
xprop -id $id -f _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED 32c -set _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED 0x1
done
done
@v6ak
v6ak / pom.xml
Last active April 27, 2018 10:55
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>ad-hoc-project</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>