<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.5">Jekyll</generator><link href="http://hakanu.net/feed.xml" rel="self" type="application/atom+xml" /><link href="http://hakanu.net/" rel="alternate" type="text/html" /><updated>2026-01-12T14:50:41+00:00</updated><id>http://hakanu.net/feed.xml</id><title type="html">{“title”: “Who let the dogs out”}</title><subtitle>Some random hacker writes random stuff on software development, frameworks, entrepreneurship, geeky stuff, startups, python, serverless, web development, big data, machine learning, data mining, parallel processing, GPUs etc.
</subtitle><entry><title type="html">Bulk delete assets (images and videos) from Immich</title><link href="http://hakanu.net/selfhost/2025/08/27/bulk-delete-assets-images-and-videos-from-immich/" rel="alternate" type="text/html" title="Bulk delete assets (images and videos) from Immich" /><published>2025-08-27T00:00:00+00:00</published><updated>2025-08-27T00:00:00+00:00</updated><id>http://hakanu.net/selfhost/2025/08/27/bulk-delete-assets-images-and-videos-from-immich</id><content type="html" xml:base="http://hakanu.net/selfhost/2025/08/27/bulk-delete-assets-images-and-videos-from-immich/">&lt;p&gt;&lt;img src=&quot;https://devdala.wordpress.com/wp-content/uploads/2025/08/image.jpg&quot; height=&quot;400px&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.reddit.com/r/immich/comments/1n1ewfa/is_there_a_way_to_move_assets_from_one_user_to/&quot;&gt;My reddit thread on this&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;TL;DR: I messed up while importing a big library into immich and need to roll this back somehow.&lt;/p&gt;

&lt;p&gt;I’ve a semi large immich setup (5tb) with 2 users. I mistakenly uploaded around 500GB of assets into other user’s account instead of my own account due to my messup of the API keys through immich-go.&lt;/p&gt;

&lt;p&gt;I was wondering if there is a clean approach to fix the ownership issue instead of deleting everything and starting over. &lt;a href=&quot;https://www.reddit.com/r/immich/comments/1ifabvo/help_moving_assets_from_one_user_to_another/&quot;&gt;Apparently not&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I thought about doing something like this but I was not sure if the physical files can stay under /upload/user2_id while owner is user1_id and what that would mean for other sub components for immich:&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;UPDATE&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;asset&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;SET&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;ownerId&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'user1&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\_&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;id'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;ownerId&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'user2&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\_&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;id'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;createdAt&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'2025-08-26'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Apparently, it’s somewhat possible but not everything will work without additional work in the db and possibly moving physical files according to the &lt;a href=&quot;https://www.reddit.com/r/immich/comments/1n1ewfa/is_there_a_way_to_move_assets_from_one_user_to/&quot;&gt;reddit Immich community&lt;/a&gt;, huge thanks!&lt;/p&gt;

&lt;p&gt;Then I had to go for safer path by deleting the assets from the other account then reupload. Surprise, this is not easy either. Most of the info online is outdated, I don’t see “Recently uploaded” button anymore in the UI; Date based search is not giving  the exact images I uploaded. So what can i do?&lt;/p&gt;

&lt;p&gt;Let’s pull the asset ids from the db into a file since i know how to do it:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker &lt;span class=&quot;nb&quot;&gt;exec &lt;/span&gt;immich_postgres psql &lt;span class=&quot;nt&quot;&gt;-U&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$DB_USERNAME&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$DB_NAME&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;SELECT * FROM assets WHERE &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ownerId&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; = '&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$OWNER_ID&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;' AND &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;createdAt&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt; &amp;gt;= '2025-08-26';&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; asset_ids_to_be_deleted.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then I need some python power to read this file and call immich asset deletion endpoint through the api. ofc you can do that from curl too&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/hakanu/ff51ea5620c8a1603afdb1a339018c19.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;Tricky part is setting the batch size to 1; I tried with multiple numbers, nothing worked even though api response is 200, the assets are not deleted.&lt;/p&gt;

