Skip to content

Instantly share code, notes, and snippets.

View codemedic's full-sized avatar
🙂
🙃

Dino Korah codemedic

🙂
🙃
View GitHub Profile
@codemedic
codemedic / natophon.sh
Created November 16, 2020 14:53 — forked from bradland/natophon.sh
NATO phonetic string converter for bash
#!/bin/bash
#########################################################################
# #
# #
# NATO String converter #
# #
# Description: converts string (first parameter given) #
# to NATO phonetics-alphabet #
# #
@codemedic
codemedic / bubbles.cpp
Last active September 28, 2020 19:07
Blow bubbles with C++
void
blow_bubbles_till(bool& condition)
{
static const char* sprite = ". o O @ *";
unsigned frame = 0;
while (!condition) {
boost::this_thread::sleep_for(boost::chrono::milliseconds(250));
std::cerr << "\r‗‗" << std::string(sprite + frame * 5, 5) << ' ';
frame = (frame + 1) % 5;
}
@codemedic
codemedic / RESTdoc
Last active June 9, 2020 08:24 — forked from coderofsalvation/RESTdoc
bash utility to generate REST-documentation from sourcecode comments
#!/bin/bash
#
# A quickndirty bash-utility to generate REST-documentation from sourcecode comments.
# (initially aimed at php-files, but js should also work)
# Basically its a c-style comment -> markdown -> html converter
# Dependancies:
# - awk
# - sed
# - bash
# - php
@codemedic
codemedic / README.md
Last active January 15, 2020 23:23
GPG Key Backup

Run pdflatex --shell-escape gpgbackup.tex to produce a pdf that you can print and lock away.

In order to recover the key, you will have to scan extract individual QR Codes with names IMGa.png, IMGb.png, IMGc.png and IMGd.png, as given in the name of each figure, then run the recovery commands.

NOTE: The above command WILL leave some artefacts in /tmp which should be removed using the command rm /tmp/IMG*png

PS: Original formula for this gist was from @costrouc.

@codemedic
codemedic / gpg2qrcodes.sh
Created January 15, 2020 14:27 — forked from joostrijneveld/gpg2qrcodes.sh
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
@codemedic
codemedic / clion64.vmoptions
Created July 26, 2017 18:10
CLion JVM options
-server
-Xms1G
-Xmx3072m
-Xss2m
-XX:MaxMetaspaceSize=1536m
-XX:ReservedCodeCacheSize=240m
-XX:MetaspaceSize=512m
-XX:+DoEscapeAnalysis
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:+UnlockExperimentalVMOptions
@codemedic
codemedic / git-build-rpm.sh
Created August 21, 2017 19:48
Build RPM from a git repo that uses git-flow (AVH)
#!/bin/bash
: "${branch:="$(git rev-parse --abbrev-ref HEAD)"}"
: "${tag_or_branch:="$branch"}"
spec=( *spec )
spec=${spec%%.spec}
# Relies on git-describe being functional; so git-flow AVH edition is essential
version="$(git describe --abbrev=0 "$branch")"
@codemedic
codemedic / keybase.md
Created March 1, 2017 14:07
keybase.md

Keybase proof

I hereby claim:

  • I am codemedic on github.
  • I am codemedic (https://keybase.io/codemedic) on keybase.
  • I have a public key ASBeG9h2YLQvxBVErQ4zzZIlPPBzG1-D3ldD2Pi4zI4S5go

To claim this, I am signing this object:

{
"path":"/home/foo/icons/",
"domain":"example.com",
"icons":[
{"host":"aaa.example.com", "icon":"red.png"},
{"host":"bbb.example.com", "icon":"green.png"},
{"host":"ccc.example.com", "icon":"yellow.png"},
{"host":"ddd.example.com", "icon":"orange.png"},
{"host":"eee.example.com", "icon":"blue.png"},
{"host":"fff.example.com", "icon":"cyan.png"},
@codemedic
codemedic / zim-to-sn.rb
Created November 3, 2016 01:27 — forked from quad/zim-to-sn.rb
Import a (my) Zim notebook to Simplenote
#!/usr/bin/env ruby
require 'json'
require 'Simplenote'
class ZimDirectory < Hash
class ZimException < Exception
end
attr_reader :dir