Posts tagged: cli

All posts with the tag "cli"

100 posts latest post 2026-06-29
Publishing rhythm
Jun 2026 | 2 posts

How to Install micromamba on linux (from the comamnd line only)

I really like using conda () as my python virtual environment manager of choice. It’s simple and it includes its own python interpreter using the version that I specify at creation. Mamba # from their readme Mamba is a reimplementation of the conda package manager in C++. parallel downloading of repository data and package files using multi-threading libsolv for much faster dependency solving, a state of the art library used in the RPM package manager of Red Hat, Fedora and OpenSUSE core parts of mamba are implemented in C++ for maximum efficiency At the same time, mamba utilize the same command line parser, package installation and deinstallation code and transaction verification routines as conda to stay as compatible as possible. Installing Micromamba # Similar to miniconda micromamba can be installed with a few lines of bash Creating Environments with Micromamba # Creating new environments with micromamba is pretty similar to using conda. -c is required # I was unable to figure out…

Vim Wsl Clipboard

I’ve long used neovim from within windows wsl, and for far too long, I went without a proper way to get text out of it and into windows. wsl has access to cmd applications # wsl can access clip.exe. You can do some cool things with it, such as cat a file into the clipboard, sending output from a command to the clipboard, or set an autocmd group in vim to send yank to the windows clipboard. using clip.exe # Let’s say you want to send a teammate the tail of a log file over chat. You can tail the file into clip.exe. pipe streams of text into clip.exe make it a bit more natural # I recently made mine feel a bit more natural by aliasing it to clip. pop this in your ~/.bashrc or ~/.zshrc yanking to windows clipboard from vim # I use neovim as my daily text editor and its a pain to share code with a teammate over chat, stack overflow, into a gist, or whatever you need. The following snippet has been quite useful and flawless for me. add this to your ~/.vimrc or your ~/.config/nvim/init.vim Ws…

Quickly Edit Posts

Recently I automated starting new posts with a python script. Today I want to work on the next part that is editing those posts quickly. Automating my Post Starter Check out this post about setting up my posts with python 🐍 Enter Bash # For the process of editing a post I just need to open the file in vim quickly. I dont need much in the way of parsing and setting up the frontmatter. I think this is a simple job for a bash script and fzf. change to the root of my blog fuzzy find the post open it with vim change back to the directory I was in bash function # For this I am going to go with a bash function. This is partly due to being able to track where I was and get back. Also the line with nvim will run fzf everytime you source your file which is not what we want. Lets setup the boilerplate. Its going to create a function called ep, track our current directory, create a sub function. Then call that function and cd back to where we were no matter if fails or succeeds. boilerplate Creati…

If Tmux

I do much of my work from tmux, I love it so much that I want to setup some functionality that puts me in tmux even if I didn’t ask for it. Bash Function # Bash function to check if the shell is in a tmux session. Using the bash function # I often open up vim to do some quite edits, but before I know it I have several splits open and I need access to another shell utility, but I forgot to start in tmux. This function makes sure tht I start in tmux everytime. Using to ensure vim is opened in tmux. I am not quite sure if this is proper use of the and, let me know if you have a better way to do one thing if returns true and another if it returns faslse.

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,, 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. Newsboat # 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. installation # I installed with the reccomended snap for Ubuntu. Adding feeds # super simple Running help for newsboat directed me towards their config files at the bottom. I just need to edit its urls file. The Urls file is just a list of urls to rss feeds. Adding mine in allowed me to see all of my posts. Config # I took most of my config from a blog post that I found by Evan Travers. It set some sane defaults to the reading width and vim keys. GUI Browser # No m…

Ipython Ninjitsu

?docstring??sourcecode %run %debug %autoreload %history autoformat %reset!shell commands?docstring # Stop going to google everytime your stuck and stay in your workflow. The ipython is a superhero for productivity and staying on task. Note This does jump you into a pager, a j,k or up, down to navigate, q to quit.??sourcecode # Docstring not enough for you use case. I often run into cases where the docstring is not clear enough and I need to see the implementation for myself to see what a function does. %run # I turned my nose up at this one, prior to seeing the famous I don’t like notebooks by Joel Grus. My first snobby reaction was that developing modules and using autoreload was superior. I have since realized there is a place for, and it can cut down on some keystrokes to import, setup, and run even when developing in modules. %debug # ipython comes with a post-mortem debugger, and it can be a lifesaver. If we have a long running function that runs into an error it can be a complete…

Compare Directories In Bash

Today I needed to check for articles that used the same slug from two directories, bash made it super simple.

1 min

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. functions Arguments positional arguments All Arguments Error Handling main script Functions # Break scripts down into reusable components Functions in bash are quite simple. They are something that I wish I would have started using long ago. They make your code much more reusable. I often use them in my aliases as well since they can simplify the process and allow more flexibility. syntax Source the file to load the function and run it from the terminal. run it outputs Arguments # Make functions a little more flexible Arguments and options are quite a bit more complex in bash. For now, we will focus on the basics which are not all that…

How to Install miniconda on linux (from the command line only)

miniconda is a python distribution from continuum. It’s a slimmed-down version of their very popular anaconda distribution. It comes with its own environment manager and has eased the install process for many that do not have a way to compile c-extensions. It made it much easier to install the data science stack on windows a few years ago. These days windows are much better than it was back then at compiling c-extensions. I still like its environment manager, which installs to a global directory rather than a local directory for your project. Installing miniconda on Linux # Installing miniconda on Linux can be a bit tricky the first time you do it completely from the terminal. The following snippet will create a directory to install miniconda into, download the latest python 3 based install script for Linux 64 bit, run the install script, delete the install script, then add a conda initialize to your bash or zsh shell. After doing this you can restart your shell and conda will be ready…

025.md

setup

1 min

026.md

setup

1 min

023

Find and replace Groups in VSCode $1 referrs to the second group

1 min

022

_

1 min

021

_

1 min

020

_

1 min

019

1 min

006

Setup ** for _

1 min