&lt;div class=&quot;language-sql highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;count&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;FROM&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;assets&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;WHERE&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;ownerId&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'$OWNER_ID'&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;AND&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;&quot;createdAt&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'2025-08-26'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="selfhost" /><summary type="html"></summary></entry><entry><title type="html">How to know if your laptop is bypassing the battery and using AC power directly</title><link href="http://hakanu.net/selfhost/2025/07/29/how-to-know-if-your-laptop-is-bypassing-the-battery-and-using-ac-power-directly/" rel="alternate" type="text/html" title="How to know if your laptop is bypassing the battery and using AC power directly" /><published>2025-07-29T00:00:00+00:00</published><updated>2025-07-29T00:00:00+00:00</updated><id>http://hakanu.net/selfhost/2025/07/29/how-to-know-if-your-laptop-is-bypassing-the-battery-and-using-ac-power-directly</id><content type="html" xml:base="http://hakanu.net/selfhost/2025/07/29/how-to-know-if-your-laptop-is-bypassing-the-battery-and-using-ac-power-directly/">&lt;p&gt;I do lots of self hosting and some of my machines are old laptops with lids closed.&lt;/p&gt;

&lt;p&gt;However, it’s not always possible to remove the battery from the laptop and use it with only AC power due to new slimmer laptops have embedded batteries.&lt;/p&gt;

&lt;p&gt;If you have a battery discharging and charging 365/7/24 then you may start getting swollen battery and fire hazard arises. if you are a self hoster at home, noone wants that.&lt;/p&gt;

&lt;p&gt;Here are some bash commands to know if your battery is being used or direct AC power is used.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo cat&lt;/span&gt; /sys/class/power_supply/AC0/online
&lt;span class=&quot;c&quot;&gt;# cat: /sys/class/power_supply/AC0/online: No such file or directory&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;sudo cat&lt;/span&gt; /sys/class/power_supply/BAT0/status
&lt;span class=&quot;c&quot;&gt;# cat: /sys/class/power_supply/BAT0/status: No such file or directory&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; /sys/class/power_supply/
&lt;span class=&quot;c&quot;&gt;# ADP1  BAT1&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/power_supply/ADP1/online
&lt;span class=&quot;c&quot;&gt;# 1&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /sys/class/power_supply/BAT1/status
&lt;span class=&quot;c&quot;&gt;# Not charging&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="selfhost" /><summary type="html">I do lots of self hosting and some of my machines are old laptops with lids closed.</summary></entry><entry><title type="html">How to understand the discrepancies in the hard drive lifetime (smart farm logs)</title><link href="http://hakanu.net/hdd/2025/04/19/how-to-understand-the-discrepancies-in-the-hard-drive-lifetime-smart-farm-logs/" rel="alternate" type="text/html" title="How to understand the discrepancies in the hard drive lifetime (smart farm logs)" /><published>2025-04-19T00:00:00+00:00</published><updated>2025-04-19T00:00:00+00:00</updated><id>http://hakanu.net/hdd/2025/04/19/how-to-understand-the-discrepancies-in-the-hard-drive-lifetime-smart-farm-logs</id><content type="html" xml:base="http://hakanu.net/hdd/2025/04/19/how-to-understand-the-discrepancies-in-the-hard-drive-lifetime-smart-farm-logs/">&lt;p&gt;Preface: The discrepancy doesn’t mean that your hdd is bad. It’s an input for decision making. I use this to spot “new new” drives vs “refurbished but sold as new” drives especially on amazon.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://devdala.wordpress.com/wp-content/uploads/2025/04/e9ceb854-e786-4f5a-beff-2bd713d58bcf.png&quot; alt=&quot;chatgpt generated image beware&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I was extending my NAS disks and I had already got 2x 12TB Seagates from amazon.de. Since they have been behaving nicely for the last 6 months, I wanted to get 2 more. Then I saw a random review which mentions the farm logs showing different values than smart monitoring tools (s.m.a.r.t.) aka &lt;code class=&quot;highlighter-rouge&quot;&gt;smartctl&lt;/code&gt;. I have never heard FARM logs before, apparently it stands for Field Accessible Reliability Metrics and useful additional metric for Seagate drives which is harder to reset than smart &lt;code class=&quot;highlighter-rouge&quot;&gt;Power_On_Hours&lt;/code&gt; metric.&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;Guess i got scammed by this German Seagate hdd scammers who reset the s.m.a.r.t. information of the hdds and sell it as unused.&lt;br /&gt;&lt;br /&gt;best way to check apparently is the discrepancy of &amp;quot;power on hours&amp;quot;:&lt;br /&gt;&lt;br /&gt;smart power on hours : 4083 (166 days)&lt;br /&gt;seagate farm logs PoH: 28831 (1200 days) &lt;a href=&quot;https://t.co/ofY36fNDRy&quot;&gt;pic.twitter.com/ofY36fNDRy&lt;/a&gt;&lt;/p&gt;&amp;mdash; Hakan Uysal (@hakanu_) &lt;a href=&quot;https://twitter.com/hakanu_/status/1911763836732145809?ref_src=twsrc%5Etfw&quot;&gt;April 14, 2025&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;https://platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;I researched on reddit and saw that there is a big market there: https://www.tomshardware.com/pc-components/hdds/german-seagate-customers-say-their-new-hard-drives-were-actually-used-resold-hdds-reportedly-used-for-tens-of-thousands-of-hours&lt;/p&gt;

