Skip to content

Instantly share code, notes, and snippets.

View codemedic's full-sized avatar
🙂
🙃

Dino Korah codemedic

🙂
🙃
View GitHub Profile
@codemedic
codemedic / konsole-with-palette-colours.css
Last active July 14, 2023 13:56
CSS for KDE Konsole minimal, lighter, dark tabs
QTabBar,
QTabBar::tab
{
font-family: "Noto Sans";
font-size: 11px;
height: 16px;
padding: 2px;
border: 0px;
border-bottom: 3px solid palette(dark);
background-color: palette(dark);
@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 / kinesis-get-records.sh
Last active May 29, 2023 15:40
Get records from a AWS Kinesis Data Stream. It allows you to start iterating from a time in the past.
#!/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 / README.md
Last active March 29, 2023 12:34
Linux-like terminal in Mac OS

Linux-like terminal in Mac OS

Caveat: This was done as a quick-fix 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 / 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 / README.md
Last active April 5, 2022 01:39
Add SSH URL Handler for macOS
@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}"
@codemedic
codemedic / bash-colors.sh
Created April 3, 2019 09:03
Utility function to print bash colour codes
# 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 / # mpv - 2021-01-19_13-00-56.txt
Created January 19, 2021 13:11
mpv on Ubuntu 16.04.7 LTS - Homebrew build logs
Homebrew build logs for mpv on Ubuntu 16.04.7 LTS
Build date: 2021-01-19 13:00:56