Posts tagged: linux

All posts with the tag "linux"

Newsboat

Web browsers are a black hole of productivity. I try to use them as little as possible when it is time to focus. I try to use help, ?, or ?? with ipython, or –help at the command line as much as possible. What about that time I am trying to see what my online friends are posting on their sites? I used to used google reader quite heavily before that was taken down.

I am going to give a terminal rss reader a try for a bit and see how that goes for me. I have really struggled to get into an rss reader since google reader died.

I installed with the reccomended snap for Ubuntu.

...

Find and Replace in the Terminal.

grepr ¶ # grepr() {grep -iRl "$1" | xargs sed -i "s/$1/$2/g"} ```bash grepr() {grep -iRl "$1" | xargs sed -i "s/$1/$2/g"} grepd ¶ # grepd() {grep -iRl "$1" | xargs sed -i "/^$1/d"} CocSearch ¶ # :CocSearch published: false -g *.md

Creating Reusable Bash Scripts

Bash is a language that is quite useful for automation no matter what language you write in. Bash can do so many powerful system-level tasks. Even if you are on windows these days you are likely to come across bash inside a cloud VM, Continuous Integration, or even inside of docker.

I have three techniques that help me write more composable bash scripts.

Break scripts down into reusable components

...

New Machine for developing Tests with TestProject.io

Today I setup a new machine on Digital Ocean to use with TestProject.io, Here are my installation notes.

apt update && apt upgrade -y apt install zsh chsh zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" curl -fsSL https://starship.rs/install.sh | bash echo 'eval "$(starship init zsh)"' >> ~/.zshrc # python sudo apt update sudo apt install python3-pip -y echo 'alias python=python3' >> ~/.zshrc echo 'alias pip=pip3' >> ~/.zshrc # pipx apt install python3-venv pip install pipx pipx install black pipx install shell-functools pip install ipython # docker sudo apt update sudo apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt update sudo apt install docker-ce # docker-compose sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose # configure git git config --global user.name "Waylon Walker" git config --global user.email [email protected] # fzf git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf ~/.fzf/install # forgit git clone...

1 min read

Out of Space

This morning I logged into my machine and was nearly out of space

screenshot-2025-02-12T22-32-14-298Z.png

These are the commands that I often use to reclaim space. Its so easy to fill up small vm’s in the cloud, or in my case today let your dev machine go way too long without a good cleanup.

...

2 min read

Supercharge Zsh Startup

I have been using oh-my-zsh successfully for about 2 years now. But lately my startup time has been really bothersome. It has grown to the point where it was taking about 5.5s to startup a shell! This is ok if I am going to spend some time in here for awhile and do some work that benefits from all of the autocompletions, plugins, and shortcuts that oh-my-zsh brings. But to only jump in to run a handful of commands is infuriating.

I believe the real issue is io speed on wsl. I have some remote servers with similar configs that are 10x faster or more, loading in 100s of milliseconds rather than seconds. Sourcing all of the individual plugin files are just too much for it.

Quick side note: your zsh config is controled by your ~/.zshrc file. This file can source other files, load plugins, or run literally anything.

...

📝 Bash Notes

Bash is super powerful.

Show Remaining Space on Drives

df -h

show largest files in current directory

...