Skip to content

Instantly share code, notes, and snippets.

View 573's full-sized avatar

Daniel Kahlenberg 573

View GitHub Profile
@573
573 / readme.md
Last active March 12, 2017 12:59
find and convert flacs to mp3s

either

find ./ -type f -regextype posix-egrep -regex '.*(flac)$' -exec flac2m3 {} \;

flac2mp3 being the following script:

#!/bin/bash
args=("$@")
avconv -i "$args" -qscale:a 0 "${args[@]/%flac/mp3}"
@573
573 / leeter.hs
Created August 5, 2015 10:26
Funny enough - How I recovered my lost Keepass password (Windows version)
import Data.Char
import Data.List
-- here the potential variations/mutations on letters are stored/encoded
leets = ["oO0*;%&","aA4@;%&","lL1!;%&", "eE3;%&", "tT7;%&", "hHkK;%&", "iI1!;%&", "sS&5;%"]
leetchar c [] = nub [c, toUpper c, toLower c]
leetchar c (l:ls) = if c `elem` l then l else leetchar c ls
leet [] = return []
@573
573 / jdk-install.sh
Last active March 13, 2017 13:46
Windows-Packages worth a try
* chocolatey (packages available for chocolatey marked with Β§)
* XMing (chocolatey installs the needed Xming-fonts) Β§
* f.lux
* Powershell
* vagrant (additionally you'll need Virtualbox Β§) Β§
* Typora (distraction-free markdown editor)
* Heroku Toolbelt (at least brings a ruby distribution with it)
* pandoc (document conversion)
* pdftk (media extraction, decryption etc.)
* msys2 (shell related, even manpaging onboard)
@573
573 / gist:ceeeacbf6b9adfc7ef40
Created September 2, 2015 09:17
less +F logfile usage
ctrl-shift-c nav-mode
shift-f live-mode

After following the guidelines in the README until the point before "dbca -silent -createDatabase -responseFile /vagrant/dbca.rsp" (in case you already installed the instance to you might revert it with dbca -silent -deleteDatabase orcl) you might ask how to persistently store all the changes to the oracle container then. For the most of you those familiar with docker this should be no problem at all. For the rest of us let me explain very basically: You can stop the oracle container and then commit the changes in the container to a new image. After you restarted the vagrant machine and having run a new container with the respective image you will have to start oracle again. Probably all that can be automated but that's really out of the scope of that gist, so here is very basic chain of manual commands implementing the former pattern:

# first let's get some info about the running/stopped container(s)
sudo docker ps -a

let's say elated_wright is the name of the container with oracle

@573
573 / git list the contents of each of the stashes.sh
Last active October 7, 2015 10:18
git list the contents of each of the stashes
git show $(git stash list | cut -d":" -f 1)
@573
573 / readme.md
Last active October 7, 2015 12:06
Q&A: what does `@@ -201,6 +201,102 @@` in my patch file mean?
  • lets start with the 6 as in -201,6 + basically says 6 lines of context were needed to make the patch distinguishable and diminish the risk to apply to wrong file, 3 lines before and also after
  • the 201 as in -201...+201 added to the nr (3) computed in the step above marks the line nr in the modified document which contains line one of the after appliing the patch
  • the 102 as in +201,102 simply counts the lines added to the modified document after appliing the patch
@573
573 / gist:631a84bd0f7e757e54d9
Created October 11, 2015 10:50
shruthi-editor on ubuntu 14
git clone the repo (currently: commit 77590f7ccb9b4a551851fe7d18385452cfaa1f44)
apt-get install the deps: libasound2-dev qtbase5-dev qt5-qmake build-essentials
then in the folder with the sources:
# this helped here qtchooser -l
qmake -qt=5 -config release
@573
573 / This
Created November 18, 2015 17:01
On Ubuntu package librpmio3 wasn't removable nor reinstallable due to a failed install attempt...
This helped:
sudo apt-get update
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
sudo dpkg --remove --force-remove-reinstreq librpmio3
afterwards i could install openprinting-gutenprint to support our Brother HL2250DN printer.
@573
573 / gist:b33d65e214c35f8c8c9d
Created November 18, 2015 17:03
How to generate a two column ascii out of a one-column (i. e. for cheat sheets)
cat asciifile | pr -2 -t > asciifile-2cols