&lt;p&gt;However, noone is explaining the exact command to run. Here they are&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;smartmontools 

&lt;span class=&quot;c&quot;&gt;# Usual smart logs for power on hours.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;smartctl &lt;span class=&quot;nt&quot;&gt;-a&lt;/span&gt;  /dev/sdb | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Power_On_Hours&quot;&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# Only applicable for Seagate drives&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# FARM Logs&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;smartctl &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; farm /dev/sdb | &lt;span class=&quot;nb&quot;&gt;grep&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Power on Hours&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you drive is “new new”, you should get almost zero hours for both of these commands. However, in my case &lt;code class=&quot;highlighter-rouge&quot;&gt;smartctl -a&lt;/code&gt; was giving almost zero but &lt;code class=&quot;highlighter-rouge&quot;&gt;smartctl -l farm&lt;/code&gt; 28k hours which is totaling to ~1166 days. Obviously this doesn’t mean that the drive is bad or anything. Drive is manifactured probably around that time. However some refurbishing event happened and got it fixed and resold to me with clean S.M.A.R.T.&lt;/p&gt;</content><author><name></name></author><category term="hdd" /><summary type="html">Preface: The discrepancy doesn’t mean that your hdd is bad. It’s an input for decision making. I use this to spot “new new” drives vs “refurbished but sold as new” drives especially on amazon.</summary></entry><entry><title type="html">Solution of error getting credentials - err: exec: “docker-credential-desktop.exe”: executable file not found in $PATH, Docker on WSL Ubuntu</title><link href="http://hakanu.net/docker/2024/10/05/solution-of-error-getting-credentials-err-exec-docker-credential-desktop-exe-executable-file-not-found-in-path-docker-on-wsl-ubuntu/" rel="alternate" type="text/html" title="Solution of error getting credentials - err: exec: &quot;docker-credential-desktop.exe&quot;: executable file not found in $PATH,  Docker on WSL Ubuntu" /><published>2024-10-05T00:00:00+00:00</published><updated>2024-10-05T00:00:00+00:00</updated><id>http://hakanu.net/docker/2024/10/05/solution-of-error-getting-credentials-err-exec-docker-credential-desktop-exe-executable-file-not-found-in-path-docker-on-wsl-ubuntu</id><content type="html" xml:base="http://hakanu.net/docker/2024/10/05/solution-of-error-getting-credentials-err-exec-docker-credential-desktop-exe-executable-file-not-found-in-path-docker-on-wsl-ubuntu/">&lt;p&gt;Hit an error today, solution is very stupid, so I had to blog it here.&lt;/p&gt;

&lt;h2 id=&quot;error&quot;&gt;Error&lt;/h2&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;docker compose up
&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;+] Running 0/0
 ⠋ scriberr Pulling                                                                                                                                                                                                                           0.0s
