Skip to content

Instantly share code, notes, and snippets.


Dino Korah codemedic

View GitHub Profile
codemedic / .bashrc
Last active Oct 24, 2020 — forked from chetanmeh/.bashrc
Script to launch commands in multiple tabs in KDE Konsole
View .bashrc
[ -r ~/path/to/ ] &&
. ~/path/to/
# 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}"

Keybase proof

I hereby claim:

  • I am codemedic on github.
  • I am codemedic ( on keybase.
  • I have a public key ASBeG9h2YLQvxBVErQ4zzZIlPPBzG1-D3ldD2Pi4zI4S5go

To claim this, I am signing this object:

View host_icons.example
{"host":"", "icon":"red.png"},
{"host":"", "icon":"green.png"},
{"host":"", "icon":"yellow.png"},
{"host":"", "icon":"orange.png"},
{"host":"", "icon":"blue.png"},
{"host":"", "icon":"cyan.png"},
codemedic / zim-to-sn.rb
Created Nov 3, 2016 — forked from quad/zim-to-sn.rb
Import a (my) Zim notebook to Simplenote
View zim-to-sn.rb
#!/usr/bin/env ruby
require 'json'
require 'Simplenote'
class ZimDirectory < Hash
class ZimException < Exception
attr_reader :dir
codemedic /
Last active Nov 11, 2020
Docker network through host IPSec / Strongswan VPN
# Link up docker network via IPSec VPN on docker-host
# Usage: [dry_run=1] [debug=1] vpn-docker-fix [<a-docker-network>]
# Env Variables:
# dry_run - Set to 1 to have a dry run, just printing out the iptables command
# debug - Set to 1 to see bash substitutions
vpn-docker-fix() {
_log_stderr() {
echo "$*" >&2
codemedic /
Created Jul 25, 2016 — forked from markwalkom/
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 / kibana.json
Created Jul 25, 2016 — forked from untergeek/kibana.json
Simple Kibana dashboard for collectd stats
View kibana.json
"title": "Collectd: Blackbox",
"services": {
"query": {
"list": {
"0": {
"query": "plugin:\"load\"",
"alias": "Load",
"color": "#7EB26D",
"id": 0,
codemedic /
Created Jun 24, 2016 — forked from mmoulton/
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.


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 script. You may need to adjust the script to match your particulars, such as the mount location for cgroup.


Rate limiting with Redis

June 2011 - Chris O'Hara - (archived original post)

Rate limiting can be an effective way of conserving resources and preventing automated or nefarious activities on your site.

A common use case is to limit the amount of requests an IP can make over a certain time frame. For example, you might want to restrict users from using an expensive search utility on your site. If the user attempts to search more than 5 times a minute, you can redirect them to another page informing them that they need to wait.

IP based rate limiting is already in use on larger sites. Google and Yahoo both employ the technique to prevent (or at least complicate) automated requests to their services.

codemedic / FontFix RubyMine
Created Jan 8, 2016 — forked from leemour/FontFix RubyMine
Fixing font anti-aliasing for Ubuntu.
View FontFix RubyMine
# Change Java Runtime:
sudo update-alternatives --config java
# Delete Open-JDK
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
# Change fonts - remove hinting:
# Change RubyMine AntiAliasing first:
You can’t perform that action at this time.