Skip to content

Instantly share code, notes, and snippets.

Andrej 4ndrej

Block or report user

Report or block 4ndrej

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
4ndrej /
Created Oct 14, 2019 — forked from evaryont/
A quick test to see if you have the JCE Unlimited Strength Jurisdiction Policy files installed. If you don't, in Java 6 you'll see 128. If you do, you'll see 2147483647. Thanks to
import javax.crypto.Cipher;
class Test {
public static void main(String[] args) {
try {
System.out.println("Hello World!");
int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
} catch (Exception e){
System.out.println("Sad world :(");
4ndrej / gist:6d58f2e9a77e1aa2581d21e39b4411d9
Created Nov 14, 2018
sublimetext ebook merge paragraphs regexp pattern
View gist:6d58f2e9a77e1aa2581d21e39b4411d9
sublimetext ebook merge paragraphs regexp pattern
search pattern:
replace pattern:
„Elfové a draci, řek jsem svýmu klukovi, zelí a brambory jsou pro nás
4ndrej /
Created Oct 1, 2018
stitch xva's Ref/* files into raw image
# stolen from now defunct
# To summarize the .xva format:
# - it's a tar file
# - it contains a folder
# - the folder contains chunks of 1MB each
# - they can be concatenated, but blank space needs to be filled
dd if=/dev/zero of=blank bs=1024 count=1k
4ndrej /
Last active Jun 6, 2018
bashrc git status
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
echo "[${BRANCH}${STAT}]"
echo ""
4ndrej / detect.js
Created Apr 27, 2018
detect mobile device using javascript
View detect.js
var isMobile = {
Android: function() {
return navigator.userAgent.match(/Android/i);
BlackBerry: function() {
return navigator.userAgent.match(/BlackBerry/i);
iOS: function() {
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
4ndrej /
Last active Mar 22, 2018
pfx to key/cer chain
# convert from pfx to passwordless key/crt chain
# based on
# params
# key
openssl pkcs12 -in $PFX -password pass:$PASSWORD -nodes -nocerts -out $OUT.key
4ndrej /
Created Feb 9, 2018
remmina decrypt oneliner
# this works only as oneliner
# stolen from comments to
python -c "import base64,sys;from Crypto.Cipher import DES3;pc=open('/home/andrej/.config/remmina/remmina.pref').read();pci=pc.index('secret=');secret=pc[pci:pc.index('\n',pci)].split('=',1)[1];cc=open(sys.argv[1]).read();cci=cc.index('password');password=cc[cci:cc.index('\n',cci)].split('=',1)[1];secret,password=base64.decodestring(secret),base64.decodestring(password); print[:24], DES3.MODE_CBC, secret[24:]).decrypt(password)" 1486132120333.remmina
# remmina config is at ~/.config/remmina/remmina.pref
# config files are at ~/.local/share/remmina/

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
4ndrej / lsusb 1871:7670
Created Jan 11, 2018
lsusb of USB microscope 1871:7670
View lsusb 1871:7670
# lsusb -d 1871:7670 -v
Bus 001 Device 126: ID 1871:7670 Aveo Technology Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
View go-lang-factorization-tests-multithreaded.go
package main
import (
func runInThread(wg *sync.WaitGroup, startFrom int64, numOfIterations int64) {
defer wg.Done()
You can’t perform that action at this time.