{"generator":"Jekyll","link":[{"@attributes":{"href":"http:\/\/hakanu.net\/feed.xml","rel":"self","type":"application\/atom+xml"}},{"@attributes":{"href":"http:\/\/hakanu.net\/","rel":"alternate","type":"text\/html"}}],"updated":"2026-01-12T14:50:41+00:00","id":"http:\/\/hakanu.net\/feed.xml","title":"{\u201ctitle\u201d: \u201cWho let the dogs out\u201d}","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.\n","entry":[{"title":"Bulk delete assets (images and videos) from Immich","link":{"@attributes":{"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","updated":"2025-08-27T00:00:00+00:00","id":"http:\/\/hakanu.net\/selfhost\/2025\/08\/27\/bulk-delete-assets-images-and-videos-from-immich","content":"<p><img src=\"https:\/\/devdala.wordpress.com\/wp-content\/uploads\/2025\/08\/image.jpg\" height=\"400px\" \/><\/p>\n\n<p><a href=\"https:\/\/www.reddit.com\/r\/immich\/comments\/1n1ewfa\/is_there_a_way_to_move_assets_from_one_user_to\/\">My reddit thread on this<\/a><\/p>\n\n<p>TL;DR: I messed up while importing a big library into immich and need to roll this back somehow.<\/p>\n\n<p>I\u2019ve a semi large immich setup (5tb) with 2 users. I mistakenly uploaded around 500GB of assets into other user\u2019s account instead of my own account due to my messup of the API keys through immich-go.<\/p>\n\n<p>I was wondering if there is a clean approach to fix the ownership issue instead of deleting everything and starting over. <a href=\"https:\/\/www.reddit.com\/r\/immich\/comments\/1ifabvo\/help_moving_assets_from_one_user_to_another\/\">Apparently not<\/a><\/p>\n\n<p>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:<\/p>\n\n<div class=\"language-sql highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">UPDATE<\/span> <span class=\"nv\">\"asset\"<\/span> <span class=\"k\">SET<\/span> <span class=\"nv\">\"ownerId\"<\/span> <span class=\"o\">=<\/span> <span class=\"s1\">'user1<\/span><span class=\"se\">\\_<\/span><span class=\"s1\">id'<\/span> <span class=\"k\">WHERE<\/span> <span class=\"nv\">\"ownerId\"<\/span> <span class=\"o\">=<\/span> <span class=\"s1\">'user2<\/span><span class=\"se\">\\_<\/span><span class=\"s1\">id'<\/span> <span class=\"k\">AND<\/span> <span class=\"nv\">\"createdAt\"<\/span> <span class=\"o\">&gt;=<\/span> <span class=\"s1\">'2025-08-26'<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Apparently, it\u2019s somewhat possible but not everything will work without additional work in the db and possibly moving physical files according to the <a href=\"https:\/\/www.reddit.com\/r\/immich\/comments\/1n1ewfa\/is_there_a_way_to_move_assets_from_one_user_to\/\">reddit Immich community<\/a>, huge thanks!<\/p>\n\n<p>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\u2019t see \u201cRecently uploaded\u201d button anymore in the UI; Date based search is not giving  the exact images I uploaded. So what can i do?<\/p>\n\n<p>Let\u2019s pull the asset ids from the db into a file since i know how to do it:<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>docker <span class=\"nb\">exec <\/span>immich_postgres psql <span class=\"nt\">-U<\/span> <span class=\"nv\">$DB_USERNAME<\/span> <span class=\"nt\">-d<\/span> <span class=\"nv\">$DB_NAME<\/span> <span class=\"nt\">-c<\/span> <span class=\"s2\">\"SELECT * FROM assets WHERE <\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">ownerId<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\"> = '<\/span><span class=\"nv\">$OWNER_ID<\/span><span class=\"s2\">' AND <\/span><span class=\"se\">\\\"<\/span><span class=\"s2\">createdAt<\/span><span class=\"se\">\\\"<\/span><span class=\"s2\"> &gt;= '2025-08-26';\"<\/span> <span class=\"o\">&gt;<\/span> asset_ids_to_be_deleted.txt\n<\/code><\/pre><\/div><\/div>\n\n<p>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<\/p>\n\n<script src=\"https:\/\/gist.github.com\/hakanu\/ff51ea5620c8a1603afdb1a339018c19.js\"><\/script>\n\n<p>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.<\/p>\n\n<div class=\"language-sql highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"k\">SELECT<\/span> <span class=\"k\">count<\/span><span class=\"p\">(<\/span><span class=\"o\">*<\/span><span class=\"p\">)<\/span> <span class=\"k\">FROM<\/span> <span class=\"n\">assets<\/span> <span class=\"k\">WHERE<\/span> <span class=\"nv\">\"ownerId\"<\/span> <span class=\"o\">=<\/span> <span class=\"s1\">'$OWNER_ID'<\/span> <span class=\"k\">AND<\/span> <span class=\"nv\">\"createdAt\"<\/span> <span class=\"o\">&gt;=<\/span> <span class=\"s1\">'2025-08-26'<\/span><span class=\"p\">;<\/span>\n<\/code><\/pre><\/div><\/div>","author":{"name":{}},"category":{"@attributes":{"term":"selfhost"}},"summary":{"@attributes":{"type":"html"}}},{"title":"How to know if your laptop is bypassing the battery and using AC power directly","link":{"@attributes":{"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","updated":"2025-07-29T00:00:00+00:00","id":"http:\/\/hakanu.net\/selfhost\/2025\/07\/29\/how-to-know-if-your-laptop-is-bypassing-the-battery-and-using-ac-power-directly","content":"<p>I do lots of self hosting and some of my machines are old laptops with lids closed.<\/p>\n\n<p>However, it\u2019s 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.<\/p>\n\n<p>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.<\/p>\n\n<p>Here are some bash commands to know if your battery is being used or direct AC power is used.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo cat<\/span> \/sys\/class\/power_supply\/AC0\/online\n<span class=\"c\"># cat: \/sys\/class\/power_supply\/AC0\/online: No such file or directory<\/span>\n\n<span class=\"nb\">sudo cat<\/span> \/sys\/class\/power_supply\/BAT0\/status\n<span class=\"c\"># cat: \/sys\/class\/power_supply\/BAT0\/status: No such file or directory<\/span>\n\n<span class=\"nb\">ls<\/span> \/sys\/class\/power_supply\/\n<span class=\"c\"># ADP1  BAT1<\/span>\n\n<span class=\"nb\">cat<\/span> \/sys\/class\/power_supply\/ADP1\/online\n<span class=\"c\"># 1<\/span>\n\n<span class=\"nb\">cat<\/span> \/sys\/class\/power_supply\/BAT1\/status\n<span class=\"c\"># Not charging<\/span>\n<\/code><\/pre><\/div><\/div>","author":{"name":{}},"category":{"@attributes":{"term":"selfhost"}},"summary":"I do lots of self hosting and some of my machines are old laptops with lids closed."},{"title":"How to understand the discrepancies in the hard drive lifetime (smart farm logs)","link":{"@attributes":{"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","updated":"2025-04-19T00:00:00+00:00","id":"http:\/\/hakanu.net\/hdd\/2025\/04\/19\/how-to-understand-the-discrepancies-in-the-hard-drive-lifetime-smart-farm-logs","content":"<p>Preface: The discrepancy doesn\u2019t mean that your hdd is bad. It\u2019s an input for decision making. I use this to spot \u201cnew new\u201d drives vs \u201crefurbished but sold as new\u201d drives especially on amazon.<\/p>\n\n<p><img src=\"https:\/\/devdala.wordpress.com\/wp-content\/uploads\/2025\/04\/e9ceb854-e786-4f5a-beff-2bd713d58bcf.png\" alt=\"chatgpt generated image beware\" \/><\/p>\n\n<p>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 <code class=\"highlighter-rouge\">smartctl<\/code>. 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 <code class=\"highlighter-rouge\">Power_On_Hours<\/code> metric.<\/p>\n\n<blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">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.<br \/><br \/>best way to check apparently is the discrepancy of &quot;power on hours&quot;:<br \/><br \/>smart power on hours : 4083 (166 days)<br \/>seagate farm logs PoH: 28831 (1200 days) <a href=\"https:\/\/t.co\/ofY36fNDRy\">pic.twitter.com\/ofY36fNDRy<\/a><\/p>&mdash; Hakan Uysal (@hakanu_) <a href=\"https:\/\/twitter.com\/hakanu_\/status\/1911763836732145809?ref_src=twsrc%5Etfw\">April 14, 2025<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n\n<p>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<\/p>\n\n<p>However, noone is explaining the exact command to run. Here they are<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo <\/span>apt update\n<span class=\"nb\">sudo <\/span>apt <span class=\"nb\">install <\/span>smartmontools \n\n<span class=\"c\"># Usual smart logs for power on hours.<\/span>\n<span class=\"nb\">sudo <\/span>smartctl <span class=\"nt\">-a<\/span>  \/dev\/sdb | <span class=\"nb\">grep<\/span> <span class=\"s2\">\"Power_On_Hours\"<\/span>\n\n<span class=\"c\"># Only applicable for Seagate drives<\/span>\n<span class=\"c\"># FARM Logs<\/span>\n<span class=\"nb\">sudo <\/span>smartctl <span class=\"nt\">-l<\/span> farm \/dev\/sdb | <span class=\"nb\">grep<\/span> <span class=\"s2\">\"Power on Hours\"<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>If you drive is \u201cnew new\u201d, you should get almost zero hours for both of these commands. However, in my case <code class=\"highlighter-rouge\">smartctl -a<\/code> was giving almost zero but <code class=\"highlighter-rouge\">smartctl -l farm<\/code> 28k hours which is totaling to ~1166 days. Obviously this doesn\u2019t 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.<\/p>","author":{"name":{}},"category":{"@attributes":{"term":"hdd"}},"summary":"Preface: The discrepancy doesn\u2019t mean that your hdd is bad. It\u2019s an input for decision making. I use this to spot \u201cnew new\u201d drives vs \u201crefurbished but sold as new\u201d drives especially on amazon."},{"title":"Solution of error getting credentials - err: exec: \u201cdocker-credential-desktop.exe\u201d: executable file not found in $PATH, Docker on WSL Ubuntu","link":{"@attributes":{"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: \"docker-credential-desktop.exe\": executable file not found in $PATH,  Docker on WSL Ubuntu"}},"published":"2024-10-05T00:00:00+00:00","updated":"2024-10-05T00:00:00+00:00","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","content":"<p>Hit an error today, solution is very stupid, so I had to blog it here.<\/p>\n\n<h2 id=\"error\">Error<\/h2>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ <\/span>docker compose up\n<span class=\"o\">[<\/span>+] Running 0\/0\n \u280b scriberr Pulling                                                                                                                                                                                                                           0.0s\nerror getting credentials - err: <span class=\"nb\">exec<\/span>: <span class=\"s2\">\"docker-credential-desktop.exe\"<\/span>: executable file not found <span class=\"k\">in<\/span> <span class=\"nv\">$PATH<\/span>, out: <span class=\"sb\">``<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>In <code class=\"highlighter-rouge\">~\/.docker\/config.json<\/code> change <code class=\"highlighter-rouge\">credsStore to credStore<\/code><\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nv\">$ <\/span><span class=\"nb\">cat<\/span> ~\/.docker\/config.json\n<span class=\"o\">{<\/span>\n  <span class=\"s2\">\"credStore\"<\/span>: <span class=\"s2\">\"desktop.exe\"<\/span>\n<span class=\"o\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p><a href=\"https:\/\/forums.docker.com\/t\/docker-credential-desktop-exe-executable-file-not-found-in-path-using-wsl2\/100225\/5\">Source<\/a><\/p>","author":{"name":{}},"category":{"@attributes":{"term":"docker"}},"summary":"Hit an error today, solution is very stupid, so I had to blog it here."},{"title":"Mount exfat with read write access","link":{"@attributes":{"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","updated":"2024-09-08T00:00:00+00:00","id":"http:\/\/hakanu.net\/bash\/2024\/09\/08\/mount-exfat-with-read-write-access","content":"<p>My external hdd i\u2019m 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.<\/p>\n\n<p><code class=\"highlighter-rouge\">-o rw<\/code> doesn\u2019t work alone. Gemini keeps giving me only -o rw option for some reason.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo <\/span>mount \/dev\/sdg1 \/mnt\/hdd_exfat\/  <span class=\"nt\">-o<\/span>  rw,uid<span class=\"o\">=<\/span>1000,gid<span class=\"o\">=<\/span>1000\n<\/code><\/pre><\/div><\/div>\n\n<p>If this still doesn\u2019t work try this<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"c\"># unmount first<\/span>\n<span class=\"nb\">sudo <\/span>umount \/dev\/sdg1\n\n<span class=\"c\"># Change the ownership of the mounting point.<\/span>\n<span class=\"nb\">sudo <\/span>chmown <span class=\"nv\">$USER<\/span>:<span class=\"nv\">$USER<\/span> \/mnt\/hdd_exfat\n\n<span class=\"c\"># Remount<\/span>\n<span class=\"nb\">sudo <\/span>mount \/dev\/sdg1 \/mnt\/hdd_exfat\/  <span class=\"nt\">-o<\/span>  rw,uid<span class=\"o\">=<\/span>1000,gid<span class=\"o\">=<\/span>1000\n<\/code><\/pre><\/div><\/div>","author":{"name":{}},"category":{"@attributes":{"term":"bash"}},"summary":"My external hdd i\u2019m 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."},{"title":"Fixing always portrait apps in Huawei Tablet (Harmony OS)","link":{"@attributes":{"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","updated":"2024-06-15T00:00:00+00:00","id":"http:\/\/hakanu.net\/android\/2024\/06\/15\/fixing-always-portrait-apps-in-huawei-tablet-harmony-os","content":"<p>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\u2019s 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\u2019s 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).<\/p>\n\n<p>I tried multiple things to solve the issue. Nothing helped, finally I stumbled upon a <a href=\"https:\/\/www.reddit.com\/r\/Android\/s\/3qajKyf4eI\">reddit post<\/a>, I immediately opened it in my tablet, boom it got portrait-ed, I didn\u2019t give up and read the post.<\/p>\n\n<p>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\u2019 specification of rotation.<\/p>\n\n<p>Steps are easy in the post, I need to connect via adb and then run this adb command. however nothing is easy.<\/p>\n\n<ol>\n  <li>Get the adb for windows, I\u2019m nice enough so putting a <a href=\"https:\/\/dl.google.com\/android\/repository\/platform-tools-latest-windows.zip\">link here<\/a> to download and use adb without installing Android Studio and other gigabytes of software.<\/li>\n  <li>Now unzip and open terminal inside<\/li>\n  <li>.\/adb.exe devices =&gt; Nothing happens. Because you didn\u2019t enable usb debugging in the tablet yet.<\/li>\n  <li>Go to tablet =&gt; Settings =&gt; System =&gt; Touch Software version multiple times to enable developer options.<\/li>\n<\/ol>\n\n<p><img src=\"\/images\/Screenshot_20240615_234007.jpg\" alt=\"Screenshot_20240615_234007.jpg\" \/><\/p>\n\n<ol>\n  <li>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\u2019t 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\u2019t make it permanent.<\/li>\n  <li>Then if it still doesn\u2019t 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.<\/li>\n<\/ol>\n\n<p><img src=\"\/images\/Screenshot_20240615_234748.jpg\" alt=\"Screenshot_20240615_234748.jpg\" \/><\/p>\n\n<ol>\n  <li>\n    <p>And then finally we can run the magical command: .\\adb.exe shell wm set-ignore-orientation-request -d 0 true<\/p>\n  <\/li>\n  <li>\n    <p>It should silently finish, no errors. Then fire up reddit app while your tablet is in landscape mode.<\/p>\n  <\/li>\n<\/ol>\n\n<p><img src=\"\/images\/Screenshot_20240615_235054_com.reddit.frontpage.jpg\" alt=\"\" \/><\/p>\n\n<p>Looks ugly, doesn\u2019t use all the estate but who cares, I don\u2019t need to rotate the tablet physically anymore.<\/p>","author":{"name":{}},"category":{"@attributes":{"term":"android"}},"summary":"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\u2019s 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\u2019s 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)."},{"title":"Enable x265 (HEVC) hardware decoding in Raspberry Pi 4","link":{"@attributes":{"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","updated":"2024-02-20T00:00:00+00:00","id":"http:\/\/hakanu.net\/raspberrypi\/2024\/02\/20\/enable-x265-hevc-hardware-decoding-in-raspberry-pi-4","content":"<p>My Emby Server struggles a lot during playing x265 formatted videos, it gets stutters every 3-4 seconds. Very annoying. I resolved like this:<\/p>\n\n<ul>\n  <li>Edit <code class=\"highlighter-rouge\">\/boot\/config.txt<\/code>: sudo vim \/boot\/config.txt<\/li>\n  <li>Add this line to the end<\/li>\n<\/ul>\n\n<div class=\"highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>dtoverlay=rpivid-v4l2\n<\/code><\/pre><\/div><\/div>\n<p>(More details about <a href=\"https:\/\/www.reddit.com\/r\/jellyfin\/comments\/wpaxl8\/raspberry_pi_4_using_v4l2\/\">v4l2<\/a>)<\/p>\n\n<ul>\n  <li>Save the file.<\/li>\n  <li>Reboot the pi: <code class=\"highlighter-rouge\">sudo reboot now<\/code><\/li>\n<\/ul>\n\n<p>If this doesn\u2019t solve your problem, check out the HEVC support in your browser. The client consuming emby content should also be compatible.<\/p>","author":{"name":{}},"category":{"@attributes":{"term":"raspberrypi"}},"summary":"My Emby Server struggles a lot during playing x265 formatted videos, it gets stutters every 3-4 seconds. Very annoying. I resolved like this:"},{"title":"Solving \u201cError: TRIGGER_PAYLOAD_TOO_LARGE: This request would cause a function payload exceeding the maximum size allowed\u201d in firebase realtime db","link":{"@attributes":{"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 \"Error: TRIGGER_PAYLOAD_TOO_LARGE: This request would cause a function payload exceeding the maximum size allowed\" in firebase realtime db"}},"published":"2023-12-24T00:00:00+00:00","updated":"2023-12-24T00:00:00+00:00","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","content":"<p>I was using this piece and it stopped working in one night:<\/p>\n\n<div class=\"language-python highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>\n<span class=\"n\">db<\/span><span class=\"o\">.<\/span><span class=\"n\">reference<\/span><span class=\"p\">(<\/span><span class=\"s\">'foo\/some_key'<\/span><span class=\"p\">)<\/span><span class=\"o\">.<\/span><span class=\"n\">delete<\/span><span class=\"p\">()<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>I wrote the code above in different variations, nothing helped.\nWriting it here so that I won\u2019t 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.<\/p>\n\n<p>The inspo is from this old post:<\/p>\n\n<p>https:\/\/stackoverflow.com\/questions\/50513374\/firebase-realtime-database-currently-gives-trigger-payload-too-large-error<\/p>\n\n<p>Hope saves someones less hours than me.<\/p>","author":{"name":{}},"category":{"@attributes":{"term":"firebase"}},"summary":"I was using this piece and it stopped working in one night:"},{"title":"Solving \u201cInvalid JWT: Token must be a short-lived token\u201d error while using firebase realtime db on WSL","link":{"@attributes":{"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 \"Invalid JWT: Token must be a short-lived token\" error while using firebase realtime db on WSL"}},"published":"2023-12-24T00:00:00+00:00","updated":"2023-12-24T00:00:00+00:00","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","content":"<p>I keep hitting this in my Windows laptop with WSL (Windows Subsystem for Linux).<br \/>\nThis is the full error:<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>google.auth.exceptions.RefreshError: <span class=\"o\">(<\/span><span class=\"s1\">'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.'<\/span>, <span class=\"o\">{<\/span><span class=\"s1\">'error'<\/span>: <span class=\"s1\">'invalid_grant'<\/span>, <span class=\"s1\">'error_description'<\/span>: <span class=\"s1\">'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.'<\/span><span class=\"o\">})<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Check out the date: <code class=\"highlighter-rouge\">date<\/code> =&gt; Probably will output something weird.<\/p>\n\n<p>Sync it again (needs sudo):<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo <\/span>hwclock <span class=\"nt\">-s<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Check out date date again: <code class=\"highlighter-rouge\">date<\/code> =&gt; This time it should show correct timezone. if not, there are more commands to run I stole from internet.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo <\/span>timedatectl set-timezone Europe\/Amsterdam\n\n<span class=\"nb\">date<\/span>\n\n<span class=\"c\"># if this doesn't work<\/span>\n<span class=\"nb\">sudo <\/span>apt-get update\n<span class=\"nb\">sudo <\/span>apt-get <span class=\"nb\">install<\/span> <span class=\"nt\">-y<\/span> ntpdate\n\n<span class=\"nb\">sudo <\/span>ntpdate pool.ntp.org\n<\/code><\/pre><\/div><\/div>","author":{"name":{}},"category":{"@attributes":{"term":"wsl"}},"summary":"I keep hitting this in my Windows laptop with WSL (Windows Subsystem for Linux). This is the full error:"},{"title":"Fixing mongodb start error code 14\/n\/a","link":{"@attributes":{"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","updated":"2023-08-15T00:00:00+00:00","id":"http:\/\/hakanu.net\/mongodb\/2023\/08\/15\/fixing-mongodb-start-error-code-14-n-a","content":"<p>Stupid errors today.<\/p>\n\n<p>My local mongodb which has been running for multiple weeks decided not to start.<\/p>\n\n<p>First I need to remove MONGODB_CONFIG_OVERRIDE_NOFORK env variable.<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo <\/span>vim \/usr\/lib\/systemd\/system\/mongod.service\n<span class=\"c\"># Convert this line:<\/span>\n<span class=\"c\"># Environment=\"MONGODB_CONFIG_OVERRIDE_NOFORK=1\"<\/span>\n<span class=\"c\"># To This line:<\/span>\n<span class=\"c\"># Environment=\"MONGODB_CONFIG_OVERRIDE_NOFORK=0\"<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Then it still refuse to up itself, but this time no errors:<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo <\/span>systemctl start mongod\n\nx:~<span class=\"nv\">$ <\/span><span class=\"nb\">sudo <\/span>systemctl status mongod\n\n\u00d7 mongod.service - MongoDB Database Server\n     Loaded: loaded <span class=\"o\">(<\/span>\/lib\/systemd\/system\/mongod.service<span class=\"p\">;<\/span> enabled<span class=\"p\">;<\/span> vendor preset: enabled<span class=\"o\">)<\/span>\n     Active: failed <span class=\"o\">(<\/span>Result: exit-code<span class=\"o\">)<\/span> since Mon 2023-08-14 20:33:54 CEST<span class=\"p\">;<\/span> 1s ago\n       Docs: https:\/\/docs.mongodb.org\/manual\n    Process: 1501 <span class=\"nv\">ExecStart<\/span><span class=\"o\">=<\/span>\/usr\/bin\/mongod <span class=\"nt\">--config<\/span> \/etc\/mongod.conf <span class=\"o\">(<\/span><span class=\"nv\">code<\/span><span class=\"o\">=<\/span>exited, <span class=\"nv\">status<\/span><span class=\"o\">=<\/span>14<span class=\"o\">)<\/span>\n   Main PID: 1501 <span class=\"o\">(<\/span><span class=\"nv\">code<\/span><span class=\"o\">=<\/span>exited, <span class=\"nv\">status<\/span><span class=\"o\">=<\/span>14<span class=\"o\">)<\/span>\n\nAug 14 20:33:54 x systemd[1]: Started MongoDB Database Server.\nAug 14 20:33:54 x systemd[1]: mongod.service: Main process exited, <span class=\"nv\">code<\/span><span class=\"o\">=<\/span>exited, <span class=\"nv\">status<\/span><span class=\"o\">=<\/span>14\/n\/a\nAug 14 20:33:54 x systemd[1]: mongod.service: Failed with result <span class=\"s1\">'exit-code'<\/span><span class=\"nb\">.<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Apparently it\u2019s a <a href=\"https:\/\/askubuntu.com\/questions\/823288\/mongodb-loads-but-breaks-returning-status-14\">permission issue<\/a>:<\/p>\n\n<div class=\"language-bash highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nb\">sudo chown<\/span> <span class=\"nt\">-R<\/span> mongodb:mongodb \/var\/lib\/mongodb\n<span class=\"nb\">sudo chown <\/span>mongodb:mongodb \/tmp\/mongodb-27017.sock\n<span class=\"nb\">sudo <\/span>service mongod restart\n<\/code><\/pre><\/div><\/div>","author":{"name":{}},"category":{"@attributes":{"term":"mongodb"}},"summary":"Stupid errors today."}]}