Max's Blog

Exploring Technology

Running a bash script on system start can be an involved process, depending on you distro. The proper way is to create a system service and plug it into /init.d but you can leverage the crontab if you want a simple quick way to run something on startup.

How to run a script on start up/reboot
Create Script
cd return to user home
vim startup.sh create script
chmod +x startup.sh Make script executable
crontab -e Edit crontab

Add the line
@reboot sh $HOME/startup.sh

Now your script will run on reboot.
Source Stack overflow thread

I was noticing high CPU usage for the pipewire process on Ubunutu.

After some digging, I came across this thread. The culprit is an accessibility feature in Firefox. If you are not using firefox’s speech synthases features you can disable it to drop CPU usage.

  1. Type about:config into the Address bar.
  2. Search media.webspeech.synth.enabled
  3. Set media.webspeech.synth.enabled to false.
  4. Restart Firefox and check pipwire process cpu usage

Sometimes you need to change the remote origin in a git repo, if the server moves or if you just get better at NGINX and change the URL to something cleaner. Here are the simple steps on how to update your remote origin.

List remote origins

git remote -v

Add new remote origin

git remote set-url add origin https://sweetNewDomain/git/user/RepoName

Remove old origin

git remote set-url delete origin 192.168.1.33:3030/git/user/RepoName

List remote origins again

git remote -v

Verify that your URLs are correct and do a git fetch make sure everything is working. On your next push, you will need to re-enter your username and password.
Nice work!

At some point I became infatuated with the SAMA IM01 Case. At only 22 liters, it can house an ATX power supply and a large cooler. I bought two! Thus began the journey of rebuilding both my PC and my unRaid server into smaller cases.

Server Going into the SAMA

Had to purchase an ATX motherboard for complete this one.
upload successful

Server Complete

Cramming three hard drives and an SSD into this case, with an ATX power supply wasn’t easy. I had to get creative with the mounting. Two are semi mounted on the bottom while the third is mounted into screw holes. There is an additional intake fan mounted below the PSU which was removed for this photo.
upload successful

PC going into SAMA

My PC was already pretty small, with an ATX board, so it wasn’t much trouble to transplant it. I couldn’t fit my favorite cooler, the NHD15 and had to switch to the Scythe Fuma.
upload successful

PC complete

All in all the build came out nice but I ended up being very frustrated with the noise and performance. I switched all the fans to the Noctua Noctua NF-P12 redux which are affordable and perform extremely well.
upload successful

Final picture of both of them before cleaning everything up

upload successful
All in all I’m extremely satisfied with how these PCs came out. There isn’t much advantage to stuffing everything into a smaller case. Its generally louder and hotter. The only thing you get is satisfaction.

a .nomedia file tells android to ignore folder contents

Tired of the contents of your android folders showing up in other applications?

For example, if you have an “audio-books” folder, you don’t want that appearing in your music app.
If you have a “spicy memes” folder, you don’t want that appearing in your photos app.

Android has a built in mechanism that tells the system “Hey, ignore the contents of this folder.” Simply browse into the folder (On your phone) and create an empty file, name that file .nomedia. Thats it! Android will now ignore that folder.

Sleep Linux Mint with this keyboard shortcut

CTRL + ALT + END

This shortcut was oddly challenging to find.
I hope others enjoy using it as much as I do.
Goodnight

This will walk you through installing a custom rom on your phone, updating the firmware and installing google apps. Then rooting your phone.

This tutorial is intended for a OnePlus 7 Pro, executed on a Debian based Linux machine but the same steps can be applied to windows. I’m running Linux Mint.

Any custom android rom requires an unlocked bootloader. If your bootloader is not unlocked, find a tutorial on how to do that.
If this is your first time installing the crDroid, you should factory reset your phone.

Install Android platform tools

Here is a good explanation on android debug bridge (ADB) and other tools -> https://wiki.lineageos.org/adb_fastboot_guide
Here is a link for platform specific setups.
https://www.xda-developers.com/install-adb-windows-macos-linux/#how-to-set-up-adb

On Linux you can just use a package manager to install the required tools:
sudo apt-get install android-tools-adb android-tools-fastboot

Download all required packages

Navigate to -> https://crdroid.net/guacamole/9 and Download:

  • Latest ROM click -> “Download latest version” button
  • Latest Firmware click -> “Firmware” button and download latest version
  • Latest Gapps click -> “Gapps” button -> Latest folder -> Download the Gapps version you need. If you are unsure, just grab “NikGapps-stock-…”
  • Latest Recovery -> Recovery -> Download Latest Version. If your recovery is not the crDroid recovery, download it now.

Testing your tools are set up correctly

Open a terminal window and type in adb --version make sure it prints out the version and the installed path. Do the same again with fastboot --version.

Its essential to have both fastboot and adb accessible and set up correctly or the firmware update script won’t work correctly.

