Skip to content

Instantly share code, notes, and snippets.

:octocat:
gitting things done

Dino Korah codemedic

:octocat:
gitting things done
Block or report user

Report or block codemedic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@codemedic
codemedic / README.md
Last active Jun 6, 2019
Linux-like terminal in Mac OS
View README.md

Linux-like terminal in Mac OS

Caveat: This was done in anger to aleviate my pain; There could be a better way to do this. Please do leave comments and suggestions.

This script is meant to be used as .bashrc, in order to make the transition from Linux to MacOS less painful. It makes available GNU tools and utils in your PATH so that they can be invoked effortlessly. It also allows you to leave an untainted terminal setup for anything very native to MacOS.

@codemedic
codemedic / bash-colors.sh
Created Apr 3, 2019
Utility function to print bash colour codes
View bash-colors.sh
# based on https://github.com/mathieu-aubin/c7repos/blob/master/functions/bash-colors
__print_color_row() {
local color
color=$(printf '%03d' "$1")
echo -ne "\\033[1;48;5;${color}m \\\\033[48;5;${color}m \\033[0m";
echo -ne "\\033[1;7;38;5;${color}m\\\\033[7;38;5;${color}m \\033[0m";
echo -ne " \\033[1;38;5;${color}m\\\\033[1;38;5;${color}m\\033[0m";
echo -ne " \\033[38;5;${color}m\\\\033[38;5;${color}m\\033[0m";
echo -ne " \\033[2;38;5;${color}m\\\\033[2;38;5;${color}m\\033[0m";
@codemedic
codemedic / kinesis-get-records.sh
Last active May 30, 2019
Get records from a AWS Kinesis Data Stream. It allows you to start iterating from a time in the past.
View kinesis-get-records.sh
#!/usr/bin/env bash
if ! aws_bin="$(which aws)" 2>/dev/null; then
echo "aws cli is missing; you can get it from https://aws.amazon.com/cli/"
exit 1
fi
if ! jq_bin="$(which jq)" 2>/dev/null; then
echo "jq is missing; you can get it from https://stedolan.github.io/jq/"
exit 1
@codemedic
codemedic / upload.sh
Created Jan 16, 2018
Uploading files to S3 via bash with minimum deps (curl, openssl, base64)
View upload.sh
#!/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 Aug 21, 2017
Build RPM from a git repo that uses git-flow (AVH)
View git-build-rpm.sh
#!/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")"
View clion64.vmoptions
-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 May 16, 2018 — forked from chetanmeh/.bashrc
Script to launch commands in multiple tabs in KDE Konsole
View .bashrc
[ -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}"
View 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:

View host_icons.example
{
"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 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
end
attr_reader :dir
You can’t perform that action at this time.