Skip to content

Instantly share code, notes, and snippets.

View marslo's full-sized avatar

marslo marslo

View GitHub Profile
@marslo
marslo / _spinner.md
Last active April 10, 2025 06:32
Spinner

Tip

for ansicolor, either using \033[XXm directly, or use following c() function as below:

# credit: https://github.com/ppo/bash-colors
# author: @ppo
# shellcheck disable=SC2015,SC2059
c() { [ $# == 0 ] && printf "\e[0m" || printf "$1" | sed 's/\(.\)/\1;/g;s/\([SDIUFNHT]\)/2\1/g;s/\([KRGYBMCW]\)/3\1/g;s/\([krgybmcw]\)/4\1/g;y/SDIUFNHTsdiufnhtKRGYBMCWkrgybmcw/12345789123457890123456701234567/;s/^\(.*\);$/\\e[\1m/g'; }

Braille Patterns Spinner

@marslo
marslo / ccm.sh
Last active April 7, 2025 22:58
ChatGPT GIt Commit Message Generator
#!/usr/bin/env bash
# shellcheck source=/dev/null disable=SC2155
#=============================================================================
# FileName : ccm.sh
# Author : [email protected]
# Created : 2025-03-21 03:34:24
# LastChange : 2025-04-07 15:23:48
# Description : ccm - [c]hatgpt [c]ommit [m]essage generator
# +----------------------+--------------------+------------+
# | ENVIRONMENT VARIABLE | DEFAULT VALUE | NOTES |
{"version":1,"resource":"file:///Users/marslo/iMarslo/job/code/re/sdk-release/vars/wrapper.groovy","entries":[{"id":"X0fn.groovy","timestamp":1743640609154},{"id":"WdKu.groovy","timestamp":1743640625380}]}
@marslo
marslo / jenkins-decrypt.py
Created March 10, 2025 22:22 — forked from menski/jenkins-decrypt.py
Decrypt jenkins password hashes
#!/usr/bin/env python3
# original: https://raw.githubusercontent.com/tweksteen/jenkins-decrypt/master/decrypt.py
# requires: pycrypto
import re
import sys
import base64
@marslo
marslo / cht.sh
Created February 15, 2025 00:22
use-bat-for-cht.sh
#!/bin/bash
# shellcheck disable=SC1117,SC2001
#
# [X] open section
# [X] one shot mode
# [X] usage info
# [X] dependencies check
# [X] help
# [X] yank/y/copy/c
# [X] Y/C
#         start with `+`
#             v
$ export PS4='+\033[37;2;3m(${BASH_SOURCE}:${LINENO})\033[0m: \033[35;2;3m${FUNCNAME[0]:+${FUNCNAME[0]}():}\033[0m '

$ bash -x diff.sh 
+(diff.sh:4):  set -euo pipefail
+(diff.sh:13):  array1=("key1" "key2" "key3" "key4" "key5" "key6" "key7" "key8" "key9" "key10")
+(diff.sh:14):  array2=("key1" "key3" "key4" "key2" "key5" "key6")
+(diff.sh:15):  array3=($(diff array1[@] array2[@]))
@marslo
marslo / tlrc-update.sh
Last active February 13, 2025 23:37
tlrc --update workaround
#!/usr/bin/env bash
# shellcheck source=/dev/null disable=SC2155
#=============================================================================
# FileName : tlrc-update
# Author : [email protected]
# Created : 2025-02-13 13:44:36
# LastChange : 2025-02-13 15:15:28
# Description : workaround for `error: io: invalid peer certificate: UnknownIssuer`
# @see https://github.com/tldr-pages/tlrc/issues/111#issuecomment-2657620327
#=============================================================================
@marslo
marslo / 0.11.0-dev-1668+g0985e784d8-Homebrew.full.log
Last active February 2, 2025 00:14
0.11.0-dev-1668+g0985e784d8-Homebrew.debug.log
This file has been truncated, but you can view the full file.
```bash
$ brew uninstall neovim && brew install --HEAD --force neovim -v --debug
Uninstalling /usr/local/Cellar/neovim/HEAD-0985e78... (2,045 files, 30.1MB)
==> Autoremoving 4 unneeded formulae:
lpeg
luajit
luv
unibilium
Uninstalling /usr/local/Cellar/lpeg/1.1.0... (14 files, 263.1KB)
@marslo
marslo / build-infozip-from-source.md
Last active December 12, 2024 10:11
build info-zip from source

get source

$ wget ftp://ftp.info-zip.org/pub/infozip/src/zip30.zip
$ unzip zip30.zip

apply patch

$ curl -fsSL https://gist.githubusercontent.com/marslo/70a3f6728633c49bed865da684378b31/raw/cf402112315ededbfb58c0e17629e9a74708e370/zipinfo.patch
$ cd zip30
@marslo
marslo / markdown-details-collapsible.md
Created September 11, 2024 03:10 — forked from pierrejoubert73/markdown-details-collapsible.md
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux