Posts

Useful aliases

alias ll="ls -lah" alias branch="git branch" alias checkout="git checkout" add() { # Colors GREEN="\033[32m" RED="\033[31m" YELLOW="\033[33m" BLUE="\033[34m" RESET="\033[0m" # Arrays for summary added_files=() skipped_files=() # Get changed files (including renamed, deleted, etc.) mapfile -t files commit() { echo "Enter commit message (Ctrl+D to finish):" msg=$(cat) git commit -m "$msg" } git_push() { # Colors RED="\033[0;31m" GREEN="\033[0;32m" CYAN="\033[0;36m" YELLOW="\033[1;33m" NC="\033[0m" CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" git fetch origin "$CURRENT_BRANCH" >/dev/null 2>&1 echo -e "${CYAN}Commits to push on $CURRENT_BRANCH:${NC}" git log origin/$CURRENT_BRANCH..$CURRENT_BRANCH --oneline || echo "No upstream ...

Start all Docker containers

To start (bring up) all existing Docker containers , use this: docker start $(docker ps -aq) Explanation docker ps -aq → lists all containers (running or stopped) docker start → starts stopped containers If you are using Docker Compose From the directory with docker-compose.yml: docker compose up -d Or for multiple compose projects (containers already created): docker compose start Useful checks See all containers and their status: docker ps -a See only running containers: docker ps Common gotcha (based on your recent Docker issues) If you see access forbidden , it means: Image not pulled (private registry) Not logged in Login first: docker login Then retry: docker start $(docker ps -aq)  

Back up from Android to OneDrive with rclone

Backing up your Android device to OneDrive is easy using rclone . Even if your OneDrive account has two-factor authentication (2FA) , rclone works perfectly by authorizing once through a web browser. Step 1 — Install rclone in Termux pkg install rclone Step 2 — Configure OneDrive Run the following command: rclone config Answer the prompts as follows: New remote: n Name: onedrive Storage: OneDrive Client ID: press Enter Client Secret: press Enter Edit advanced config? n Use auto config? n (important on Android) After choosing No for auto config, rclone will show a long URL. Copy the URL Open it in your Android web browser Sign in to OneDrive and approve access Copy the verification code Paste it back into Termux Two-factor authentication works normally during this step. Step 3 — Test the OneDrive Connection rclone lsd onedrive: If your OneDrive folders appear, the setup is complete. Step 4 — Backup Using ...

Using NextDNS to block ad on Android

Here’s a full guide to understanding NextDNS — what it does, how to set it up on your Android device (and elsewhere), and tips to get the most out of it. What is NextDNS? NextDNS is a cloud-based DNS filtering and security service. According to its website, it: Blocks ads, trackers, malicious domains, phishing, cryptojacking and more. Works across all devices and networks (WiFi, mobile, public hotspots) Supports modern DNS encryption protocols (DNS-over-TLS, DNS-over-HTTPS) for better privacy. Provides customization: blocklists, allow-lists, content categories, parental controls, logging & analytics. In short: it works like a “smart hosts file + firewall” but at the DNS level, meaning you don’t need root or filesystem hacks. How to set up NextDNS on Android STEP 1 — Create your NextDNS profile Go to: https://my.nextdns.io Create an account (free) You will see a profile ID like: abcd12.dns.nextdns.io This ...

Run termux script using macrodroid

Running a Termux script from MacroDroid is best done using the Termux:Tasker plugin. Despite the name, this plugin works perfectly with MacroDroid. Prerequisite: The "F-Droid" Rule Critical: You must install both Termux and the Termux:Tasker plugin from F-Droid . If you installed Termux from the Google Play Store, it will not work because the Play Store version is outdated. Action: Uninstall the Play Store version and install the latest versions from F-Droid. Step 1: Set up the Termux Environment Open Termux. Create the mandatory folder for external scripts: mkdir -p ~/.termux/tasker Move your script to this folder (or create a new one there). Example: nano ~/.termux/tasker/myscript.sh Important: Make the script executable. chmod +x ~/.termux/ta...

Disable accessibilty and Developer mode to run app

APP="com.banking.app" # Turn OFF Developer Options (UI only, does not reset settings) ~/rish/rish -c "settings put global development_settings_enabled 0" # Backup the current accessibility services ORIGINAL=$(~/rish/rish -c "settings get secure enabled_accessibility_services") echo "Original accessibility services:" echo "$ORIGINAL" echo "Disabling all accessibility services..." ~/rish/rish -c "settings put secure enabled_accessibility_services \"\"" ~/rish/rish -c "settings put secure accessibility_enabled 0" echo "Launching $APP..." ~/rish/rish -c "monkey -p $APP -c android.intent.category.LAUNCHER 1 >/dev/null 2>&1" echo "Waiting for $APP to close..." while true; do     TOP=$(~/rish/rish -c "dumpsys activity activities | grep mResumedActivity | grep $APP")     if [ -z "$TOP" ]; then         break     fi     sleep 1 done echo "$APP...

Archive and Unarchive app using rish

Archive and Unarchive App Using Rish To archive: ~/rish/rish -c 'pm archive --user 0 com.example.app' To unarchive: ~/rish/rish -c 'pm request-unarchive --user 0 com.example.app' This will unarchive from Play Store. To backup and restore locally: Archive and backup: # Create backup folder ~/rish/rish -c "mkdir -p /data/local/tmp/com.example.app" # Delete old backup ~/rish/rish -c "rm -f /data/local/tmp/com.example.app/*" # Copy all APK files for p in $(~/rish/rish -c "pm path com.example.app" | cut -d: -f2); do ~/rish/rish -c "cp "$p" /data/local/tmp/com.example.app/" done # Archive ~/rish/rish -c "pm archive --user 0 com.example.app" exit Restore: PACKAGE="com.example.app" APK_DIR="/data/local/tmp/com.example.app" # Install / unarchive with Play Store as installer SESSION=$(~/rish/rish -c "pm install-create -i com.android.vending" | awk -F'[][]...

Open app using rish

~/rish/rish -c 'monkey -p com.example.app 1'

Disable battery optimization with rish

 ~/rish/rish -c 'dumpsys deviceidle whitelist +com.example.app'   Example: ~/rish/rish -c 'dumpsys deviceidle whitelist +com.arlosoft.macrodroid'  

Turn off and on Developer options without losing any setting with risk

 ~/rish/rish -c 'settings put global development_settings_enabled 0' ~/rish/rish -c 'settings put global development_settings_enabled 1'

Enable all accessibility services with rish

This method is for Samsung devices. First, dump all accessibility services: ~/rish/rish -c 'dumpsys accessibility' > dump.txt This saves the output to dump.txt . Make sure your rish path is correct or added to PATH . In the dump output, look for: installed services: You can ignore the first few com.samsung.xxx entries. The rest will look like: com.anydesk.adcontrol.ad1/com.anydesk.adcontrol.AccService com.arlosoft.macrodroid/.triggers.services.MacroDroidAccessibilityServiceJellyBean com.arlosoft.macrodroid/.action.services.UIInteractionAccessibilityService com.catalinagroup.callrecorder.helper/com.catalinagroup.callrecorder.service.AnyCallListenerService com.eset.ems2.gp/com.eset.commoncore.core.accessibility.CoreAccessibilityService org.skvalex.cr/.full.service.MyAccessibilityService Combine them into one line, separated by : and ending with a trailing : (important for One UI): ~/rish/rish -c 'settings put secure enabled_accessibility_services ...

Grant all permissions with rish

~/rish/rish -c '      PACKAGE="com.your.package.name"      dumpsys package $PACKAGE | grep -oE "android.permission.[A-Z_]+" | while read PERMISSION; do           pm grant $PACKAGE $PERMISSION      done '

Create rish shortcut on Home Screen

Install  Shizuku  from GitHub (not playstore vesion) Install Termux (Terminal emulator with packages) from F-Droid Install Termux:Widget (Launch Termux commands from the homescreen) from F-Droid  Make sure your Shizuku can be run on boot using Wireless ADB (look up for it) In Shizuku, click "Use Shizuku in terminal apps" Click "Export files" Export anywhere, like in Download/rish  Run Termux Type "termux-setup-storage" Copy both files exported from Shizuku mkdir ~/rish  cp ~/storage/shared/Download/rish/* ~/rish  Edit rish as instruction on Shizuku nano ~/rish/rish Press CTRL + \  Type PKG Press Enter Type com.termux Press Ctrl + O Press Enter Press Ctrl + X Change rish permission chmod +x ~/rish/rish Create shortcuts folder mkdir ~/.shortcuts Create your shortcut file in  .shortcuts folder Example:  To archive and unarchive Macrodroid nano ~/.shortcuts/archive_macrodorid.sh ~/rish/rish -c 'pm archive --user 0 com.arlosoft.macrodroid' Sa...

Install APK on Windows Subsystem for Android (WSA) using command-line adb tool

Enable Developer mode in the WSA settings Type adb connect 127.0.0.1:58526 (or use the IP address shown in the WSA settings) and press Enter. A firewall prompt may appear; allow it. Type adb install "path\to\your\app.apk" (replace with the actual path to your file) and press Enter. The app will appear in your Start menu. 

Remove Gallery from File Explorer navigation pane in Windows 11

 Delete Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{e88865ea-0e1c-4e20-9aa6-edcd0212c87c}   Credit: https://superuser.com/questions/1829494/how-to-remove-home-and-gallery-from-windows-11-file-explorer

How to fix "A newer version of OneDrive is installed"

Press the Windows key + R to open a Run window. Type regedit and click OK. Paste this path into the navigation bar at the top of the Registry Editor: Computer\HKEY_CURRENT_USER\Software\Microsoft\OneDrive Right-click the OneDrive folder and select Delete.   Credit: https://support.microsoft.com/en-us/office/how-to-fix-a-newer-version-of-onedrive-is-installed-f3d9a1d2-c8c2-426d-9332-dfc8a4af59fa

Remove icons in Navigation Pane in File Explorer Windows 11

 Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace   Check the  Data value to confirm which icon. Backup the key in case you deleting the wrong icon (Delete the key but the icon does not disappear)

File cannot open in append mode in Laravel in Rocky Linux

 After changing permission: sudo setenforce 0   Credit: https://stackoverflow.com/questions/63203144/file-could-not-be-opened-in-append-mode-failed-to-open-stream-permission-denie 

How to open the old System Properties on Windows 11

 run sysdm.cpl   Credit: https://www.c-sharpcorner.com/article/how-to-addedit-path-environment-variable-in-windows-11/

Determine the PHP version, thread safety and architecture on Windows

Determine the PHP version: php -i|find "PHP Version" Determine the thread safety php -i|find "Thread Safety" You’ll have enabled for thread safe or disabled for not thread safe Determine the architecture php -i|find "Architecture" You’ll have x86 for 32 bits and x64 for 64 bits Credit: https://mlocati.github.io/articles/php-windows-imagick.html