error getting credentials - err: &lt;span class=&quot;nb&quot;&gt;exec&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;docker-credential-desktop.exe&quot;&lt;/span&gt;: executable file not found &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$PATH&lt;/span&gt;, out: &lt;span class=&quot;sb&quot;&gt;``&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.docker/config.json&lt;/code&gt; change &lt;code class=&quot;highlighter-rouge&quot;&gt;credsStore to credStore&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; ~/.docker/config.json
&lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;s2&quot;&gt;&quot;credStore&quot;&lt;/span&gt;: &lt;span class=&quot;s2&quot;&gt;&quot;desktop.exe&quot;&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href=&quot;https://forums.docker.com/t/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2/100225/5&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="docker" /><summary type="html">Hit an error today, solution is very stupid, so I had to blog it here.</summary></entry><entry><title type="html">Mount exfat with read write access</title><link href="http://hakanu.net/bash/2024/09/08/mount-exfat-with-read-write-access/" rel="alternate" type="text/html" title="Mount exfat with read write access" /><published>2024-09-08T00:00:00+00:00</published><updated>2024-09-08T00:00:00+00:00</updated><id>http://hakanu.net/bash/2024/09/08/mount-exfat-with-read-write-access</id><content type="html" xml:base="http://hakanu.net/bash/2024/09/08/mount-exfat-with-read-write-access/">&lt;p&gt;My external hdd i’m trying to mount to debian NAS server through usb is giving me permission denied access for write; it can only read which is not enough for my use case.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;-o rw&lt;/code&gt; doesn’t work alone. Gemini keeps giving me only -o rw option for some reason.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mount /dev/sdg1 /mnt/hdd_exfat/  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;  rw,uid&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1000,gid&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If this still doesn’t work try this&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# unmount first&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;umount /dev/sdg1

&lt;span class=&quot;c&quot;&gt;# Change the ownership of the mounting point.&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;chmown &lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt;:&lt;span class=&quot;nv&quot;&gt;$USER&lt;/span&gt; /mnt/hdd_exfat

&lt;span class=&quot;c&quot;&gt;# Remount&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;mount /dev/sdg1 /mnt/hdd_exfat/  &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;  rw,uid&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1000,gid&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1000
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="bash" /><summary type="html">My external hdd i’m trying to mount to debian NAS server through usb is giving me permission denied access for write; it can only read which is not enough for my use case.</summary></entry><entry><title type="html">Fixing always portrait apps in Huawei Tablet (Harmony OS)</title><link href="http://hakanu.net/android/2024/06/15/fixing-always-portrait-apps-in-huawei-tablet-harmony-os/" rel="alternate" type="text/html" title="Fixing always portrait apps in Huawei Tablet (Harmony OS)" /><published>2024-06-15T00:00:00+00:00</published><updated>2024-06-15T00:00:00+00:00</updated><id>http://hakanu.net/android/2024/06/15/fixing-always-portrait-apps-in-huawei-tablet-harmony-os</id><content type="html" xml:base="http://hakanu.net/android/2024/06/15/fixing-always-portrait-apps-in-huawei-tablet-harmony-os/">&lt;p&gt;I got a cheap Huawei Tablet (Mate Pad Air) last year with very very good hardware, amazing screen, super snappy. All my tablet-worthy apps (photo/video editing and kids coloring pages apps) work great so it’s definitely a good deal for me. Among all the annoying things (no Google Play Store, not-as-apple-pencil quality stylus, inferior OS experience etc), the apps lock themselves into portrait mode regardless of the orientation of the tablet. Well it’s a tablet with keyboard which is always in the landscape mode. However, apps like Reddit, DJI Mimo etc always open themselves in portrait, forcing me to tilt the tablet with keyboard (or instead throw it to the wall).&lt;/p&gt;

&lt;p&gt;I tried multiple things to solve the issue. Nothing helped, finally I stumbled upon a &lt;a href=&quot;https://www.reddit.com/r/Android/s/3qajKyf4eI&quot;&gt;reddit post&lt;/a&gt;, I immediately opened it in my tablet, boom it got portrait-ed, I didn’t give up and read the post.&lt;/p&gt;

