RSSAmplifier

Blog

Ruslan's Tech Blog

Software development related stuff

codelearn.meRSS feed ↗112 posts

Latest posts

GitHub stars inflation

Here is what I’m talking about: All these examples use a project called star-history . I saw an explanation from the author of this project that the idea is to provide the audience with a metric about how many stars a particular project have collected over time, which can indicate how active the project is. I can’t find this statement anymore. Stars as trust currency During my time…

I optimised my blog

I looked at my blog in the network tab and I saw this: The entire index page with css is smaller than the custom Inconsolata font I was enforcing on my website. The index page is 24.01KB (11KB compressed) and the font is 31.7KB (31.15KB compressed). Total size is 55.71KB . I relaised I should not override the font of my web site. Because people may have configured the monospace and other fonts in…

Emacs: goto-address-mode

In one of my previous blog posts I mentioned a command that returns the list of all open pull requests I have ever created on github: gh search prs --author @me --state open --json title,url --template '{{range .}}{{.title}} - {{.url}}{{'\n'}}{{end}}' I wrapped this command into krydos/show-my-prs elisp function that just executes the above’s snippet using async-shell-command . Here is its…

CMD vs CTRL philosophy on macOS vs Linux

I think macOS keyboard shortcut philosophy is superior to Windows or Linux. I don’t like Linux shortcuts They are very much the same as the Windows ones - which is funny considering the history between the two. The shortcuts are absolutely disrespectful to my hands. I have to move my palms constantly to do things. Examples Firefox (and other browsers) on Linux vs macOS On Linux, if I type my…

List all my open PRs on GitHub

If you open github.com you'll see the copilot chat interface. Apparently you can ask for assistance in there. For example, there is even a helper button for it, you can ask it to find all your open PRs. If you click My open pull requests it will helpfully type the request to the copilot for you in the textarea. Isn’t it handy? AI is just so much better, I don’t understand how some…

Can't find a good keyboard

I’m not a big fan of using a mouse because it forces me to move my hands from the home row. I have similar stance on trackpads, although they are a bit better. What really makes me feel good is trackpoints. They are probably less accurate but way more comfortable for me. Plus my workflow is mostly keyboard driven and I only need to move the cursor occasionally. Below is a list of keyboards I…

Makefile "define" keyword

I often use Makefile(s) as a task runner similar to Justfile or Taskfile . I do sort of understand the concept. I kind of know what target is and what dependencies are. I also know what .PHONY targets are because they are good use case for make targets that are used as tasks. But I have just discovered something new - the define is. Turns out define is a way in Makefile to define a multi line…

Some networking tips

I think I don’t understand computer networking really well so I’ve been playing with some related tech to improve my knowledge. Here are the interesting stuff I found. Broadcast address Sending UDP packets to 192.168.1.255 will make this UDP packet seen by every machine in my network. At least computers that are in 192.168.1.0/24 (which means a range from 192.168.1.0-192.168.1.254).…

Emacs: Dumb Jump Is So Good

There is a library I rely on constantly in my day to day computing, at work and at home. This library is called dumb-jump . I don’t see it is prized as often as Magit for example, which made me write this post. Below I explain what it does but first, let me thank to Jack Angers and all the contributors. I have used this library for 10 years. It is one of the best computer programs I have…

Migration from Syncthing to Unison

I spent quite a bit of time yesterday migrating from Syncthing to Unison . Why About six months ago, I decided to move away from Syncthing due to an ethical dilemma. Syncthing’s usability is amazing, and I love the software. I am sad that I had to make the migration, but very happy that Unison exists and works great. How the migration went It went smoothly (except one thing). Every operating…

Emacs: find-file-at-point trick

The story Sometimes I hover over a file path in my terminal emulator (in Emacs of course) and type M-x find-file-at-point . It’s nice command and it works reliably. I don’t want to type it though. I want Emacs to detect a file path at point. And there is a built in package for this. Just add this line to your init.el and it should work. (ffap-bindings) This makes C-x C-f keybinding to…

Useful Hledger

I’ve been using hledger since 2022. I started it as an experiment hoping to understand where my money goes, find some patterns in my spending and save some money eventually. I did not identify many patterns, if any, but I still was able to save some money. I’m going to describe how and why I find tracking money being useful and then I’ll show you my setup. Why is it useful to…

I have never subscribed to receive any marketing emails

It feels strange that I always receive a lot of marketing emails despite the fact that I never subscribed to any. I even feel like I have control over it because of that tiny “Unsubscribe” link that is always available. I locate it in less than a second, click it and bye bye little annoying email - you’re done. I can even detect the tricks from these unsubscribe tools when they…

