git clone https://git.samba.org/samba.git
brew install cmake gnutls jansson libarchive openssl pkg-config [email protected]
brew install readline && brew link --force readline
export CPPFLAGS="-I/usr/local/opt/libarchive/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl@3/include"
export LDFLAGS="-L/usr/local/opt/libarchive/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/openssl@3/lib"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apk add --no-cache curl jq | |
| PROJECT_ID=47716115 | |
| curl https://gitlab.com/api/v4/projects/$PROJECT_ID/releases/ | jq '.[]' | jq -r '.tag_name' | head -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --------------------------------------------------------------------- | |
| -- Converter between win-125x and UTF-8 strings | |
| --------------------------------------------------------------------- | |
| -- Written in pure Lua, compatible with Lua 5.1-5.4 | |
| -- Usage example: | |
| -- require("win-125x") | |
| -- str_win = utf8_to_win(str_utf8) | |
| -- str_utf8 = win_to_utf8(str_win) | |
| --------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir $(0..9 | % tostring 000 | %{"VGM_$_"+"0"}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function uvpn() { | |
| SECRET=$VPN_SECRET | |
| status_vpn=$(scutil --nc list | awk '{if (NR!=1) print$2}' | sed -e 's/[()]//g') | |
| if ! [[ $status_vpn ]]; then | |
| echo "no VPN settings found" | |
| return | |
| fi | |
| vpnName=$(scutil --nc list | awk 'BEGIN {ORS=" "}; {if (NR!=1) for(i = 7;i <= NF-1; i++) print$i}' | sed -e 's/"//g') | |
| vpnID=$(scutil --nc list | awk '{if (NR!=1) print$3}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import uuid | |
| import os | |
| import sys | |
| EXT_LIST = [".jpg"] | |
| def rename_file(path): | |
| path = os.path.abspath(path) | |
| print("Renaming...") |
-
install pv with Homebrew
brew install pv -
create tar archive, enjoy this nice progressbar
tar cf - ./FONTS -P | pv -s $(($(du -sk ./FONTS | awk '{print $1}') * 1024)) | > FONTS.tar -
the output will be like:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function calc_percentage () { | |
| mem="$1" | |
| total="$2" | |
| if [[ $mem -gt 0 ]]; then | |
| return $((mem * 100 / total)) | |
| else | |
| return 0 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Put this in ~/.vim/after/syntax/python.vim | |
| " Slight tweaks to https://lonelycoding.com/can-i-use-both-python-and-sql-syntax-highlighting-in-the-same-file-in-vim/ | |
| " Needed to make syntax/sql.vim do something | |
| unlet b:current_syntax | |
| " Load SQL syntax | |
| syntax include @SQL syntax/sql.vim |