How to reset HP color laser 150nw

Every time I change my wifi at home my HP color laser 150nw stops working and I need to spend more than 1 hour finding the right docs on the internet.

Here’s what I found is working:

  1. Download HP Smart app on your iPhone
  2. Reset the printer by unplugging the power cord, press the power button for 15s, then plug the power, leave the power button pressed until you hear a click and the printer turns on
  3. To be sure, reset the wifi by pressing the blue wifi button for 15s - the power button and an button flash
  4. Start the setup process in the HP Smart app: new printer, then click “printer not listed” -> Wifi
  5. Then it prompts you to switch to your printers wifi. Do that. The wifi name should have “setup” in the name
  6. If you choose the wifi network and it asks for a password you’re stuck (online manuals say 12345678 is tha password or that it prints the password when pressing the green down button for 20s - both were not true for me) - you need to do the reset again
  7. Now there should be a progress bar in your mobile app. For me it got stuck the first time so I needed to go back to step 2.

Yes, it seems like HP did a real quality product here.
Not!

"Irene hilft" - new offer of my wife about 'Hilfe im Alltag'

My wife Irene started an offer “Hilfe im Alltag”, where she focusses on people overwhelmed with their household who need help and support in certain areas of everyday life:

  1. Decluttering
  2. Keeping the household in order
  3. Budgeting
  4. Cleaning
  5. Menu planning / Cooking

Her region is restricted to the area of Bülach/Rafzerfeld.

She helps people to get back into a well working household where everything is tidy and clean and to regain confidence in their own abilities.

Link: irenehilft.ch

How to stream chatGPT from Flask to react (using only HTTP)

Streaming chatGPT API response to react frontend. GIF depicts actual speed

ChatGPT’s UI (and most of the 3rd party tools) have streaming output. This is not just a gimmick but follows the way LLMs generate the output: word for word.

So you usually also want to output to the user: word for word.

Turns out this is very simple to achieve.

My first attempt was using web sockets - which turned out to be unstable and needs lots of overhead. In came Ilias, who created a ChatGPT to Telegram Bot that streams responses to users. He was like: »man, why are you using sockets for this!?« And enlightened me that the same thing is possible with good ol’ http requests.

Plus: This method uses zero additional dependencies.

Hope that I’ve wet your appetite.

So enough of those introductory bubbles, let’s talk tech.

The whole idea is that the frontend (react) POSTs a JSON to backend (flask) which then “streams” the data back by outputting line by line, leaving the HTTP connection open until all is done.

How to stream ChatGPT output from python backend to react frontend

Streaming chatGPT API response to react frontend. GIF depicts actual speed

ChatGPT is great, no question. But when I tried using the API, I found the speed of the response lacking.

When using OpenAIs web frontend I saw that the answer is appearing word for word.

I thought: »I might be able to stream the chatGPT api response in realtime. This way the user has immediate feedback without needing to wait for 20 seconds«.

And - lo and behold - this is possible!

Update 2023-10: Turns out there is a much simpler way to achieve the same without websockets, without needing to run gunicorn with only one worker, patching openai etc: read here.

What we’re building today:

  1. Call ChatGPT API
  2. Stream the data with SocketIO from python (flask)
  3. Receive the data in react using SocketIO and display it bit as bit in realtime

How to use firebase to authenticate next.js/react against flask backend

What you'll have at the end of this howto

I’m migrating my frontend away from Flask to next.js, reducing my flask app to only backend apis.

This blogpost explains how a next.js app authenticates against flask backend using flask-login.

It assumes that you have in your flask backend:

  • an endpoint auth/sign-in which…
    • accepts a POST request with the firebase idToken
    • checks the token against firebase
    • when successful, logs it in with flask_login’s login_user
  • your api routes secured with @login_required

How to use Brightdata with scrapy

Brightdatas Proxy Manager (click to see full res)

With weegee.ch I run a handful crawlers. At the beginning I didn’t have problems with crawling protection but over time my little project got more successful (I’m on the first page of Google for the relevant search queries since a few weeks) so I see more and more websites blocking me.

I went for Brightdata as they offer a good “pay as you use” model which works well for smaller sites like mine (and don’t require to pay a minimal price per month).

I couldn’t find a documentation which covers the whole install process, that’s why I’m writing this post.

Launching weegee.ch - my first side project

During the past few months I’ve been busy creating my first side project. This week, I’ve reached a milestone - both Web and mobile apps are now available, may I present to you:

weegee.ch - the biggest shared flat search in Switzerland. In Switzerland, shared flats are called WGs (for WohnGemeinschaft), pronounced “weegee”, that’s where the domain name comes from.

It’s available for web, iOS and android.

The data is coming from crawling shared flats from wgzimmer, flatfox, urbanhome, ronorp and tutti - creating a shared flat search which is twice as big as any of the other portals!

How to install matomo for nginx on amazon linux 2

Matomo is a replacement for google analytics which is free when you self-host it. Honestly, I underestimated the effort it takes. Turns out it needs php, mysql and fastcgi running, since I’m running a python/postgres stack it adds quite a bit of clutter onto the server…

But anyway: here you are, the following guide installs Matomo with…

  • php8
  • mysql 8.0
  • nginx / letsencrypt
  • php-fpm (fastcgi)