For something more sophisticated and less manual, use ekalinin/awsping. The below script will ping every region (or a subset of regions) and output the latency. Here’s the full list of AWS regions as of November 2022: Africa (Cape Town): af-south-1 Asia Pacific (Hong Kong): ap-east-1 Asia Pacific (Tokyo): ap-northeast-1 Asia Pacific (Seoul): ap-northeast-2 Asia Pacific… Continue reading Finding AWS region closest to your server with a shell script
Environment variable undefined in GatsbyJS?
If you’re trying to use an environment variable in your GatsbyJS HTML code and it keeps being undefined once you build, this could be because most environment variables are prevented from being rendered e.g. so that your private API key is not revealed by accident. If your variable does have to end up in the… Continue reading Environment variable undefined in GatsbyJS?
Git diff skip to next file?
If you need to do a git diff, but the first file it shows is a huge file, e.g. a Javascript library that got replaced, you can skip it in two steps: Type /^diff – to enter search mode with a slash and then search for diff – at the beginning of a line -… Continue reading Git diff skip to next file?
Kindle stuck on “Weak Battery” and won’t take charge
I haven’t used my kindle for a while and when I opened it, it gave me the "Batterie Faible" ("Weak Battery") error message, asking me to connect it to a power source, which made sense after a month of inactivity so I’ve put it on charger. However, an hour went by but the error didn’t… Continue reading Kindle stuck on “Weak Battery” and won’t take charge
How to jump to a specific git commit?
To jump to a specific commitId: git checkout <commitId> To return to the tip of the branch: git checkout <branchName>
European Low-End VPS by Country
Here’s a list of cheap VPS plans mostly across Europe. Useful for personal or VPN stuff.
Changing git settings to clear the diff output
If you’d like to have the output of git diff, git diff –staged etc. cleaned up after showing, instead of cluttering the terminal window, change the pager config as follows: git config –global core.pager 'less -+X -+F' As a result, each call to the above commands will be listed in a separate "window", which does… Continue reading Changing git settings to clear the diff output
Reword a commit message without changing the commit date
If you want to rebase-edit the commit message in an old commit, and keep the original commit date, you can do that using the –committer-date-is-author-date flag. Here’s how: Find your old commit that you want to edit and copy its hash Run git rebase -i hash^ Find your commit in the list that shows up… Continue reading Reword a commit message without changing the commit date
Quick and dirty Raspberry PI desktop
apt-get update && apt-get upgrade apt-get install –no-install-recommends xorg openbox lightdm fbpanel onboard Enable Desktop Autologin and HDMI audio sudo raspi-config Fix HDMI audio for old TVs sudo vi /boot/config.txt Autostart fbpanel: echo "fbpanel &" > ~/.config/openbox/autostart More: https://www.reddit.com/r/openbox/comments/7zizxn/cant_get_openbox_to_turn_off_antialiasing/
Openbox: Failed to open the display from the DISPLAY environment variable
Problem when running openbox-session: Openbox-Message: Failed to open the display from the DISPLAY environment variable. Solution: startx