Skip to content

Instantly share code, notes, and snippets.

Avatar

Chetan Kunte ckunte

View GitHub Profile
@ckunte
ckunte / ctb.py
Last active Apr 30, 2022
Testing ISO 19902:2020's Eq. 13.3-1 (Axial tension and bending)
View ctb.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
ctb.py -- Testing ISO 19902:2020's Eq. 13.3-1 (Axial tension and bending)
2022 ckunte
"""
import numpy as np
import matplotlib.pyplot as plt
@ckunte
ckunte / touchid-for-sudo.md
Created Jan 29, 2022
Touch ID for sudo command
View touchid-for-sudo.md

Touch ID for sudo terminal command

To use Touch ID in lieu of the admin password for sudo terminal command, edit /etc/pam.d/sudo file, add the following as the first uncommented line, and save.

auth    sufficient  pam_tid.so

It appears this setting is not carried-forward post a MacOS version upgrade. Edit, and add it again.

@ckunte
ckunte / mkmtm.sh
Created Dec 26, 2021
Compiling mtm from source
View mkmtm.sh
#!/usr/bin/env bash
if ! [ -d "./mtm" ] ; then
git clone --depth=1 https://github.com/deadpixi/mtm.git
fi
if [ -d "./mtm" ] ; then
cd './mtm' || return
git pull --ff-only
make clean
make CURSESLIB=curses
echo "Run sudo make install in './mtm' for a good compile."
@ckunte
ckunte / mkvim.sh
Last active Dec 26, 2021
Compiling Vim from source with Python3 interpreter enabled
View mkvim.sh
#!/usr/bin/env bash
if ! [ -d "./vim" ] ; then
git clone --depth=1 https://github.com/vim/vim.git
fi
if [ -d "./vim" ] ; then
cd './vim/src' || return
git pull --ff-only
make distclean
./configure --enable-python3interp
make
@ckunte
ckunte / zenclavier-extreme-keyboarding.md
Created Oct 30, 2021
Zenclavier: Extreme Keyboarding by Tom Christiansen
View zenclavier-extreme-keyboarding.md

Zenclavier: Extreme Keyboarding

by Tom Christiansen (12/01/1999)

He stands like a statue, becomes part of the machine Feeling all the bumpers, always playing clean Plays by intuition, the digit counters fall That deaf, dumb and blind kid sure plays a mean pinball.

—The Who

@ckunte
ckunte / raspberrypi-yubikey.md
Created Sep 9, 2021
Setting Raspberry Pi Desktop for U2F with YubiKey
View raspberrypi-yubikey.md
  1. sudo apt install libu2f-udev
  2. Download u2f.rules file
  3. Save the downloaded file under /etc/udev/rules.d/
  4. Upon system reboot, U2F should be available (say from Chromium browser)

Credits to Angela for the article Using Your U2F YubiKey with Linux

@ckunte
ckunte / vqm.csv
Created Jun 11, 2021
Vim quick manual (by @lilibasousa)
View vqm.csv
Topic Shortcut Description
Change mode Esc Exit edit mode
Change mode i Entry edit mode inserting on current position
Change mode I Entry edit mode inserting at the beginning of the line
Change mode a Entry edit mode inserting after the current position
Change mode A Entry edit mode inserting at the end of the line
Change mode o Entry edit mode inserting a line below
Change mode O Entry edit mode inserting a line above
Navigation :[0–9]+ Go to line (e.g. :9 goes to line 9)
Navigation G Go to the last line of the file
@ckunte
ckunte / localpub.md
Last active Apr 24, 2021
Publish using one git repository with three branches for three different sites respectively
View localpub.md

Publish using one git repository with three branches for three different sites respectively

Local set-up on my Mac

My static site generator of choice is chisel, and it resides at ~/Sites/chisel folder. Aside from master branch, which is the original upstream version (maintained by the primary author @dz), it has my three personalised (git) branches, viz.,

  1. ch -- A custom fork for publishing a family-oriented blog; uses posts from ~/Sites/posts
  2. ck -- A custom fork for publishing semi-professional articles; uses posts from ~/Sites/notes
  3. mc -- A custom fork for publishing weeknotes; uses posts from ~/Sites/wkly
@ckunte
ckunte / common.py
Created Nov 2, 2020
SACS commands common across its modules
View common.py
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Find most common sacs commands across modules, 2020 ckunte
import re
from collections import Counter
# read a file containing all sacs commands
commands = re.findall(r'\w+', open('sacs-commands-all.txt').read())
# print 85 most common commands across all sacs modules
mcom = Counter(commands).most_common(85)
for com, nos in mcom:
@ckunte
ckunte / tlp.csv
Created Oct 21, 2020
Tension leg platforms
View tlp.csv
Platform Operator Displacement (t) Topside weight (t) Water depth (m) Year installed
Hutton ConocoPhillips 61500 20792 147 1984
Jolliet MC Offshore Petroleum 16602 1950 536 1989
Snorre A StatOil 106000 43700 335 1992
Auger Shell 66224 21772 873 1994
Heidrun StatOil 290610 89000 345 1995
Mars Shell 49099 6532 894 1996
Ram-Powell Shell 49100 8100 980 1997
Morpeth Eni 10605 2817 518 1998
Ursa Shell 88451 20321 1159 1999