Skip to content

Instantly share code, notes, and snippets.

View codemedic's full-sized avatar
🙂
🙃

Dino Korah codemedic

🙂
🙃
View GitHub Profile
@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 / 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 / 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 / .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}"
@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
@codemedic
codemedic / vpn-docker-fix
Last active June 15, 2023 18:17
Docker network through host IPSec / Strongswan VPN
#!/usr/bin/env bash
# Link up docker network via IPSec VPN on docker-host.
#
# NOTE: This script can either be "sourced" into your .bashrc or executed directly. Be
# it sourced or executed, the usage syntax below is the same.
#
# Usage: [dry_run=1] [debug=1] vpn-docker-fix [docker-network-1 [docker-network-2 ...]]
#
# Env Variables:
@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,