Skip to content

Instantly share code, notes, and snippets.

View manojkarthick's full-sized avatar
powered by caffeine

Manoj Karthick manojkarthick

powered by caffeine
View GitHub Profile
#!/usr/bin/env bash
for i in {1..10}
do
curl -H "Accept: text/plain" https://icanhazdadjoke.com/ >> jokes.txt
echo -e "\n" >> jokes.txt
done
@manojkarthick
manojkarthick / headphones
Created January 31, 2022 01:23
Simple utility script to connect/disconnect bluetooth headphones
#!/usr/bin/env bash
SONY_ID="sony-wh-1000-xm4"
SONY_MAC="f8-4e-17-38-53-18"
PLT_ID="plantronics-bb-pro-2"
PLT_MAC="bc-f2-92-d4-11-25"
declare -A headphones
headphones["$SONY_ID"]="$SONY_MAC"
headphones["$PLT_ID"]="$PLT_MAC"
@manojkarthick
manojkarthick / create_compute_environment_and_job_queue.py
Created July 10, 2021 19:46 — forked from DaisukeMiyamoto/create_compute_environment_and_job_queue.py
Create compute environment and job queue for AWS Batch with Boto3 (Polling and Waiter implementations)
####################################################################
# Create compute environment and job queue for AWS Batch with Boto3
# Daisuke Miyamoto
# 20200330
#
import boto3
import botocore.waiter
from botocore.exceptions import WaiterError
import time
@manojkarthick
manojkarthick / macports.md
Created June 22, 2021 22:46
MacPorts migration index
Application Type Macports? Port Alternative
direnv formula yes direnv
fzf formula yes fzf
sqlite formula yes sqlite3
xz formula yes xz
gnu-getopt formula yes getopt
goenv formula no curl-style
k3d formula yes k3d
pqrs formula no
@manojkarthick
manojkarthick / steps.md
Created June 22, 2021 07:04
Using vagrant + vmware

To install vagrant with the vmware plugin, follow these steps:

  1. Download [VMware Fusion 12 Player][1] for macOS
  2. Use license key from your myVMware account and install the application
  3. Allow VMware Fusion to control system events within the app when prompted
  4. Enable the accessibility preference at System Preferences > Security & Privacy > Accessibility > VMware Fusion
  5. Install [vagrant][2]: brew tap hashicorp/tap && brew install vagrant
  6. Find the box you want to install from Vagrant [Cloud][3] or my boxes on [Github][4]
  7. Install the [vagrant-vmware-desktop plugin][5]: vagrant plugin install vagrant-vmware-desktop
  8. Install the [VMware utility][6] for vagrant: brew install --cask vagrant-vmware-utility
@manojkarthick
manojkarthick / merge.rs
Last active February 5, 2021 20:14
Merging parquet files
//
// WARNING: Not a complete executable program, this is for demonstration purposes
//
fn main() -> Result<(), CustomError> {
/// .. get input and output from the user
for input in inputs {
dump_contents(input, output)?;
}
@manojkarthick
manojkarthick / notes.md
Last active November 12, 2020 16:30
Git user management

I found this user management strategy somewhere, and it's been working great for me:

git config --global --unset user.name
git config --global --unset user.email
git config --global --unset user.signingkey

git config --global user.useConfigOnly true

git config --global user..name ""
@manojkarthick
manojkarthick / avro-tools.nix
Last active October 21, 2020 17:50
Sample nix derivations
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "avro-tools";
version = "1.9.2";
src = fetchurl {
url =
"https://repo1.maven.org/maven2/org/apache/avro/avro-tools/${version}/${pname}-${version}.jar";
@manojkarthick
manojkarthick / casks.sh
Created July 30, 2020 03:35
Casks install/uninstall
#!/bin/bash
# List of applications to operate on
# Make sure the name of the application matches the formulae on brew.sh
applications=(
1password
docker
firefox
google-chrome