NanoKVM Script

Standard

Yet another script – that actually made the YouTube channel, albeit not a new one but the old codin_ro one.

Find the script below

Continue reading

Lipsă (publicitate)

Standard

Cuvântul dintre paranteze a început să fie uitat din ce în ce mai des din textele/titlurile emanate de diverși scriitori/jurnaliști/influenceri și alte categorii de oameni care produc felurite tipuri de conținut, și astăzi e ziua când m-a enervat unul dintre ei.

Continue reading

Today I developed film

Standard

I’ve fiddled with photography for quite a while now, more than half of my life at this point, but it was mostly digital, my journey started with a Trust camera brought by Santa, in the early oughts, from which unfortunately I don’t think I have any saved images.

Then from this I remember the next camera-integrating-device being a Nokia 6233 from which – once again – I do not have anything saved. The first actual “big-boy” camera was my trusty Nikon D40 which went through my adolescent hell period but nevertheless it still survives to this day and I still have a ton of images from it.

Somewhere along the path I got a film camera for one of my birthdays, but I’m unsure if it occurred after me in the life at that point found out about Lomography and the existence of the Lomo Fisheye camera, regardless – the Fisheye I had still exists, and a Zenit I got as a birthday gift also still exists in my possession.

Thing is – a lot of the films I shot were never developed, and we’re talking about rolls of 35mm that are now anywhere between 12 to 14 years old (since I shot them at least), so being the anxiety ridden person that I apparently turned out to be – I decided the best way to fuck up your anxiety is to do something weirdly specific requiring exact temperatures and timings and chemicals that are more-or-less dangerous.

(Disclaimer: I have a friend that knows shit, but he – and I quote – “left me alone to see what I do”, so some things that may be written here might be his wits, not mine.)

After a quick google search I decided I can do this, so I ordered a Paterson B&W Developing Kit (mostly for the goodies), a CineStill C41 Simplified chemical kit, and a few other tools from FotoImpex.de as well as filmpefaza.ro.

The generic procedure is – you need to take out the film from the canister in total darkness (I used a changing bag), then put it on a spiral into a light-proof tank that will hold your chemicals to develop. You use the first developer while rotating the tank, after a set amount of time you move to the next chemical – the fixer/bleacher/etc, and finally you rinse it, afterwards you can remove your film and put it into a scanner to actually get the photos!

The Black and White developing procedure is rather straightforward and doesn’t really require precise or high temperatures, the Ilford kit specifically is made to be used at around 20-24 degrees Celsius, but after developing the friend that knows shit told me I had “shit density” which took a while to understand that he’s actually referring to the density of the film imprint thingy (e.g. what you shot), which might be due to too long of a developing time, regardless – I was really happy with the results given it was my first time and I also didn’t ruin a film from some years ago. After this I also got a Kodak Mini Digital Film Scanner, which is mostly crap but also – works like a charm for my needs.

You can notice several water droplets dried out as well as some very small dust/hair parts on some images, I guess I shouldn’t have rinsed after applying the Photoflo to the developed film.

Well that worked like a charm, on to developing C41 rolls now! I used the CineStill C41 Simplified kit, an aquarium heater and an aquarium pump to make sure the heat is moved around the container in which I sunk the developer bottle and the bleacher/fixer bottle, then started developing.

I had a nice accident while waiting for the Blix to do its thing and the cap off of the Jobo tank popped, spraying me with a mix of ammonium thiosulfate, ferric ammonium, sodium metabisulfate, luckily being the semi-blind-man I am I was wearing glasses so I only got sprinkles on them instead of my eyes. I had the composure not to fuck up the film I was fixing, and continued inverting the tank.

The colors aren’t the greatest but I’m totally fine with them, again – happy that I didn’t totally ruin a film from several years ago. I’m sure the next rolls will fare much better, but then again – this was good as well.

You should totally try it, it sounds super intimidating but isn’t as difficult as you’d imagine.

As for the anxiety, it takes your mind off of it a bit since you need to focus on inverting the tank every 30 seconds.

Minifesto despre democrație

Standard

[Disponibil și aici, pe Google Docs]

Motivul pentru care există această lucrare este situația politică și civică din România – valabil pentru momentul Ianuarie 2024 cel puțin, scopul fiind acela de a releva cum s-a ajuns în acest punct (de desprindere între legiuitor și cetățean, fapt ce conduce la decizii luate nu în primul rând pentru binele cetățeanului, ceea ce duce la nemulțumiri ale cetățenilor) și cum am fi putut să nu ajungem aici – sau să îmbunătățim situația pe viitor printr-un efort de a explica motivele pentru care sistemul democratic există și cum ar trebui în fapt folosit și exploatat de către cetățeni pentru a beneficia de un stat puternic și o democrație sănătoasă și reprezentativă pe viitor.

Continue reading

Puțin despre PISA și sistemul de educație

Standard

Zărit-am titlul acesta care anunță că suntem vărzet tăiat fin la competențe în matematică, înțelegerea unui text sau științe.

Context: Testele PISA sunt o testare internațională sub egida OECD pentru a evalua sistemele de educație din țările participante. România participă la ele din 2006, metodologia este în principal selecția aleatorie a 5000 de elevi cu vârsta de 15 ani care dau un test standardizat.

Cumva, suntem vărzet – și mai vărzet decât restul, vedem chiar aici rezultatele proiectului “România Educată” – chiar din 2016 de când a început “proiectul” după cum spune chiar site-ul Președinției.

Am fost la un pas de un AVC nu din cauza rezultatelor cumva…de așteptat, ci din cauza reacției minim cretine a Ministrului Educației – Ligia Deca – acesta ieșind la rampă să menționeze:

