Skip to content

Instantly share code, notes, and snippets.

View kahidna's full-sized avatar

Kun Alfin Hidayat kahidna

View GitHub Profile
@kahidna
kahidna / commands.vim
Created November 16, 2022 02:13 — forked from eddking/commands.vim
Vim normal mode commands as a Unite.vim menu
let g:unite_source_menu_menus.commands.command_candidates = [
\['▷ record a macro q', 'normal q' ],
\['▷ move forward one word w', 'normal w' ],
\['▷ move to the end of the prev word e', 'normal e' ],
\['▷ replace the character underneath the cursor r', 'normal r' ],
\['▷ move forward till the next character typed t', 'normal t' ],
\['▷ yank/copy y', 'normal y' ],
\['▷ undo u', 'normal u' ],
\['▷ enter insert mode i', 'normal i' ],
\['▷ open a new line underneath the current li
@kahidna
kahidna / Dockerfile
Created March 16, 2022 00:09 — forked from bskaggs/Dockerfile
Install pyarrow on alpine in docker
FROM python:3.7-alpine3.8
RUN apk add --no-cache \
build-base \
cmake \
bash \
jemalloc-dev \
boost-dev \
autoconf \
zlib-dev \

Useful LXD commands

Summarized from https://stgraber.org/2016/03/19/lxd-2-0-your-first-lxd-container-312/.

Interestingly, the LXD command line client is named.... lxc!

List available containers

lxc image list ubuntu:        # ubuntu: is officially supported image source
lxc image list images:        # images: is an unsupported source
lxc image alias list images:  # lists user-friendly names
@kahidna
kahidna / bot.rb
Last active July 1, 2021 04:57 — forked from dideler/bot.rb
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@kahidna
kahidna / bigdashboard_output.pdf
Created March 15, 2021 08:12 — forked from svet-b/bigdashboard_output.pdf
PDF export of Grafana dashboard using puppeteer
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kahidna
kahidna / kubedump.sh
Created July 27, 2020 03:32 — forked from negz/kubedump.sh
Dump Kubernetes cluster resources as YAML
#!/usr/bin/env bash
set -e
CONTEXT="$1"
if [[ -z ${CONTEXT} ]]; then
echo "Usage: $0 KUBE-CONTEXT"
exit 1
fi
@kahidna
kahidna / best_bash_prompt.sh
Last active May 11, 2021 06:46 — forked from ckabalan/best_bash_prompt.sh
The Best Bash Prompt My Version
# Bash History Replacement Script
# Author: Caesar Kabalan
# Last Modified: June 6th, 2017
# Description:
# Modifies the default Bash Shell prompt to be in the format of:
# [CWD:COUNT:BRANCH:VENV]
# [USER:HOSTNAME] _
# Where:
# CWD - Current working directory (green if last command returned 0, red otherwise)
# COUNT - Session command count
@kahidna
kahidna / grafana_telegram_bot.md
Created May 8, 2020 09:51 — forked from ilap/grafana_telegram_bot.md
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@kahidna
kahidna / roulette.sh
Created March 26, 2020 02:44 — forked from mjkaufer/roulette.sh
Bash Roulette
alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && rm -f $(shuf -n1 -e *) && echo "BOOM" || echo *Click*'
@kahidna
kahidna / README.md
Created April 26, 2019 11:16 — forked from oodavid/README.md
Restore MySQL from Amazon S3

Restore MySQL from Amazon S3

This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it

Sister Document - Backup MySQL to Amazon S3 - read that first

1 - Set your MySQL password and S3 bucket, make a temp dir, get a list of snapshots

# Set our variables

export mysqlpass="ROOTPASSWORD"