Skip to content

Instantly share code, notes, and snippets.

View 4ndrej's full-sized avatar

Andrej 4ndrej

View GitHub Profile
@4ndrej
4ndrej / decrypt-remmina.sh
Created February 9, 2018 15:54
remmina decrypt oneliner
# this works only as oneliner
# stolen from comments to https://askubuntu.com/a/379545/123435
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 DES3.new(secret[: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
4ndrej / lsusb 1871:7670
Created January 11, 2018 12:12
lsusb of USB microscope 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
package main
import (
"fmt"
"math/big"
"sync"
)
func runInThread(wg *sync.WaitGroup, startFrom int64, numOfIterations int64) {
defer wg.Done()
@4ndrej
4ndrej / gradle2pom.sh
Last active October 26, 2016 08:28
gradle to maven deps filter
cat build.gradle\
| awk '{$1=$1};1'\
| grep -i "compile "\
| sed -e "s/^compile //Ig" -e "s/^testCompile //Ig"\
| sed -e "s/\/\/.*//g"\
| sed -e "s/files(.*//g"\
| grep -v ^$\
| tr -d "'"\
| sed -e "s/\([-_[:alnum:]\.]*\):\([-_[:alnum:]\.]*\):\([-+_[:alnum:]\.]*\)/<dependency>\n\t<groupId>\1<\/groupId>\n\t<artifactId>\2<\/artifactId>\n\t<version>\3<\/version>\n<\/dependency>/g"
# syncmaster at work
xrandr --output LVDS --mode 1680x1050 --output VGA-0 --mode 1600x1200 --left-of LVDS
@4ndrej
4ndrej / curlew-install.sh
Created April 7, 2015 12:36
curlew install
#!/bin/bash
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
yum -y install python ffmpeg mediainfo
curl https://codeload.github.com/chamfay/Curlew/zip/master -o Curlew-master.zip
unzip Curlew-master.zip
rm Curlew-master.zip
cd Curlew-master
python2 ./setup.py
cd ..
mkdir -p /home/liveuser/.curlew/
@4ndrej
4ndrej / idiff
Created March 4, 2014 23:09
svn diff | idiff
#!/bin/sh
# Color diff output, for human consumption
# License: LGPLv2
# Author:
# http://www.pixelbeat.org/
# Notes:
# If 2 parameters are passed, then they are passed to
# the `diff -Naru` command first. Otherwise the parameters
@4ndrej
4ndrej / infoq.sh
Created December 22, 2013 02:28 — forked from shirishp/infoq.sh
#! /bin/bash
# Author: Shirish Padalkar (https://twitter.com/_Garbage_)
if [ "$#" -ne 1 ]; then
echo "Usage: $0 infoq_presentation_url"
exit 1
fi
url_with_spaces=`curl -A "Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10" $1 | grep "<source src=" | tr -dc "[:print:]"`
@4ndrej
4ndrej / wfcmgr-12.1.0-0.x86_64.diff
Created December 9, 2013 11:40
Citrix Receiver for Linux (ICA client) patch for ability to autorun .ica files with space in filename. Patched wfcmgr script is located at ./ICAClient/wfcmgr
# diff -Naur wfcmgr.old wfcmgr
--- wfcmgr.old 2013-07-25 15:49:31.180136647 +0200
+++ wfcmgr 2013-07-25 15:50:10.153028280 +0200
@@ -143,7 +143,7 @@
if [ -f $HOME/.ICAClient/.eula_accepted ]
then
# EULA has been accepted on a previous occasion
- exec $ICAROOT/wfcmgr.bin $*
+ exec $ICAROOT/wfcmgr.bin $1 $2 "$3"
fi