rezultatele României la PISA 2022 s-au menţinut la aproximativ acelaşi nivel ca în anul 2018;…avem un sistem de educaţie rezilient şi ţara noastră a reuşit, prin ansamblul măsurilor luate, să limiteze efectele pandemiei

Adică e super bine man, îți dai seama cât de rău ar fi putut fi?

Ei, nici până aici totuși nu eram convins să scriu ceva pe subiectul ăsta, până am dat de acest răspuns oferit de un Cătălin Ciupală (profesor de matematică la un liceu din Brașov). Menționează dânsul în propunerea sa că testele PISA au probleme de matematică ce au legătură cu viața reală, pentru se putea face un transfer mental din tangibil în abstract și vine cu nucleara

O astfel de raportare la realitate lipsește în general în România, atât din predare, cât și din testare, cu toată că nu lipsește din programă

De asta am scris textul ăsta nenorocit, pentru că eu până acum câțiva ani nu știam la ce naiba îmi folosește teorema lui Pitagora – am aflat când am vrut să știu câți metri de frânghie îmi trebuie pentru a ancora un stâlp, și abia atunci a existat acel click – când am văzut aplicabilitatea în lumea reală – că ai mei profesori de matematică n-au știut/vrut/putut să o facă.

Bypass vendor lock-in for PLC dashboards with 120 lines of code

Standard


Say you’ve got a legacy app that’s used at your large enterprise that shows you a few values on an old wrinkly dashboard — with no other option than just seeing that value or exporting a PDF report of historical data.

Just as well let’s say the vendor of the solution is now charging you an arm and a leg to update that dashboard, add new PLCs and add basic functionalities like graphing, you could plan ahead — prepare your budget and go with the vendor that locked you in, or you could use tools used by giants to avoid that, get rid of vendor lock-in and own your data.

Let’s talk about the second option, because I have no experience with the first one.

What’s a PLC? A glorified, hardened and fast controller with a variety of inputs/outputs that you can program to do operations (the name stands for Programmable Logic Controller), in a very simple manner of saying. They’re often used to control industrial equipment ranging from water flow sensors, chlorination stations or even nuclear plants.

Usually very proprietary software controls and programs such devices with a possibility of quite a few protection layers including at the hardware level for anything from hacking to reverse engineering.

Enough about that, let’s get to the data retrieval part.

First of all you need to know where your PLC is — specifically the RACK and SLOT, you can find this in both the PLC programming software, or you can dig around the legacy app and find the information.

After you’ve isolated that, you need to figure out where your data is — specifically the DB Number, the Address at which the information starts, and the Size of the information.

Your data could lie in DB2234, at an offset of 10 bits and have a size of 4 bits, for example. All of this could be found in the said proprietary software suite or the legacy software config files.

type PLC struct {
 Name    string `json:"name"`
 Desc    string `json:"desc"`
 IP      string `json:"ip"`
 Rack    int    `json:"rack"`
 Slot    int    `json:"slot"`
 Address int    `json:"address"` // This is the DB Number
 Start   int    `json:"start"` // This is the Address
 Size    int    `json:"size"` // This is the length of the data
}
// This is all you need to get data.

I chose to use Golang and this very useful library to scrape the data from a number of PLCs, then followed the Prometheus instrumenting documentation to expose those metrics and scrape them into Prometheus, less than 120 lines of code later — the metrics were being exported.

Finally we ended up with a nice dashboard in Grafana that allows us fine grained control over the data and enables us to do visualization of historical data, comparisons, and generally doesn’t lock us in to a specific vendor or exorbitant pricing for modifications.

That part is the easy one, the tips that’ll save you a lot of time are as follows:

  • look for the program blocks, those will show you how the data is getting composed and outputted — sometimes you’ll need a scaling factor to get the real value (since the PLC reads analog voltages, not actual human values)
  • data types are sneaky, sometimes it’s a float32, sometimes it’s a float64

This is by no means something new or amazing, and there’s a great talk by Toby Varland of Varland Plating (whose image I stole above) about using Grafana and InfluxDB for the same purpose, possibly in a better way than I did.

In an ideal world I would’ve made use of Grafana Live and a datasource plugin to have actual real-time data, but this checkmarks the 80/20 rule and is better than nothing, for now. The art of making high priority into low priority into tech debt.

I wish you the best of luck in trying to save your company a ton of money by using this “simple trick.”

I don’t want to have shut up

Standard

Israel is killing innocent people while on a crusade for Hamas members. This is their policy, so there’s no hiding around “it’s a war”, it’s a planned asymmetric retribution for Hamas’ despicable attack on October 7th.

Israel has been running an emotional campaign brandishing the horrors perpetrated by Hamas in an attempt to shock the world, as though people dying isn’t horrible enough, while not acknowledging the suffering they’re causing to innocent civilians that have been displaced and had their lives limited by the above mentioned state.

Furthermore there have been moments shockingly similar to those 20 years ago.

I’m not fine with this, and this is me saying something – Palestinians should be allowed to live.

If it’s not obvious, these are my opinions solely, and luckily there’s still free speech around.

GY-906 / MLX90614 on Pi Pico

Standard

This’ll be a placeholder for the other lost souls I found trying to hook-up an infrared thermometer module to the Raspberry Pi Pico (W) using MicroPython.

You need SoftI2C instead of the hardware I2C – and stuff will just work, the issue relates to clock stretching, here be a snippet to get you back on the path (that doesn’t require you to go into a frenzy of replacing resistors, adding new ones, breaking out the oscilloscope and so on).

I’ll write more about what I’m doing…eventually.


i2c = SoftI2C(sda=Pin(0), scl=Pin(1), timeout=100_000, freq=100000)
t = i2c.readfrom_mem(0x5a,0x07,15)
u = ustruct.unpack('<H',t)[0]
tC=str((u*0.02)-273.15)
temperature = float(tC)