Skip to content

Instantly share code, notes, and snippets.

@nkabir
nkabir / dell.txt
Last active November 28, 2023 16:11
switch-configurations
admin@10.1.10.3's password:
dell-sw-0#do show configuration
% Error: Incomplete command.
dell-sw-0#do show running-config
Current Configuration ...
! Version 9.5(0.0P4)
! Last configuration change at Tue Nov 28 09:12:47 2023 by admin
! Startup-config last updated at Tue Nov 28 09:13:13 2023 by admin
!
boot system stack-unit 0 primary system: A:
@nkabir
nkabir / jump.sh
Created November 3, 2023 13:34
desktop-manager
#!/usr/bin/env bash
# workspace switcher for 1024 workspaces
declare -A ws=(
[mail-rk]=0 # rocketknowledge
[mail-bt]=1 # bulltrout
[mail-ag]=2 # arc global
[mail-rp]=3 # repurposeful
[im]=4 # messaging apps
[messaging]=4
[torrent]=5 # bitorrent
@nkabir
nkabir / normalise_environment.py
Created December 14, 2022 15:43 — forked from michalc/normalise_environment.py
Structured data in environment variables: nested dictionaries and lists
def normalise_environment(key_values):
''' Converts denormalised dict of (string -> string) pairs, where the first string
is treated as a path into a nested list/dictionary structure
{
"FOO__1__BAR": "setting-1",
"FOO__1__BAZ": "setting-2",
"FOO__2__FOO": "setting-3",
"FOO__2__BAR": "setting-4",
"FIZZ": "setting-5",
@nkabir
nkabir / docker-compose.yml
Created June 16, 2022 09:42 — forked from tomasfejfar/docker-compose.yml
Using YAML to reuse parts of existing docker-compose configuration
version: "3"
services:
apache: &apacheConfig
build: .
volumes:
- ./:/var/www/html:cached
- ./docker/php-apache/php.ini:/usr/local/etc/php/php.ini
- ./docker/php-apache/ssl-local:/etc/httpd/ssl
working_dir: /var/www/html
ports:
@nkabir
nkabir / mise-bootstrap.sh
Created July 19, 2021 18:32
Mise Bootstrap
#!/usr/bin/env bash
echo "Bootstrapping mise"
@nkabir
nkabir / Glassware.hy
Created December 1, 2020 17:46
Project Initialization
;; #############################################################################
;;
;; glassware.hy
;; glassware utilities
;;
;; #############################################################################
(import subprocess)
(import [autologging [logged]])
(import [bench.fp.util.path :as path])
(import [bench.fp.mount.YamlFileKit :as YamlFileKit])
@nkabir
nkabir / 01-netcfg.yaml
Last active October 16, 2023 05:36
libguestfs examples
# may be templated in the future
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
optional: true
@nkabir
nkabir / export-google-docs-to-restructured-text.js
Created March 30, 2020 12:22 — forked from simonw/export-google-docs-to-restructured-text.js
Google Apps script to convert a Google Docs document into reStructuredText
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Convert to .RST')
.addItem('Convert to .RST and email me the result', 'ConvertToRestructuredText')
.addToUi();
}
// Adopted from https://github.com/mangini/gdocs2md by Renato Mangini
// License: Apache License Version 2.0
String.prototype.repeat = String.prototype.repeat || function(num) {
@nkabir
nkabir / distribute_setup.py
Last active August 30, 2019 17:50 — forked from elijah/distribute_setup.py
legacy-distribute
#!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools, set a download

Keybase proof

I hereby claim:

  • I am nkabir on github.
  • I am nkabir (https://keybase.io/nkabir) on keybase.
  • I have a public key whose fingerprint is 28BC 437D 72D0 2D10 7C3B 2E85 D0B3 C03E 738A 1E0C

To claim this, I am signing this object: