Konsthol Konsthol's site en-gb https://konsthol.eu/rss.xml The magic of Wake-On-LAN https://konsthol.eu/log/the_magic_of_wake_on_lan-19-12-2024.html Thu, 19 Dec 2024

DATE: Thu 19 Dec 2024 18:35 By: konsthol@pm.me

The magic of Wake-On-LAN

Years ago, some good friends of mine gifted me for my birthday, a Raspberry Pi 4 with 2GB of ram. It was and still is the most thoughful gift anyone has ever gotten for me. It aligns perfectly with my hobbies and I used it for a long time as a VPN server using WireGuard and I also played around with Pi-hole for a while as a network-wide ad blocker.

Eventually I became more interested in cloud computing and started self hosting many services on a VPS that I rent through MVPS. It has 4GB of ram and has currently many of the services I use in a day-to-day basis like my Gitea server, Searx, NTFY and many others. While it was definetely doable for the Raspberry Pi to host these, the 2GB of ram would not allow for every service to be run at the same time. You see, my friends were lucky to even find one because it was in the middle of the chip shortage problems.

One day as I was thinking about what kind of projects could I utilize a single Raspberry Pi for, it hit me. A simple Wake-On-LAN server. It requires almost no resources as it just needs to stay on and send out wol packages when I need it to. The Raspberry Pi is connected using Wi-Fi to the same network as my laptop. Usually if I wanted to wake my laptop up using Wake-On-LAN I would need to have it plugged with an ethernet cable with the router. However, the Raspberry Pi has an ethernet port and a cable has two ends. Which lead me to try to connect one end to the Pi and another one to the laptop. At first I begun with a simple shell script that used etherwake. A simple command-line tool that sends Wake-On-LAN Magic Packets. It worked like a charm. I had enabled Wake-On-LAN in my laptop’s BIOS, it was enabled on the operating system, which I checked using ethtool and it was super easy to remotely wake my laptop up using a Termux shortcut on my phone which used ssh to connect to the Raspberry Pi and from there execute the etherwake command.

That setup was wonderful but I wanted to make it even better. It wasn’t actually a Wake-On-LAN server at this point. The only service that was running on the Pi was SSH and I just used a command to wake just my laptop up. So after some research I came across Flask. With Flask I managed to make an actual server that used routes, authentication, logging rate limits and everything needed to make it robust, secure and functional. The main reason I currently prefer my project over etherwake, even though etherwake is still a great tool that follows the Unix philosophy “Do one thing and do it well”, is because of it’s dynamic nature. I can configure a .env file with many device’s MAC addresses and have as many possible routes as the number of the devices. So for a laptop and a desktop I have LAPTOP_MAC=“itsmac” and DESKTOP_MAC=“itsmac” and can wake them up using http requests in the route /wol/laptop and /wol/desktop respectively.

Mascot

I would suggest anyone to take a look at my project’s repo and if they find that it fits their needs, use the setupSingleBinary.sh script to grab the latest executable. The repo is over at

WOL-Ly

..

]]>
WebCall https://konsthol.eu/log/webcall-25-02-2023.html Sat, 25 Feb 2023

DATE: Sat 25 Feb 2023 22:42 By: konsthol@pm.me

WebCall

One of the simplest ways to host a “telephony” service is to use webcall.

Like with emails, you can use any webcall server to communicate with any other webcall server. Meaning that if for example you register a number with https://timur.mobi/ which is the default public server you can still make a call to someone who has registered a number with https://talk.konsthol.eu if you know their number by replacing the server address field in the dialpad icon.

All calls are encrypted and the server does not have access to the content of the calls. That is because the server uses webrtc and tries to make peer to peer connections.

There is also an integrated TURN server which is used if the peers can’t connect directly but if the connection is made though that then no video transmission is possible. I suspect that this is a limitation of the TURN server used in webcall because in jitsi meet which uses coturn instead of pion, it is always possible.

Another differentiation of the two services is that in webcall no more than 2 people can join a conversation, which is more similar to how a regular telephone call behaves.

Also there is currently no functionality to block a number as far as I can see but it should be fairly easy to figure out the public ip address and block it like that.

You should give it a shot and see if it works for you. The source code is at a link over at

https://timur.mobi

..

]]>
wpgtk is just more convenient https://konsthol.eu/log/choose_wpgtk_over_just_pywal-17-08-2022.html Wed, 17 Aug 2022

DATE: Wed 17 Aug 2022 00:09 By: konsthol@pm.me

wpgtk is just more convenient

Pywal is a simple KISS principled python application that extracts colors from an image and creates a color pallete to theme different programs

By default there are some templates that are stored in its .cache directory and there is an option to create new templates in its .config directory.

I found it to be simpler to create every template with wpgtk and store it in its templates folder in .config because there it also utilizes symlinks to its respective files and thus you can have every program’s file to manage in one place.

Moreover wpgtk conveniently stores each created colorscheme in a schemes folder in .config and along with that every wallpaper used as a symlink to the actual wallpaper in a wallpapers folder.

It also has a gui interface but I never really found a use for it as one can easily perform every needed action using just the cli.

After creating a script to be run after every use of the program to theme application that need third party scripts like telegram and qutebrowser the process of switching colorschemes on the fly becomes easy as pie and fast as fuck 🤫

Just give it a shot! Maybe I’ll upload my postWPG script in my gitea instance sometime soon and create an actual tutorial on how to use wpgtk

..

]]>
Awesome file sharing tool https://konsthol.eu/log/easy_file_sharing-12-09-2021.html Sun, 12 Sep 2021

DATE: Sun 12 Sep 2021 00:53 By: konsthol@pm.me

Awesome file sharing tool

Croc is one of the best easy to use file sharing cli tools I came across and only recently discovered how easy it can be to self host your own relay.

Croc as far as I understand needs an intermediary to staple as it says the connection between two computers. If I grasp the concept correctly if two computers can both connect to a third one then a connection between them can be established. The files sent over don’t get first uploaded to the third one and then downloaded to the second but somehow get uploaded and downloaded simultaneously.

I’ll have to further read about that but in short if you have a computer like a server with a static ip that is easily accessible from the internet then because of the great job the author did you can host a relay simply by typing the command

croc relay

which will by default use the ports 9009-9013 but you can specify your own with the –ports arguement like

croc relay –ports 1111,1112

Then if you make that into a systemd service (which I won’t be covering just yet cause I don’t really understand them and only make them by copy pasting basic templates 😐) it’s basically a set and forget kind of thing and you can now send files to anyone in any operating system by using croc by typing

croc –relay “your.domain:9009” send [file]

and the recipient can download it by typing

croc –relay “your.domain:9009” [code]

This is super useful cause there was a time when the public instance was down and I couldn’t send files when it was just so easy to not be dependent on the public instance in the first place.

You should definetely read more about it on Croc’s github page and set up your own relay asap 😎

https://github.com/schollz/croc

..

]]>
Just a test https://konsthol.eu/log/images_test-02-09-2021.html Thu, 02 Sep 2021

DATE: Thu 02 Sep 2021 20:10 By: konsthol@pm.me

Just a test

If Drew’s script makes this image viewable from a browser I guess it just doesn’t work yet for miniblogs 🤔

I wanted to show that by removing the sort command from the part of the upgem script that makes the rss, my blog posts ironically end up sorted at least in newsboat cause by default the script tries to operate the date -d function on a date without hours and minutes so most rss readers end up mixing posts that took place on the same day 🧐

Image

..

]]>
Tracking sucks in general but especially when it gets too invasive https://konsthol.eu/log/what_the_fuck_google-28-08-2021.html Sat, 28 Aug 2021

DATE: Sat 28 Aug 2021 23:39 By: konsthol@pm.me

Tracking sucks in general but especially when it gets too invasive

Having no google account or any google apps on my phone for a very long time felt and still feels kinda liberating. I deleted my temporary almost unused google account recently and also decided to delete my browser cookies today so that no site has any preferences etc I may have set. Today while surfing on youtube without a google account obviously I stumpled upon a trailer for a movie that my friend showed me the other day from his laptop and his google account. I didn’t even think about the subject of the movie and 100% never searched about it. People tend to call you paranoid when you have no google account, no facebook, no instagram etc but things like these make me think that i’m still not trying hard enough and my op sec still needs hardening 🙄

..

]]>
The way to completion https://konsthol.eu/log/gemini_capsule_progress-25-08-2021.html Wed, 25 Aug 2021

DATE: Wed 25 Aug 2021 17:59 By: konsthol@pm.me

The way to completion

My gemini capsule has been getting more and more complete thanks to Drew’s scripts and thanks to hexdsl for making so many cool videos about it 🥳

..

]]>