Skip to content

Instantly share code, notes, and snippets.

View codemedic's full-sized avatar
🙂
🙃

Dino Korah codemedic

🙂
🙃
View GitHub Profile
@codemedic
codemedic / gpg.md
Last active August 31, 2022 12:15 — forked from landro/gpg.md
Configure ssh-agent emulation in gpg-agent

Install gnupg

brew install gnupg
brew install pinentry-mac

Make sure you have gpg 2.1.20 or better

gpg --version
gpg (GnuPG) 2.1.20
@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 / 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 / upload.sh
Created January 16, 2018 10:33
Uploading files to S3 via bash with minimum deps (curl, openssl, base64)
#!/bin/bash
file="$1"
region="eu-west-1"
key_id="YOUR-AWS-KEY-ID"
key_secret="YOUR-AWS-KEY-SECRET"
path="some-directory/$file"
bucket="s3-bucket-name"
content_type="application/octet-stream"
date="$(LC_ALL=C date -u +"%a, %d %b %Y %X %z")"
@codemedic
codemedic / .bashrc
Last active October 3, 2021 11:26 — forked from chetanmeh/.bashrc
Script to launch commands in multiple tabs in KDE Konsole
[ -r ~/path/to/konsole-tabs.sh ] &&
. ~/path/to/konsole-tabs.sh
# Run multiple commands in individual tabs
commands_in_tabs() {
local cmd profile clear_first clear_cmd="" exit_new_tabs_afterwards exit_current_tab_afterwards title i
local sessions=()
: "${profile:="$(qdbus org.kde.konsole /Konsole defaultProfile)"}"
: "${clear_first:=1}"
{
"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
@codemedic
codemedic / README.md
Created July 25, 2016 14:46 — forked from markwalkom/README.md
CollectD to ELK

This is an example of using ELK to parse and view collectd data.

Caveat - I haven't fully tested this mapping yet, it doesn't take into account any other fields that may be added with other collectd plugins, just the ones I have specified below.

@codemedic
codemedic / kibana.json
Created July 25, 2016 14:25 — forked from untergeek/kibana.json
Simple Kibana dashboard for collectd stats
{
"title": "Collectd: Blackbox",
"services": {
"query": {
"list": {
"0": {
"query": "plugin:\"load\"",
"alias": "Load",
"color": "#7EB26D",
"id": 0,
@codemedic
codemedic / README.md
Created June 24, 2016 13:50 — forked from mmoulton/README.md
Docker Container Stats Collection Using Collectd

Docker stats collection for collectd

This script can be used to feed collectd with cpu and memory usage statistics for running docker containers using the collectd exec plugin.

This script will report the used and cached memory as well as the user and system cpu usage by inspecting the appropriate cgroup stat file for each running container.

Usage

This script is intented to be executed by collectd on a host with running docker containers. To use, simply configure the exec plugin in collectd to execute the collectd-docker.sh script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.