Posts
-
Encrypted password storage
I recently came across a pretty neat tool for password storage. It is called password store. It is a command line tool for interacting with an encrypted password database, which uses GPG for encryption. There are plenty of tools around for accessing passwords, though the android app was unfortunately recently abandoned. Still, it’s useful for handling keys in the command line, without having API keys and the like pop up in the terminal history.
-
Use cookiecutter to stub projects
I tend to start a lot of small projects, and for some newer programming languages there are tools for quickly getting started with a new project. In particular Rust has
cargo
which is really convenient for getting started. With a simple call tocargo new
you will have a project directory set up, complete with a hello world program and everything you need to start building your program. -
Neovim over ssh tunnel
Every now and then I find myself wanting to work with neovim remotely. Sure, I can
ssh
, and then startnvim
and have it work that way. But there is some form of convenience of being able to just use the builtin server functionality. -
Personal vimhelp
I’ve been using vim and neovim for several years, and over the time I’ve accumulated several useful plugins. I do try to keep the amount of plugins to a minimum, as there are several reasons not to use plugins (security, setup, mental and computing overhead). Still, there are several really good plugins there, and they are part of what makes Vim and Neovim great.
-
Directory local variables with direnv
So I recently got notified about
direnv
which is a tool that allow you to set up directory local environmental variables. This is really handy for project directories which might need to point out local configurations and external tools. -
Setting up raspberry pi pico development
Last time I wrote about how to build a firmware image for the pico 2. This time the plan is to set up debugging using openocd, and hook it into my development environment
-
Blinky with raspberry pi pico on fedora
So I’ve just gotten one of the new raspberry pi picos version 2, and since it’s been a long time since I’ve been working with proper emdedded devices I wanted to take stab at getting a blinky program up and running. This is a good way to get started and familiarizing myself with the development environment.
-
Makefile tutorial
For some reason it seem that Makefiles has gotten the reputation that they are hard to use and learn, almost to the point that people just seem scared even to deal the slightest with them. Like it’s some kind of crazy magic of the old ones. At least in the linux world there are a lot of other build systems, where actually many of more popular acutally generate Makefiles. In my experience this is a bit harder to troubleshoot, as you both need to troubleshoot the system that generated the Makefile, and the generated Makefile itself. So having some knowledge on how Makefiles work is really handy.
-
Link Rust with C libraries
One feature I like about Rust is that you can directly call C functions. But since C requires manually deallocated resources and Rust does this for you there need to be some kind of glue layer between the two. This is in particular true if you work on something that allocates resources.
-
Ignoring variables
One thing that I often miss from C++ is the ability to easily ignore parameters. This is handy when you have an interface to adhere to, but you are not interested in all the parameters.
-
Creative error handling in C
Error handling in C is always something that have bothered me a bit. For code that handles allocated resources it is particularly hard. If you don’t have any allocated resources a good approach is usually something in the lines of the example below.
-
Reading lines in rust
I recently tried out an online coding game called CodinGame. It’s very similar to games like project euler, hackerrank, and advent of code. The main difference is that you have your program compete against other peoples programs. It is also more graphical than most other similar games, which also makes it really fun to watch.
-
Generator macros patterns in C
Usually I don’t like to use macros in C. Mostly because it’s fairly easy to obfuscate what the code does, and I would argue that the reason for choosing C is to be able to roughly see what each line translates to. However, macros also allow you to implement solutions that are otherwise hard to do, or very error prone.
subscribe via RSS