Skip to content

Instantly share code, notes, and snippets.

@echo off
taskkill/im TokenUtil.exe /f
ECHO U TOKU JE RESTART SERVISA SMARTCARD (SCardSvr)
NET STOP SCardSvr
NET STOP CryptSvc
ECHO U TOKU JE RESTART Cryptographic Services (CryptSvc)
NET START CryptSvc
NET START SCardSvr
cd C:\Program Files\TrustEdgeID\
start TokenUtil.exe
@umpirsky
umpirsky / TokenBasedRememberMeServices.php
Created September 20, 2019 08:59
Workaround to prevent remember me login BC issue https://github.com/symfony/symfony/issues/33473
<?php
namespace Umpirsky\MyBundle\Security\Http\RememberMe;
use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices as BaseTokenBasedRememberMeServices;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
<?php
namespace Umpirsky\Form\ChoiceList;
use Doctrine\ORM\QueryBuilder;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
use Symfony\Component\Form\Exception\LogicException;
@umpirsky
umpirsky / keyboard-backlight
Last active January 7, 2018 23:08
Turn keyboard backlight on/off using https://github.com/MatMoul/g810-led
#!/bin/bash
# Turn keyboard backlight on/off using https://github.com/MatMoul/g810-led
g413-led -a FFFFFF # always turn on on startup (it turns off for some reason on reboot)
dbus-monitor --session "type=signal,interface=org.gnome.SessionManager.Presence,member=StatusChanged" |
while read x; do
case "$x" in
*"uint32 3"*) g413-led -a 000000;;
*"uint32 0"*) g413-led -a FFFFFF;;
fun a() {
try {
b();
} catch (Exception e) {
// whatever
}
}
fun b() {
c();
@umpirsky
umpirsky / convert
Last active January 25, 2018 11:54
Nautilus script for converting subtitle encoding from Windows-1250 to utf-8
#!/bin/sh
# chardetect orignial
IFS_BAK=$IFS
IFS="
"
for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
iconv -f Windows-1250 -t utf-8//IGNORE $line > $line.tmp
@umpirsky
umpirsky / userContent.css
Last active November 2, 2023 17:19
Firefox dark theme workaround (https://bugzilla.mozilla.org/show_bug.cgi?id=519763) Inspired by https://wiki.archlinux.org/index.php/Firefox#Unreadable_input_fields_with_dark_GTK.2B_themes. Add it to ~/.mozilla/firefox/xxxxxxxx.default/chrome/userContent.css or using https://addons.mozilla.org/en-US/firefox/addon/stylish/ add-on. add-on.
input:not(.tactile-searchbox-input):not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']) {
-moz-appearance: none !important;
background-color: white;
color: black;
}
#downloads-indicator-counter {
color: white;
}
@umpirsky
umpirsky / tld-html
Last active January 15, 2016 07:56
Top level domains from iana.org
https://www.iana.org/domains/root/db
aaa
aarp
abb
abbott
abogado
ac
academy
accenture
accountant
Verifying that +umpirsky is my blockchain ID. https://onename.com/umpirsky