Connect to your phone via USB and enable USB debugging

  • Grab your Phone. Make sure you enable USB Debugging in the developer menu.
  • On your machine run sudo adb devices
  • On your phone you should get a prompt, Allow USB Debugging? YES!
  • Your computer should list the connected devices. Now reboot your phone to the bootloader with the command
  • adb reboot bootloader your phone will restart to the bootloader.

Enter fastboot to install crDroid recovery

  • Plug in your phone and use command adb reboot fastboot to boot into fastboot.
  • Flash the crDroid recovery boot.img with command fastboot flash boot boot.img
  • Now restart to recovery with command fastboot reboot recovery
  • Make sure crDroid recovery installed correctly.

Enter fastboot to apply firmware update

  • Inside the bootloader, use the up/down volume buttons until the top says “Recovery Mode” press the lock button to select. The phone will boot into recovery mode.
  • Select “Advanced” -> “Enter Fastboot”
  • Your phone is now ready for the firmware update. On your computer, extract “OP7Pro firmware flash tool.zip” and enter the folder. You will see “Update-firmware.bat” and “Update-firwmare.sh”
  • On windows you can just double click “update-firmware.bat”
  • On Linux run the command ./Update-firmware.sh then follow the prompts on screen. (Yes to everything)
  • Once the update is complete, on your phone press “Enter Recovery”

Enter recovery to sideload packages

  • Inside the bootloader, use the up/down volume buttons until the top says “Recovery Mode” press the lock button to select. The phone will boot into recovery mode.
  • Select “Apply Update” -> “Apply from adb”
  • Your phone is now ready for packages from your computer.
    On your computer:
  • Update Rom: run the command adb sideload <crdroid update.zip>
  • Reboot to recovery again.
  • Update Gapps: run the command adb sideload <selected gapps.zip>
  • “Reboot system now”

Root your phone

  • Make sure you booted into your phone and unlocked it. Make sure all updates are complete.
  • Browse to -> https://themagisk.com/ and download the magisk.apk
  • Install the magisk.apk on your phone.
  • Reboot back into recovery adb reboot recovery and select “Apply Update” -> “Apply from adb”
  • Browse to -> https://themagisk.com/ on your computer and download the SAME magisk.apk
  • Rename “Magisk.apk” to “Magisk.zip”
  • Now sideload the apk straight into your phone adb sideload Magisk.zip
  • “Reboot system now”
  • On your phone, download and install the magisk.apk
  • You can now do rooted things.

Unable to mount error

  • If you see this error its because your data partition is encrypted. Do not worry about it. You can still access your phone with ADB.

Useful ADB Commands

  • Print a list of connected devices: adb devices
  • Kill the ADB server: adb kill-server
  • Install a package: adb install <path to apk or zip file>

Search text files in current directory and all sub directories. Its super fast so don’t worry if you have a node_modules directory or something.

Use this command:
grep -rnw '.' -e 'search text'

Trying to build your own keyboard? Here are some links!

Keyboard builds

List of open source, ergonomic keyboards
https://github.com/Ultrahalf/ergo-keeb

Keyboard builders digest - Great site for news and inspiration
https://kbd.news/

Shopping for parts

Little Keyboards - Low Cost boards with kits and low cost cases.
https://www.littlekeyboards.com/

Kriscable - In Europe but also has cool cables
https://kriscables.com/

Keebio - A little more expensive but offers pre-soldered boards for easier entry
https://keeb.io/

Insane ergo keyboards
https://bastardkb.com/

https://shop.beekeeb.com/

https://novelkeys.com/

https://mysticmechs.com/

https://boardsource.xyz/

Affordable Switches
https://divinikey.com/collections/switches
https://bolsakeyboardsupply.com/collections/all
https://en.akkogear.com/store/switch/
https://www.kailh.net/

High Quality key Caps

KBDFANS - https://kbdfans.com/collections/keycaps?filter.v.availability=1&filter.v.price.gte=&filter.v.price.lte=52&sort_by=created-descending
Keebmonkey - https://www.keebmonkey.com/collections/keycaps
KPREPUBLIC - https://kprepublic.com/collections/keycaps

Firmware and setup

QMK Configurator - Firmware modification and compilation in your browser
https://config.qmk.fm/#/lily58/rev1/LAYOUT

Via - Keyboard Configuration in browser
https://usevia.app/#/

My Builds

Lily58 Pro
upload successful

Quefrency Rev. 3
upload successful

Spare parts numpad.
upload successful

Quefrency with green LEDs and spare keycaps
upload successful

Another Quefrency! This one is for a friends birthday. Fun cat keycaps. The tape is to explain what the cat keys are before first use.
upload successful

Why am I building keyboards like this? -> https://www.youtube.com/watch?v=76eALNFp3kk

I’m building out a nutrition course that I’m calling:

The nutrition course you never got in Highschool

Understanding food, nutrition and metabolism

Eat well, feel great, have enegry, burn fat

Make food a delicious and poweful tool

  • Stop feeling bad about eating
  • Control cravings and binge eating
  • Optimize your diet for nutrition and fitness
0%