Skip to content

Instantly share code, notes, and snippets.

@enblanco
enblanco / ANSI.md
Created February 5, 2024 21:51 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@enblanco
enblanco / netrw.txt
Created October 27, 2023 05:59 — forked from danidiaz/netrw.txt
Vim's netrw commands.
--- ----------------- ----
Map Quick Explanation Link
--- ----------------- ----
< <F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
<c-h> Edit file hiding list |netrw-ctrl-h|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
<c-r> Browse using a gvim server |netrw-ctrl-r|
<c-tab> Shrink/expand a netrw/explore window |netrw-c-tab|
@enblanco
enblanco / solve-no-pinentry
Created June 21, 2023 16:38
How to solve gopass throwing a "No Pinentry" error on macos
gpgconf --kill gpg-agent
@enblanco
enblanco / convert-textclipping-to-txt
Created August 20, 2022 09:41
convert macos .textclipping files to plain txt
textutil -convert txt *.textClipping
@enblanco
enblanco / git_empty_branch
Created March 8, 2022 12:49 — forked from j8/git_empty_branch
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory:
@enblanco
enblanco / tmux-cheatsheet.markdown
Created December 29, 2021 08:50 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@enblanco
enblanco / export-pass-secrets.md
Last active December 29, 2020 08:38
Export passwords from the `pass` password manager

Export passwords from the pass password manager

You can do this if you are running gpg-agent (and your passphrase is loaded). Looping through the files in your password store and writing them to a separate file.

You do have to strip the leading directories from the path ($PASSWORD_STORE_DIR) and the .gpg extension from each of the files in the subdirectories

@enblanco
enblanco / convert-flac-to-mp3.md
Last active December 29, 2020 08:43
Convert .flac to .mp3 with ffmpeg, keeping all metadata in OSX
for f in *.flac; do ffmpeg -i "$f" -ab 320K -map_metadata 0 -id3v2_version 3 "${f%.*}.mp3"; done
@enblanco
enblanco / m3u8
Last active September 30, 2020 20:28
Download m3u8 stream using ffmpeg
ffmpeg -user_agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/537.86.7" -i https://url.m3u8 -c copy output_file.mkv
@enblanco
enblanco / youtube-dl-download-audio.md
Last active October 31, 2018 19:45 — forked from umidjons/youtube-dl-download-audio-only-on-best-quality.md
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-o TEMPLATE - Output filename template

--extract-audio - extract audio track