Emacs: Keep journaling on the go

I’ve been journaling a lot for many years. It cools down my brain a little and helps me reflect on things better. Emacs and org-mode are of course the tools I use to journal. The problem I can’t easily journal on the go when I only have my phone handy. Solution I’ve built incredibly minimal web page with a simple form. When the form is submitted it is captured by a script, parses…

Newsticker - Emacs built-in RSS reader

I’ve been browsing Emacs’s The Info Directory (C-h i) the other day and came across a menu item called Newsticker . Turned out is a built-in RSS reader I never heard of. I know Emacs has Gnus which I tried to use as RSS reader before but didn’t succeed. Then, as probably most of Emacs users, I moved to Elfeed which is great. Here is how Newsticker looks like: isn’t it nice?…

Abandoning Gemini (the protocol)

I’ve been running my own Gemini capsule (web site) on my cheap DigitalOcean droplet for a few years. For those who doesn’t know what Gemini is: is a minimal web protocol (think of HTTP). It serves pages containing gemtext (think of HTML) which is super minimal too. No CSS. No JS. The whole vibe of it reminds me of the old web that I actually never been part of but romanticised it in my…

This blog has been migrated from Jekyll to Hugo

I have migrated this blog to Hugo yesterday. It was fun journey and I spent about 5 hours doing it. Why change Recently I bought a relatively cheap laptop which I decided to use as my “Productivity Laptop”. I have Void-Linux installed and I only run Emacs and Firefox on it. There are more to it but that’s maybe a story for another blog post. Long story short one of the outcomes…

Gemini Server in ~150 lines of Zig

I’ve been running my Gemini capsule for a few years and also recently I got interested in Zig programming language. Combining these two facts I came up with this Gemini Server implementation that is about 150 lines long (including comments). What I like Actually, the original idea was to implement it in Rust. And I started it in Rust. But after a few hours (spanned across multiple days) of…

Emacs: glasses-mode

Let’s say I have this code (TypeScript) with long camelCased variable names. I’m ok with camelCase variables especially if this is a convention for a language. But at the same time I find it a bit difficult to read compared to underscore_case style. Meet M-x glasses-mode . A beautiful minor mode that is there, built-in, since Emacs 21. Look what it does The mode doesn’t change…

Emacs: quick-calc

You probably have heard about famous emacs M-x calc . I always wanted to become a poweruser of it but never could. My needs are too simple for it, I just want to quickly add/subtract numbers. Recently I’ve discovered built-in M-x quick-calc which is perfect for what I need. It is already bound to C-x * q . You can quickly calculate what’s needed and the result is going to be saved to…

Emacs: which-function-mode

The problem I sometimes work with long functions or big org subtrees and it’s not always clear what function or org subtree I’m in right now. I wish there is a package that can show me what function I’m in. which-function-mode Turns out Emacs has this mode built-in so this functionality is just M-x which-function-mode away. It shows in the status line a function name I’m…

sandbox.smtp.mailtrap.io port 25 isn't available anymore

I can’t connect to port 25 anymore. I noticed it in a Laravel application but the issue exists for everyone. nc -vvv sandbox.smtp.mailtrap.io 25 just doesn’t connect. It’s been an issue for a few weeks now. To fix it just change the port 25 to 2525 (this one doesn’t require TLS).

Composer install - ignore php version constrains

Solution Just run this: composer install --ignore-platform-req = php Issue I often have an issue when after upgrading PHP to a newer versions I can’t do composer install anymore because one or more libraries haven’t updated their require.php section to support newer version of the language. Moreover, even if you manage to install new versions of those libs you still may have other…

Emacs: Did you know about IBuffer?

The problem Sometimes I use C-x C-b to get list of buffers so I can clean it up a little after some time. To do it I mark some buffers with d (to delete) and then press x . Today I wanted to filter that list of buffers to a particular project/folder and turned out I can’t. There is no way to filter *Buffer List* . IBuffer If you look up for Buffer Menu in EmacsWiki you’ll find the…

Emacs find-grep-dired: Filter files based on content

Intro We all need to search in files sometimes, right? I usually do it using grep -ri 'search term' . in the terminal (often in vterm-mode) and then I either open the file(s) in Emacs or in any other program. But Emacs has better solution to it. find-grep-dired There is M-x find-grep-dired already built-in to Emacs. If you call it from Dired buffer it will auto-complete the current folder and then…

Weechat is a lightweight IRC client