&lt;p&gt;Apparently this is a common issue with wide devices, especially foldables and tablets. Since the manifacturers are lazy enough to fix these (small?) annoyance, Google introduced a method where the actual users can fix issue themselves, which is making the tablet ignore apps’ specification of rotation.&lt;/p&gt;

&lt;p&gt;Steps are easy in the post, I need to connect via adb and then run this adb command. however nothing is easy.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Get the adb for windows, I’m nice enough so putting a &lt;a href=&quot;https://dl.google.com/android/repository/platform-tools-latest-windows.zip&quot;&gt;link here&lt;/a&gt; to download and use adb without installing Android Studio and other gigabytes of software.&lt;/li&gt;
  &lt;li&gt;Now unzip and open terminal inside&lt;/li&gt;
  &lt;li&gt;./adb.exe devices =&amp;gt; Nothing happens. Because you didn’t enable usb debugging in the tablet yet.&lt;/li&gt;
  &lt;li&gt;Go to tablet =&amp;gt; Settings =&amp;gt; System =&amp;gt; Touch Software version multiple times to enable developer options.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/images/Screenshot_20240615_234007.jpg&quot; alt=&quot;Screenshot_20240615_234007.jpg&quot; /&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Enable usb debugging, hopefully once you do that if you have data + charging usb-c cable, your tablet should prompt you if it should trust this computer. If this doesn’t show up, sorry, more steps are coming. Try to unplug and re-plug the cable, consider enabling usb debugging while charging too, maybe dangerous so don’t make it permanent.&lt;/li&gt;
  &lt;li&gt;Then if it still doesn’t work, try this, this did the trick for me: modify USB configuration from MTP (Media Transfer Protocol) to RNDIS (USB ethernet), then boom it asked if it should trust my pc. I approved and adb devices started to show my tablet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/images/Screenshot_20240615_234748.jpg&quot; alt=&quot;Screenshot_20240615_234748.jpg&quot; /&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;And then finally we can run the magical command: .\adb.exe shell wm set-ignore-orientation-request -d 0 true&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;It should silently finish, no errors. Then fire up reddit app while your tablet is in landscape mode.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;/images/Screenshot_20240615_235054_com.reddit.frontpage.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Looks ugly, doesn’t use all the estate but who cares, I don’t need to rotate the tablet physically anymore.&lt;/p&gt;</content><author><name></name></author><category term="android" /><summary type="html">I got a cheap Huawei Tablet (Mate Pad Air) last year with very very good hardware, amazing screen, super snappy. All my tablet-worthy apps (photo/video editing and kids coloring pages apps) work great so it’s definitely a good deal for me. Among all the annoying things (no Google Play Store, not-as-apple-pencil quality stylus, inferior OS experience etc), the apps lock themselves into portrait mode regardless of the orientation of the tablet. Well it’s a tablet with keyboard which is always in the landscape mode. However, apps like Reddit, DJI Mimo etc always open themselves in portrait, forcing me to tilt the tablet with keyboard (or instead throw it to the wall).</summary></entry><entry><title type="html">Enable x265 (HEVC) hardware decoding in Raspberry Pi 4</title><link href="http://hakanu.net/raspberrypi/2024/02/20/enable-x265-hevc-hardware-decoding-in-raspberry-pi-4/" rel="alternate" type="text/html" title="Enable x265 (HEVC) hardware decoding in  Raspberry Pi 4" /><published>2024-02-20T00:00:00+00:00</published><updated>2024-02-20T00:00:00+00:00</updated><id>http://hakanu.net/raspberrypi/2024/02/20/enable-x265-hevc-hardware-decoding-in-raspberry-pi-4</id><content type="html" xml:base="http://hakanu.net/raspberrypi/2024/02/20/enable-x265-hevc-hardware-decoding-in-raspberry-pi-4/">&lt;p&gt;My Emby Server struggles a lot during playing x265 formatted videos, it gets stutters every 3-4 seconds. Very annoying. I resolved like this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Edit &lt;code class=&quot;highlighter-rouge&quot;&gt;/boot/config.txt&lt;/code&gt;: sudo vim /boot/config.txt&lt;/li&gt;
  &lt;li&gt;Add this line to the end&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dtoverlay=rpivid-v4l2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;(More details about &lt;a href=&quot;https://www.reddit.com/r/jellyfin/comments/wpaxl8/raspberry_pi_4_using_v4l2/&quot;&gt;v4l2&lt;/a&gt;)&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Save the file.&lt;/li&gt;
  &lt;li&gt;Reboot the pi: &lt;code class=&quot;highlighter-rouge&quot;&gt;sudo reboot now&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If this doesn’t solve your problem, check out the HEVC support in your browser. The client consuming emby content should also be compatible.&lt;/p&gt;</content><author><name></name></author><category term="raspberrypi" /><summary type="html">My Emby Server struggles a lot during playing x265 formatted videos, it gets stutters every 3-4 seconds. Very annoying. I resolved like this:</summary></entry><entry><title type="html">Solving “Error: TRIGGER_PAYLOAD_TOO_LARGE: This request would cause a function payload exceeding the maximum size allowed” in firebase realtime db</title><link href="http://hakanu.net/firebase/2023/12/24/solving-error-trigger-payload-too-large-this-request-would-cause-a-function-payload-exceeding-the-maximum-size-allowed-in-firebase-realtime-db/" rel="alternate" type="text/html" title="Solving &quot;Error: TRIGGER_PAYLOAD_TOO_LARGE: This request would cause a function payload exceeding the maximum size allowed&quot; in firebase realtime db" /><published>2023-12-24T00:00:00+00:00</published><updated>2023-12-24T00:00:00+00:00</updated><id>http://hakanu.net/firebase/2023/12/24/solving-error-trigger-payload-too-large-this-request-would-cause-a-function-payload-exceeding-the-maximum-size-allowed-in-firebase-realtime-db</id><content type="html" xml:base="http://hakanu.net/firebase/2023/12/24/solving-error-trigger-payload-too-large-this-request-would-cause-a-function-payload-exceeding-the-maximum-size-allowed-in-firebase-realtime-db/">&lt;p&gt;I was using this piece and it stopped working in one night:&lt;/p&gt;

&lt;div class=&quot;language-python highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;n&quot;&gt;db&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;reference&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'foo/some_key'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;delete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I wrote the code above in different variations, nothing helped.
Writing it here so that I won’t forget. Eventually the solution was very easy, I had an inactive firebase function listening to firebase realtime database writes and I just deleted that function. This thing got resolved.&lt;/p&gt;

&lt;p&gt;The inspo is from this old post:&lt;/p&gt;

&lt;p&gt;https://stackoverflow.com/questions/50513374/firebase-realtime-database-currently-gives-trigger-payload-too-large-error&lt;/p&gt;

&lt;p&gt;Hope saves someones less hours than me.&lt;/p&gt;</content><author><name></name></author><category term="firebase" /><summary type="html">I was using this piece and it stopped working in one night:</summary></entry><entry><title type="html">Solving “Invalid JWT: Token must be a short-lived token” error while using firebase realtime db on WSL</title><link href="http://hakanu.net/wsl/2023/12/24/solving-invalid-jwt-token-must-be-a-short-lived-token-error-while-using-firebase-realtime-db-on-wsl/" rel="alternate" type="text/html" title="Solving &quot;Invalid JWT: Token must be a short-lived token&quot; error while using firebase realtime db on WSL" /><published>2023-12-24T00:00:00+00:00</published><updated>2023-12-24T00:00:00+00:00</updated><id>http://hakanu.net/wsl/2023/12/24/solving-invalid-jwt-token-must-be-a-short-lived-token-error-while-using-firebase-realtime-db-on-wsl</id><content type="html" xml:base="http://hakanu.net/wsl/2023/12/24/solving-invalid-jwt-token-must-be-a-short-lived-token-error-while-using-firebase-realtime-db-on-wsl/">&lt;p&gt;I keep hitting this in my Windows laptop with WSL (Windows Subsystem for Linux).&lt;br /&gt;
This is the full error:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;google.auth.exceptions.RefreshError: &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.'&lt;/span&gt;, &lt;span class=&quot;o&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'error'&lt;/span&gt;: &lt;span class=&quot;s1&quot;&gt;'invalid_grant'&lt;/span&gt;, &lt;span class=&quot;s1&quot;&gt;'error_description'&lt;/span&gt;: &lt;span class=&quot;s1&quot;&gt;'Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.'&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check out the date: &lt;code class=&quot;highlighter-rouge&quot;&gt;date&lt;/code&gt; =&amp;gt; Probably will output something weird.&lt;/p&gt;

&lt;p&gt;Sync it again (needs sudo):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;hwclock &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Check out date date again: &lt;code class=&quot;highlighter-rouge&quot;&gt;date&lt;/code&gt; =&amp;gt; This time it should show correct timezone. if not, there are more commands to run I stole from internet.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;timedatectl set-timezone Europe/Amsterdam

&lt;span class=&quot;nb&quot;&gt;date&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;# if this doesn't work&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get update
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;apt-get &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; ntpdate

&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;ntpdate pool.ntp.org
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="wsl" /><summary type="html">I keep hitting this in my Windows laptop with WSL (Windows Subsystem for Linux). This is the full error:</summary></entry><entry><title type="html">Fixing mongodb start error code 14/n/a</title><link href="http://hakanu.net/mongodb/2023/08/15/fixing-mongodb-start-error-code-14-n-a/" rel="alternate" type="text/html" title="Fixing mongodb start error code 14/n/a" /><published>2023-08-15T00:00:00+00:00</published><updated>2023-08-15T00:00:00+00:00</updated><id>http://hakanu.net/mongodb/2023/08/15/fixing-mongodb-start-error-code-14-n-a</id><content type="html" xml:base="http://hakanu.net/mongodb/2023/08/15/fixing-mongodb-start-error-code-14-n-a/">&lt;p&gt;Stupid errors today.&lt;/p&gt;

&lt;p&gt;My local mongodb which has been running for multiple weeks decided not to start.&lt;/p&gt;

&lt;p&gt;First I need to remove MONGODB_CONFIG_OVERRIDE_NOFORK env variable.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;vim /usr/lib/systemd/system/mongod.service
&lt;span class=&quot;c&quot;&gt;# Convert this line:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Environment=&quot;MONGODB_CONFIG_OVERRIDE_NOFORK=1&quot;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# To This line:&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# Environment=&quot;MONGODB_CONFIG_OVERRIDE_NOFORK=0&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then it still refuse to up itself, but this time no errors:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl start mongod

x:~&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;systemctl status mongod

× mongod.service - MongoDB Database Server
     Loaded: loaded &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;/lib/systemd/system/mongod.service&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; enabled&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; vendor preset: enabled&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
     Active: failed &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;Result: exit-code&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; since Mon 2023-08-14 20:33:54 CEST&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 1s ago
       Docs: https://docs.mongodb.org/manual
    Process: 1501 &lt;span class=&quot;nv&quot;&gt;ExecStart&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;/usr/bin/mongod &lt;span class=&quot;nt&quot;&gt;--config&lt;/span&gt; /etc/mongod.conf &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;exited, &lt;span class=&quot;nv&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;14&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;
   Main PID: 1501 &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;exited, &lt;span class=&quot;nv&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;14&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

Aug 14 20:33:54 x systemd[1]: Started MongoDB Database Server.
Aug 14 20:33:54 x systemd[1]: mongod.service: Main process exited, &lt;span class=&quot;nv&quot;&gt;code&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;exited, &lt;span class=&quot;nv&quot;&gt;status&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;14/n/a
Aug 14 20:33:54 x systemd[1]: mongod.service: Failed with result &lt;span class=&quot;s1&quot;&gt;'exit-code'&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Apparently it’s a &lt;a href=&quot;https://askubuntu.com/questions/823288/mongodb-loads-but-breaks-returning-status-14&quot;&gt;permission issue&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;sudo chown&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; mongodb:mongodb /var/lib/mongodb
&lt;span class=&quot;nb&quot;&gt;sudo chown &lt;/span&gt;mongodb:mongodb /tmp/mongodb-27017.sock
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;service mongod restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><category term="mongodb" /><summary type="html">Stupid errors today.</summary></entry></feed>