[{"title":"Create Custom Functions in\u00a0Vim","url":"create-custom-functions-in-vim.html","tags":"vim ","body":"Create a custom command and function to create a new file in\u00a0vim. question on SO :h expand() :h %:h command! -nargs=1 Ms call s:NewFile(\u003cq-args\u003e)` function! s:NewFile(fp) echom a:fp execute \"e \" . \"~/foo/bar/\" . a:fp . \".ext\" endfunction"},{"title":"Vim Text\u00a0Objects","url":"vim-text-objects.html","tags":"vim ","body":"More better faster vim text\u00a0objects article about a\u00a0plugin"},{"title":"Delete from vim insert\u00a0mode","url":"delete-from-vim-insert-mode.html","tags":"vim ","body":"Vim - delete stuff without leaving insert\u00a0mode: \u003cC-h\u003e - same as\u00a0backspace \u003cC-w\u003e - delete previous\u00a0word \u003cC-u\u003e - delete everything before cursor (on same\u00a0row) \u003cC-d\u003e or \u003cC-t\u003e - (un)indent a\u00a0row inoremap \u003cC-e\u003e \u003cC-o\u003ede then: \u003cC-e\u003e - delete next\u00a0word"},{"title":"Global\u00a0Aliases","url":"global-aliases.html","tags":"alias, linux ","body":"If you want to alias a bunch of arguments for a command, use global\u00a0aliases alias -g foo=\"some complicated options\" then grep some complicated options becomes: grep foo https://www.thorsten-hans.com/5-types-of-zsh-aliases/"},{"title":"Vim yanked text\u00a0buffer","url":"vim-yanked-text-buffer.html","tags":"vim, linux, text ","body":"Vim - it\u2019s annoying when you delete something and overwrite your yanked\u00a0text. Use numbered registers! \"0 to \"9 \"0 contains the most recent yank. \"1 contains the most recent deleted\u00a0text \"0p - paste the most recent yank, even if you deleted something after yanking\u00a0it"},{"title":"ChezMoi\u00a0shortcuts","url":"chezmoi-shortcuts.html","tags":"dotfiles, alias ","body":"Chezmoi is a great tool for managing dotfiles. This is a shortcut to update the source state based on local\u00a0changes. chezmoi status | cut -c 4- | xargs -I % -p sh -c \u2018chezmoi add\u00a0~/%\u2019 project"},{"title":"Sleep Is\u00a0Good","url":"sleep-is-good.html","tags":"sleep, lifestyle ","body":"\u201cIt [sleep] enhances your memory and makes you more creative. It makes you look more attractive. It keeps you slim and lowers food cravings. It protects you from cancer and dementia. It wards off colds and the flu. It lowers your risk of heart attacks and stroke, not to mention diabetes. You\u2019ll even feel happier, less depressed, and less anxious.\u201d Dr. Walker - why we need to\u00a0sleep"},{"title":"Bash Strict\u00a0Mode","url":"bash-strict-mode.html","tags":"bash, linux ","body":"How to write robust bash\u00a0scripts: Bash Strict\u00a0Mode"},{"title":"How To Write An About\u00a0Page","url":"how-to-write-an-about-page.html","tags":"writing ","body":"An often recommended blog post by Kaleigh Moore about writing a good about\u00a0page."},{"title":"Domain Name\u00a0Registraars","url":"domain-name-registraars.html","tags":"web ","body":"Domain name\u00a0registries: https://namecheap.com\u00a0(cheap) https://instantdomainsearch.com\u00a0(variants) https://iwantmyname.com (tld\u00a0comparison)"},{"title":"Honest Troubleshooting Code of\u00a0Conduct","url":"honest-troubleshooting-code-of-conduct.html","body":"The Honest Troubleshooting Code of\u00a0Conduct"},{"title":"Linux\u00a0Directories","url":"linux-etsy-dir.html","tags":"linux, filesystem ","body":"linux directories: /etc (etsy) \u2192 \u201ceditable text config\u201d \u2192 a place to put config\u00a0files. Originally, the root directory had /boot for booting, /dev for devices\u2026 One dir for each type of thing. But this put config in many places. so etc/ became\u00a0convention https://www.pathname.com/fhs/pub/fhs-2.3.html"},{"title":"Browser\u00a0Security","url":"browser-security.html","tags":"xss, cors, http ","body":"Blog post about browser/Web-app security,\u00a0including: CSRF CORS HTTP Security\u00a0Headers"},{"title":"HTML\u00a0Templates","url":"html-templates.html","tags":"html, jam ","body":"HTML\u00a0templates: wickedtemplates.com cruip.com https://versoly.com/templates"},{"title":"Interview With Linus\u00a0Torvalds","url":"interview-with-linus-torvalds.html","tags":"linux, interview, linus ","body":"Interview with Linus\u00a0Torvalds: I don\u2019t want to claim that programming is an art, because it really is mostly just about \u2018good engineering\u2019. I\u2019m a big believer in Thomas Edison\u2019s \u2018one percent inspiration and ninety-nine percent perspiration\u2019 mantra. It\u2019s almost all about the little details and the everyday\u00a0grunt-work. But there is that occasional \u2018inspiration\u2019 part, that \u2018good taste\u2019 thing that is about more than just solving some problem - solving it cleanly and nicely and yes, even\u00a0beautifully."},{"title":"RPC\u00a0calls","url":"rpc.html","tags":"rpc, linux ","body":"A RPC is when an executable causes a procedure (subroutine) to execute on another computer, It\u2019s coded as if it were a normal (local) subroutine. You don\u2019t explicitly code the details for the remote interaction. You write the same code whether the subroutine is local or\u00a0remote."},{"title":"A useful\u00a0blog","url":"useful-blog.html","tags":"linux, shell, fzf, workflow, zsh, bash, builtin ","body":"Just found a really useful blog Interesting discussion about the difference between builtins and\u00a0executables, Nice examples of using fzf to improve workflows."},{"title":"lsblk\u00a0command","url":"lsblk-command.html","tags":"unix, cli ","body":"lsblk is a command to get info about connected\u00a0devices. Used when attaching\u00a0drives."},{"title":"Ranger file\u00a0manager","url":"ranger-file-manager.html","tags":"ranger, unix, vim, tools ","body":"Ranger is a console based file manager with vi key\u00a0bindings. Install it with brew install ranger Launch it with ranger"},{"title":"Vim\u00a0Regex","url":"vim-regex.html","tags":"vim, regex ","body":"This is a great article about using regular expressions in\u00a0Vim: marcelfischer.eu/blog/2019/checkbox-regex/"},{"title":"where\u00a0command","url":"where-command.html","tags":"unix, macos, cli, bash ","body":"Show all known locations of an executable where \u003cexecutable\u003e See a list of all builtin commands man where"},{"title":"alias to\u00a0real","url":"alias-real.html","tags":"macos, linux, cli, bash ","body":"Make aliased files the real\u00a0file for f in $(find . -type l -maxdepth 1); do cp --remove-destination $(readlink $f) $f; done;"},{"title":"tmux-window-reorg","url":"tmux-window-reorg.html","tags":"tmux, macos, linux, cli ","body":"Reorganize tmux\u00a0windows swap-window -s 3 -t 1"},{"title":"vim save\u00a0sudo","url":"vim-save-sudo.html","tags":"vim, macos, linux ","body":"Save a Vim file with sudo when you opened it without\u00a0sudo-ing: :w !sudo tee %"},{"title":"climbing\u00a0higher","url":"climbing-higher.html","tags":"advice, thoughts, meta ","body":"The trouble with climbing higher is that eventually you lose sight of the\u00a0ground."},{"title":"broot","url":"broot.html","tags":"broot, macos, cli ","body":"Broot is a tool that shows the contents of a directory on one screen, even its got lots of files or\u00a0sub-directories."},{"title":"Adding Keyboard\u00a0Navigation","url":"adding-keyboard-navigation.html","tags":"blog, jam, jquery ","body":"I added keyboard navigation to my blog and it works really well. Now I find myself trying to use the same shortcuts on other\u00a0sites."},{"title":"github actions\u00a0blog","url":"github-actions-blog.html","tags":"github, blog ","body":"I should see if I can use GitHub actions to generate html from markdown and run some shell and python\u00a0scripts."},{"title":"socially acceptable\u00a0mistakes","url":"socially-acceptable-mistakes.html","tags":"meta, thinking, advice ","body":"Its more socially acceptable to make mistakes and errors of omission than\u00a0commission."},{"title":"du\u00a0command","url":"du-command.html","tags":"cli, unix, macos ","body":"du is a tool for showing disk\u00a0usage. There is a similar tool, with a list of other similar tools here"},{"title":"safe bash\u00a0scripting","url":"safe-bash-scripting.html","tags":"bash ","body":"An example of a safe, good, robust bash file\u00a0skeleton."},{"title":"running a binary in\u00a0debian","url":"running-a-binary-in-debian.html","tags":"debian, binary, path ","body":"I was running a binary in Debian that was complaining about an environment variable not existing. I moved the binary into a \u0026dollar;PATH directory and logged in as a sudo user. Why did this solve the\u00a0problem?"},{"title":"creating\u00a0slowly","url":"creating-slowly.html","tags":"meta, thinking, advice ","body":"As a hacker, or creator, or whatever the best label is, I always want to create something (usually code) and have it\u00a0finished. But a strange creativity and productivity boost comes from dabbling, dipping in and\u00a0out. I think that if the technical challenges aren\u2019t too hard, then the main criteria for success is\u00a0creativity. Creativity needs time away from the project, and sleep, to bubble up and let ideas\u00a0grow. Ultimately, the most successful path is usually the most interesting, because success has more consequences than failure. \u201cInteresting\u201d requires elements of novelty and surprise, and without creativity these elements can\u2019t flourish.\u00a03/n Dabbling results in more creativity than 6+ hours of strenuous work, and is more likely to give you satisfying\u00a0results."},{"title":"arrow syntax in\u00a0bash","url":"arrow-syntax-in-bash.html","tags":"bash, syntax ","body":"bar \u003c\u003c foo bar will stop reading input when it reached\u00a0\u201cfoo\u201d. bar \u003c\u003c\u003c \"foo\" foo is all the input. bar wont run\u00a0interactively. bar \u003c \u003c(foo:list) process subscription. Kind of like piping in the output of multiple\u00a0commands. Stack\u00a0Overflow"},{"title":"pretty print json in\u00a0typescript","url":"pretty-print-json-in-typescript.html","tags":"typescript, json, syntax ","body":"Pretty print JSON console.info(`${JSON.stringify(foo, null, 2)}`);"},{"title":"useful\u00a0business","url":"useful-business.html","tags":"entrepreneur, saas ","body":"analystsnow.com looks like a really useful\u00a0business."},{"title":"frantic\u00a0distraction","url":"frantic-distraction.html","tags":"meta, thinking ","body":"Frantic distraction via productive procrastination is exhausting, and\u00a0useful."},{"title":"vim split\u00a0rearranging","url":"vim-split-rearranging.html","tags":"vim ","body":"Rearrange splits in\u00a0Vim \u003cC-w\u003ex - swap buffers, but keep arrangement the\u00a0same \u003cC-w\u003eH - make the current split cover the left of the\u00a0screen. J, K, L covers the bottom, top, right of the\u00a0screen"},{"title":"pelican plugin\u00a0guide","url":"pelican-plugin-guide.html","tags":"pelican, plugin, guide ","body":"A guide about writing plugins for\u00a0Pelican. Thanks\u00a0@geographeur"},{"title":"read and write same\u00a0file","url":"read-and-write-same-file.html","tags":"shell, pipe, syntax, bash ","body":"Tried to read and write the same file in a pipeline, and got caught out by a race condition (why is the file empty?!). Do this\u00a0instead: some_script \u003c file \u003e smscrpt.$$ \\ \u0026\u0026 mv smscrpt.$$ file || rm smscrpt.$$ || removes the temporary file if it\u00a0errors. $$ is the process ID and ensures that you always have a unique temporary file\u00a0name."},{"title":"json\u00a0tools","url":"json-tools.html","tags":"json ","body":"JSON\u00a0tools: jj - A stream\u00a0editor jq - A json\u00a0processor python -m json.tool I like jq for pretty printing JSON output, jj for making JSON pretty or\u00a0condensed. This was really useful when optimizing the search index for this\u00a0blog."},{"title":"docker\u00a0commands","url":"docker-commands.html","tags":"docker ","body":"Commands for working with Docker\u00a0containers. docker run -d ... docker logs -f \u003cID\u003e docker run -it ... docker run -itd docker container attach \u003cID\u003e \u003cC-p\u003e\u003cC-q\u003e -\u003e detach from container interactively stack\u00a0overflow"},{"title":"pipe a script files into\u00a0bash","url":"pipe-a-script-files-into-bash.html","tags":"bash, syntax, shell ","body":"Pipe a script file into bash, probably one you just curl-ed curl -sSfL https://example.com/install.sh | sh -s"},{"title":"split long output onto multiple\u00a0lines","url":"split-long-output-onto-multiple-lines.html","tags":"bash, linux ","body":"Split long output onto multiple lines (find and replace on\u00a0output) ... | tr \u0027:\u0027 \u0027\\n\u0027 ... | sed \u0027s/:/\\n/g\u0027"},{"title":"ripgrep\u00a0regret","url":"ripgrep-regret.html","tags":"ripgrep, fail ","body":"Without noticing, create a .gitignore file with a single * in\u00a0it. Spend a day trying to understand why ripgrep has stopped working for only 1\u00a0project. sad\u00a0face."},{"title":"teaching kids about\u00a0money","url":"teaching-kids-about-money.html","tags":"parenting, kids, money, teaching ","body":"Teaching my kids about money and work is having an\u00a0effect. Yesterday, my daughter made a painting for me and asked my to buy it using pretend\u00a0money."},{"title":"stop prepending sudo to docker\u00a0commands","url":"stop-prepending-sudo-to-docker-commands.html","tags":"sudo, docker, linux ","body":"Stop prepending docker commands with\u00a0sudo: sudo groupadd docker -\u003e make the group sudo gpasswd -a $USER docker -\u003e add $USER to the docker group newgrp docker -\u003e activate the changes"},{"title":"cat and a new\u00a0line","url":"cat-and-a-new-line.html","tags":"cat, linux, bash, shell ","body":"If you\u2019re cat-ing a file and the bash prompt doesn\u2019t start on a new line (cos the file you displayed using cat doesn\u2019t end with a new line char) the following will fix\u00a0it: cat \u003cfilename\u003e ; echo"},{"title":"creating users with sudo\u00a0permissions","url":"creating-users-with-sudo-permissions.html","tags":"sudo, linux, user, admin ","body":"Creating users with sudo\u00a0permissions: adduser -m \u003cusername\u003e usermod -aG sudo \u003cusername\u003e CentOS: adduser -m \u003cusername\u003e passwd \u003cusername\u003e usermod -aG wheel \u003cusername\u003e (wheel is a usergroup with sudo\u00a0permissions)"},{"title":"disk full and usage\u00a0commands","url":"disk-full-and-usage-commands.html","tags":"linux, du, df, shell, cli ","body":"df -h Show disk\u00a0space du -hs . See how big the current dir\u00a0is"},{"title":"cloning git repos using\u00a0lfs","url":"cloning-git-repos-using-lfs.html","tags":"git, git-lfs ","body":"Cloning large repos, or repos with large files in them, doesn\u2019t work with git clone ... you need to use git lfs clone ... So why is git lfs clone deprecated? What\u2019s the\u00a0replacement?"},{"title":"nohup","url":"nohup.html","tags":"linux, cli ","body":"Use nohup to keep a curl process running even when the terminal (tty?) session autocloses at\u00a03am."},{"title":"shell\u00a0comparisons","url":"shell-comparisons.html","tags":"zsh, bash, bsh, linux, cli ","body":"You can group shells into\u00a0groups: ksh - korn shell and\u00a0zshell sh - bourne shell and bash (the bourne again\u00a0shell) Because zsh isn\u2019t a superset of\u00a0bash. bash is a superset of the bourne\u00a0shell."},{"title":"emacs\u00a0dreaming","url":"emacs-dreaming.html","tags":"emacs, dream ","body":"Two nights ago, I dreamed I was experimenting with\u00a0Emacs.."}]