This is more of a joke post . Weechat is lightweight Weechat is incredible, terminal based IRC client, that I wanted to install recently on my FreeBSD instance. It’s lightweight . Here is log from my pkg install weechat : [ user@server ] # pkg install weechat Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 18 package (…

Emacs has built-in thread macros

Intro Surprisingly for me I just discovered that Emacs Lisp has equivalent of Clojure’s -> and ->> macros. And I’m not talking about dash.el . I’m talking about built-in thread-first and thread-last . What are these If you’re not familiar with these beautiful macros, the main goal is to pipe a value through multiple functions and return the result. -> passes a value as…

Emacs: A few issues of Org-Roam

Intro It has been almost a year since I started to use Org-Roam. I initially migrated from Obsidian even though I was incredibly happy with it. Recently I started to take more notes than usual and noticed that Org-Roam has some issues that for me aren’t critical but disturbing. Issues No build-in search functionality There is just no something like M-x org-roam-search . I’m pretty sure…

Org-mode archive with inherited tags

The issue By default only the tags directly attached to an org record will be saved in the archive file. I want to keep all the tags attached to an org record when I archive it, even the inherited ones. Explanation In org-mode tags are inherited by default. In case of org tree like this: * Header1 :tag1: ** Sub Header1 :subtag1: you may find that Sub Header1 has :tag1:subtag1: tags attached to it.…

Doom Emacs Search Documentation

Just a quick note on how easy it is to actually navigate Doom Emacs documentation and modules. I initially was a little afraid that I will not be able to understand what each Doom module does and there always will be some hidden functionaltiy that will be hard for me to find. Fortunately there is M-x M-x doom/help-search-headings that allows me to search through Doom documentation. Specifically it…

Doom Emacs - Turn LSP off by default for PHP files

I’m trying to get used to Doom Emacs and one issue I have is that LSP (in my case Eglot) starts automatically when I open up a php project. I don’t really like it because sometimes I open php files that I don’t need autocompletion for and I don’t want to remember that there is Eglot process now running that I have to stop to save some resources of my laptop. It happens…

Trying Doom once again

Almost a year ago I already tried to start using Doom config which I eventually replaced with my own vanilla config. Today I decided to try it once again. I also wanted to use it in Evil mode to make my hands feel better. One of my main pain point with someone else’s config is that I don’t know how to handle it, what options are available and why things work in the way they do. Since I…

Org Agenda - show archived records by default

If you didn’t know, there are two methods of archiving subtrees in Emacs’ Org-mode. Internal archiving (mark an item as ARCHIVED but keep it in the file) Moving subtrees (move an item or subtree to *_archive.org file) I often use the latter but the issue here is that all my items got disappeared from Org Agenda view when archived. You can tell Org Agenda to show archived records by…

Emacs & Wgrep

So I just discovered wgrep mode of a grep buffer in Emacs and it’s incredible. I often use projectile-ripgrep if I need to find something in the project I’m working on. But if I wanted to rename some variables or strings that I grepped I had to go and manually update them or use something like projectile-replace . But turns out there is wgrep mode that is available from…

Emacs 29 - Straight.el & Native compilation

I just built emacs-plus@29 on my MacOS using --with-native-comp just to see what it is and how it works. I’ll talk about my impression of it later. Let’s start with the issue. I use straight.el + use-package and as soon as I started my new Emacs instance I’ve got this: Debugger entered--Lisp error: (void-variable native-comp-deferred-compilation-deny-list)…

