Skip to content

Instantly share code, notes, and snippets.

Lajos Koszti Ajnasz

Block or report user

Report or block Ajnasz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View main.py
#!/usr/bin/env python2
# Python script to generate TOTP qrcodes from keepass database to scan into
# authenticator app
# Required libraries:
# https://github.com/lincolnloop/python-qrcode
# https://github.com/pschmitt/pykeepass
from pykeepass import PyKeePass
import qrcode
import os
View get-totp-qr.sh
#!/bin/sh
PATH_TO_ACCOUNT="/path/to/account"
PATH_TO_FILE="/path/to/file"
ACCOUNT_NAME="account@somewhere.org"
ISSUER="Somewhere Org"
KEEPASS_PASSWORD="the secret password"
echo "$KEEPASS_PASSWORD" | keepassxc-cli show -a "TOTP Seed" "$PATH_TO_FILE" "$PATH_TO_ACCOUNT" | grep -v "Insert password" | while read i;do echo "otpauth://totp/$ACCOUNT_NAME?secret=$i&issuer=$ISSUER" | qr;done;
View pomodoro.sh
#!/bin/sh
# pomodoro.sh to play a sound after pomodoro finished
# set update frequency to 0 to don't display updates
# In that case send a USR1 signal to the process if you want to see the elapsed time
# The script will update you slack status if slack token set
# You can set slack token by setting the SLACK_TOKEN env var
# Or put the token into a gpg encrypted file to $HOME/.secret/slack_token.gpg
# You can override that path by setting the SLACK_TOKEN_FILE_PATH env var
@Ajnasz
Ajnasz / pre-commit
Last active Apr 14, 2018 — forked from jhartikainen/commit-msg
ESLint git commit hook
View pre-commit
#!/bin/sh
files=$(git diff --diff-filter ACMR --cached --name-only | grep '\.js$')
FAILED=0
for file in $files; do
git show :$file | $(npm bin)/eslint --stdin --stdin-filename $file
EXIT_CODE=$?
View mystery-solver.sh
#!/bin/sh
# get clues
grep CLUE crimescene
# clue mentioned Annabel
grep Annabel people | \
cut -s -f 4 | \
cut -d ' ' -f1-2,4 | \
sed 's/ /_/' | \
@Ajnasz
Ajnasz / README.md
Last active May 19, 2018
Download stuff from humble-bundle in batch
View README.md
View commit-msg
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commit message file.
#
# To enable this hook, rename this file to "commit-msg".
@Ajnasz
Ajnasz / background.js
Last active Oct 1, 2017
youtube embed blocker webextension
View background.js
chrome.webRequest.onBeforeRequest.addListener(
function(requestDetails){
console.log('Loading: ' + requestDetails.url);
return { cancel: true };
},
{urls: ['*://www.youtube.com/embed/*']},
['blocking']
);
View toggle-keyboard-layout.sh
#!/bin/sh
set -e
PID_FILE="/tmp/toggle_keyboard_layout.pid"
while [ -f $PID_FILE ];do
exit 0;
done;
@Ajnasz
Ajnasz / fluxbox_init
Created Aug 16, 2017
How to add rootmenu to fluxbox toolbar
View fluxbox_init
session.screen0.toolbar.button.rootmenu.label: rootmenu
session.screen0.toolbar.button.rootmenu.commands: RootMenu
session.screen0.toolbar.tools: button.rootmenu, workspacename, iconbar, systemtray, clock
You can’t perform that action at this time.