Search for hash(#) sign using Emacs' consult-grep

This is something I came across recently. I wanted to search for #todo using M-x consult-grep . My initial #todo query didn’t work obviously because # sign in consult is a punctuation character as they call it. I didn’t really want to change # sign as a punctuation character because I used to it. I’m not also sure if there is such an option (read til the end to find out why)…

Emacs. Change inner/outer like in Vim

If you’re a former Vim user there is one feature I couldn’t find in any other editors. Not sure what is the proper name of it but let’s call it change inside something . Example ( | - is a cursor): function () { return 'hello |world' } If I press ci' the result is going to be: function () { return '|' } or ci{ : function () { | } That’s incredibly useful feature because I…

Facebook webhooks won't accept Ngrok and Localtunnel anymore

If you want to test webhooks locally you probably use Ngrok or Localtunnel. I do. Recently I wanted to play with Instagram webhooks and I couldn’t because surprisingly Facebook do not accept Ngrok and Localtunnel URLs anymore and marks them as malicious and/or abusive . I don’t really understand why Facebook blocked the only known solutions of local webhooks testing. Fortunately I have…

MacOS Appearance Auto - theme isn't changing

I recently started to appreciate light theme again. Feels great during a day light. Still, I like the dark mode too but now I just want to see it at night. And fortunately, for those who likes both themes, there is a mode called “Auto” in the MacOS settings. Hooray! Problem solved. Not really In case you haven’t configured Night Shift feature then it’s not going to work.…

Eglot & PHP & Phpactor

Trying out eglot at the moment on a php project I have and unfortunately it doesn’t work out of the box. The issue is that my PHP project is based on PHP8 and php-language-server is pretty old server that doesn’t support new php versions. There are bunch of other LSPs for PHP and I would like to play with Phpactor which I never used before. Fortunately eglot supports any LSP server and…

Emacs ledger-mode with hledger

Hledger is a text based accounting tool. It’s very similar to Ledger (hence the name). Emacs has great ledger-mode but if you use Hledger you’ll definitely get some issues. TLDR here is my use-package block where most of the issues are solved ( use-package ledger-mode :straight t ;; or :ensure t :init (add-to-list 'auto-mode-alist ' ( '\\.\\(h?ledger\\|journal\\|j\\)$' . ledger-mode))…

Vim Tabs in Emacs

Immediately few things to mention. First: we’re going to talk about Tabs as in “UI element”. Not indentation. Second: Tabs in Vim and Emacs are not supposed to be used as tabs in many other editors. Vim Tabs Vim tabs aren’t supposed to be tabs similar to other editors where you have a file per tab and then switch those tabs with your mouse (???!). There are buffers for…

Ditching Doom

In my previous post I’ve been talking about Doom config and that it is great and all but I find it really difficult to fix issues there. Doom has a lot of its own configuration, hooks here and there and functions that modifies standard behavior. It’s probably much easier to go with my own config. I never could stick to spacemacs or doom. I couldn’t stick to similar configs in Vim…

Podman detach keys

TLDR; Add detach-keys = "ctrl-@,ctrl-q" to [engine] section in ~/.config/containers/containers.conf file Description I recently switched to Podman and the only issue I faced is CTRL+P won’t work properly inside containers. That’s exactly the same issue I had with Docker, described in my Docker detach keys post. The solution from that post doesn’t work since it was purely…

Getting back to Emacs

I do change my workflow from time to time to keep myself in shape. Now, once again, I’m trying to switch back to Emacs. This time I decided to go with Doom. I already tried to install use it but it didn’t work well for me and I didn’t bother to change the configuration. Main functionalities I need Quick search in a project That’s something I used ag for in my Vim. I could…

Use systemctl instead of service command

TLDR; service is less functional wrapper around systemctl command on systemd based distros. Details I’m a long time Linux user and got a habit to start/stop things using service command. I never really thought about what exactly it does. I mean, I know I can start Apache or something else with it and it’s something related to init system of my distro. Usually when you install Apache or…

Makefile -> Taskfile

Makefile I add a Makefile to every project I work with. I don’t usually work on C/C++ projects or any other compiled languages but Makefile is good to make aliases for long commands. Here is an example of short version of Makefile I use: .PHONY : up up : docker-compose up -d .PHONY : logs logs : tail -f ./storage/logs/*.log There are set of aliases / mnemonics that I used to: make up - start…

UMassCTF '21 Hermit 1 WriteUp

Solution There is only one form that accepts a file. The validation of the file is based on extension so we can try and upload shell.php.jpg image with content like this: <?= `$_GET[0]` ?> When image is uploaded we see the page like this: Click on See image and we see a blank page with some strange PHP errors. It&rsquo;s because our &ldquo;image&rdquo; expects get param called &ldquo;0&rdquo; so…

UMassCTF '21 Hermit 2 WriteUp

Solution The image above is what we see when visiting the challenge URL ( 104.197.195.221:8087 ) That&rsquo;s strange. Initially I thought the site is down but it&rsquo;s fine. Let&rsquo;s try to connect with NetCat and see what the server tell us and why browser can&rsquo;t display it. nc -vvv 104.197.195.221 8087 and response we get back is: 221.195.197.104.bc.googleusercontent.com…

Vim Fugitive. :Glog - show a commit author

TL;DR let g:fugitive_summary_format = "%<(16,trunc)%an || %s" The path of figuring that line out Vim-Fugitive is a great package. Recently I started to use :Glog command a lot to look at range of changes added to a branch after git pull. :Glog <hash>..<another hash> By default the command only shows a commit hash and its subject. I really wanted to see how can I show a commit author name as well.…