:::: MENU ::::

My NAS endgame (for now)

This is a draft for a video I plan on making for my (future) c3n.ro YouTube channel. It is raw but some people might want the content regardless.

I’ll introduce myself later, let me introduce my NAS!
[ Black screen, no music, fast cut]
[ Cut to video of a storage datacenter with loud fast music ]
[ Cut to black, silent ]
Yeah no this isn’t it, I doubt my neighbors would be fine with not having power due to all of it being redirected to my local storage for 10 bit anime.

[ Cut to slow moving exterior image of NZXT case, then video of harddrives, cooler ]
This is it! It’s my former PC that got upgraded to an i7-7700k CPU, 16 gigs of RAM and 12TB of storage in the form of 8 2TB hard drives.

[ Cut to video of computer monitor showing andromeda.lan ]
This isn’t even the best part, the best part is the software making this thing amazing – unRAID! Despite being a huge fan and supporter of FOSS solutions, unRaid isn’t actually free OR open source. It is however – pretty darn good at what it’s supposed to do and quite a bit more than that.

[ Cut to video recorded via OBS browsing their website ]
Visiting their website you’ll find out they describe the software as a “powerful, easy-to-use operating system for self-hosted servers and network-attached storage”, which basically hits home as to the actual capabilities of Unraid as well as my experience in the past year.

[ Cut to mixed video showing the hard drives then andromeda.lan page ]
Let’s talk about the setup for a bit, we’re running 8 2TB drives which in my array (we’ll go over that a bit later) setup translates to 8TB of reliable protected storage. We’re also running a Samsung 980 500GB SSD NVME drive for caching whatever we’re putting on shared storage before it being written to the actual protected array (this is unsafe, anything on the SSD could be lost if it doesn’t get written to the array).

Note that we don’t actually install unRAID on any of the data drives, unRAID runs off of a USB drive which is risky but also can be quickly re-flashed in case of failure, unRAID offers a cloud-backup that you can download and flash whenever s**t hits the fan – I’ve went through that process and it went excellent.

On the power side, I’m running a normal PSU but I’ve added an APC Smart-UPS 750 as a backup as well as a graceful shutdown enforcer, Unraid is based on Slackware so in the end you can install whatever you might need – and apcupsd is a thing so I’ve done a few settings to be sure that the array stops in a nice manner if power ever goes down for longer than a few minutes.

So about the array that I keep mentioning – Unraid has a few modes in which it can operate storage:

The first one is the Parity Protected Array, based on XFS or BTRFS this is the easiest way forward and the most recommended one for most people. It’s easily expandable, has great power efficiency and logically it’s the easiest to understand – you’ll have a maximum of two parity drives and a maximum of 28 data drives, and the rule goes that each parity drive will protect you against one data drive gone bad. Having a dual parity setup like mine should ensure me that I can sustain a failure of one drive with no data loss, then rebuild a new drive while still being protected for another failure. This is one of the reasons for which I already have a physically installed drive in the NAS that’s not actually wired up yet, whenever a drive will fail it’ll be a very quick and easy fix.

The second one would be going for a full ZFS pool – we’re not doing parity drives here and are fully relying on ZFS’s magic which unlike the Parity Drive setup includes self-healing for bitrot, data compression and snapshots apart from the higher throughput inherent with using all of the disks at once. The downsides of this setup (which might not apply to everyone) are mainly the increased resource usage (magic is resource intensive), ZFS is dark magic aaaaand the website does list increased power consumtion which I guess is to be expected when bringing into mind the higher throughput I’ve talked about a bit earlier.

The last one is a mix of sorts in which we don’t actually use a pool but use ZFS drives in an array, but we’re not getting the best of both worlds – self-healing is not available, throughput is the same as a normal parity-drive setup and the resource usage is still up. We’re winning on power consumption and we do get data compression and snapshots.

I’d still recommend going for the parity drive setup as it’s the simplest one and KISS is one of the best things in life, especially when dealing with your life’s savings in terms of data.

The thing is, and a lot of people skip this step – you’re not protected against catastrophic damage (think fires, water damage, lightning straight into a HDD), this is where off-sites come into play, and as the responsible SRE I am – I’m using Backblaze (in a not fully sanctioned way) to constantly backup everything into the cloud so I can sleep sound knowing my data is actually safe regardless of the status of the drives or the server whole.

Let’s move to actual usage – this is a NAS so of course we can create users and shares, with all the combinations you can imagine in regards to permissions, protocols and so on. I’m using quite a few devices for my day-to-day, a Macbook, a Linux laptop (and quite a few other linux devices) and a Windows workstation, all of them should and do have no-fuss access to any of my private shares as well as the public ones.

In terms of speed I think I’m more limited by the networking setup, cable quality and other things since I can pretty much get 110MB/s on the regular between the Windows box and unRAID. I am planning however on letting my autism get the best of me and moving towards a fiber setup between unRAID and a switch, despite it not helping that much given the limitations of HDD speeds – but we’re futureproofing here people.

The unRAID UI is pretty nice, you can get a very good glance at the health of the whole system by going to the homepage, and you’ve also got a nice albeit basic alert view to see if anything went wrong while you were away. One of the things you can see here is a parity check, this is how unRAID ensures your drives are in perfect order, this should ideally run at least once a month but if you’re very mindful of reads/writes on your HDDs you can go with higher values, as long as you’re green you’re good.

Still at a glance away is your usage of storage as well as a S.M.A.R.T. drive status table, for that extra peace of mind seeing more green thumbs up.

Now onto the cooler parts than reliable storage – this thing can run Docker! and not as in “you can drop into a terminal” despite that also being an option, but it treats Docker containers as a first class citizen as well with their “Apps” which is a nice word for XML templates that define the location of Docker images as well as settings for them.

I’m currently running quite a few Docker containers, Jellyfin for my media needs, PostgreSQL, PiHole, Backblaze, Calibre and so on. The best part is – if something isn’t already made into an “app”, you can enable Developer Mode easily and create your own like I did for the OpenWebRX software that I use with my RTL_TCP/RTL_SDRs. You get all of the normal Docker goodies like mounts, network ports, different networks alltogether and so on. You do get a nice prompt to update them all at once whenever needed so it’s taking off quite a bit of work from maintaining a large number of self-hosted apps. One cool part of Docker support is that you can actually pin CPUs for specific apps, so if you’ve got a known resource hog for example you can ensure you’ll always dedicate a certain amount of cores to it.

The Apps tab will have a ton of interesting containers you could run, and I’ve found quite a bit of software I did not know about that I ended up using in my day-to-day.

There’s also a plugin system, plugins mostly add to the unRAID experience, you can easily tell that since my added plugins are unbalanced (which helps balance drives, this is usually done automatically but I screwed up on my initial setup), prometheus because metrics as well as a plugin that will display temperatures on the homepage.

So yeah, this is my current NAS setup and I’m really happy with it one year later, I’ve had so many drives from many years ago that were just waiting to die and now everything is safe and protected and I’m all the calmer for it, if you want to find out more I suggest you give Unraid.net a visit and check them out if you’re in the market for a NAS with an inclination to tinkering (but just a bit).

(Expect this sort of videos on this channel, I’ve got 100 tech-related interests and I decided I’ll make videos of them all.)



Today I developed film

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

[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

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


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

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

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)

The world right now

What a hectic mess we yet again find ourselves in. A pain of a situation brought upon us by unhappy children, people contempt with what they know – Plato’s cave syndrome, populism, lack of vision, fear of progress and possibly a handful of other psychologically interesting factors.

As always, this is a stupid thing to say but these are my opinions and as such only reflect me and my brain, not anyone else.

I won’t get into Putin’s stupid evil invasion, or into NATO’s expansion or even into the cold war, I don’t think these matter anymore.

I’m young by old-people standards, I’m 28 I think, I grew up watching The Jetsons and being so excited about the future, I’ve went from landline to StarTAC to Androids and now iPhones, from dial-up to breakneck speeds on fiber, from the world being so big – to having true friends across thousands of miles. I grew up innocent and rebellious and taking everything for granted, only with the hope that we can do so much better than we are.

I grew up watching 9/11 on TV without understanding what we were witnessing, living through consequences that hit more close to home that I was able to understand at the time. It felt so far away, despite C-17s and all sort of other C’s buzzing my house constantly.

20 years later I have RC-135s, Aries and F-16 (among others) birds buzzing my house yet again, 20 years in which I (alongside the rest of the world) tried to build something of myself, fought with demons small and big, and arrived at a sort of just-next-door balance. We all did the same, war was out of any sort of question for all of us – since none of us ever heard someone use “I’d go to war” as anything else than a metaphor for their beliefs. I’ve recently told my therapist that my whole plan for life specifically plans for a lack of war, my whole castle is made out of cards that don’t sit on war being anywhere near me. I know it’s a reality of life and even that it does have some benefits, I also know people in X places have been suffering it for a lifetime by now, that doesn’t make my situation better, if I could I’d very much like those people to also not endure the horror of war.

I’ll come off as egoistical, but I’m more importantly going to be honest and naked in my writing here, which is the excuse I will want applied to me later on.

A bit of prologue: back in the 90s Romania had to choose between two people, it was the country’s first democratic election – one of the candidates was a bow-tie wearing older gentleman saying “I’ll fight to my last blood cell for your right to not agree with me” and his opponent a former communist party member, someone fallen from the graces of the then-leader Ceaușescu. Romanians – out of fear and lack of better knowledge chose the latter, because it was what they knew. I am constantly blaming romanian for the choice they chose, with hindsight always being 20/20. This is something I often transpose whenever the discussion takes a turn into the “the politicians, it’s their fault” area, because it isn’t though is it? They are merely put there by people who believe they are the most accurate reflection of their interests, and if the politician is a populist – he’s there because the people want, nay, need that populism. Populism is, seemingly lately just another word for social measures (that are popular exactly because there are a lot of people in need, and who can blame anyone for voting for someone who promises you a better tomorrow in whatever form that may be), such taboo for liberals – helping those in need. Point of the matter – we choose what we (in the majority) are.

I’m trying to set the scene here, so it may seem I’m walking on a thousand paths. I am.

To the people in Ukraine, to the ones I know and the ones I do not, to Slava, Lucy, to all of you – I cannot imagine what you’re going through, I wouldn’t have had the strength, stoicism or will to live – going through what you are. I will always have the upmost respect for the power you’ve shown during these times. You did not want this, you did not need this, you did not deserve this.

Yet, looking at it from way high above – this is a war now for imaginary lines. For Putin’s idiotistical imperialistic desires. I am ferm on the side that he should not be allowed to get away with this, nor should lines be redrawn due to the wishes of a rat-faced second-hand Tsar-wannabe.

Those lines are funny like that, they were the reason for the world’s many past wars, from lebensraum to the Roman Empire to Russia now.

It feels now that it’s a perfect example of us – the collective people of the world – focusing too much on what makes us different, from the street we live on, the neighborhood, county, country, continent, color, faith, gender or any other totally arbitrary or wheel of life attribute we could imagine, and not enough on what makes us the same. Any two of us are way more similar than different, we may not speak the same language or praise the same God or live the same lives, but I strongly believe we all want to just live our little-unimportant-to-others-lives and go to that little coffee shop when we’re stressed and rejoice for 10 minutes before going back into the huge-for-us stress that is work or whatever we may have on our minds.

I’m trying not to say “give them the land” because not so long ago I was hellbent against anyone saying that a specific part of my country belongs to another, so I would be a hypocrite, yet what is evolution if not reaching a point where you can see you were a hypocrite.

I don’t like the perspectives of war, I don’t like the idea of Europe and it’s sometimes-shame worthy cousin the U.S. getting into a fist fight with Russia over Ukraine.

I don’t like it because it would affect me.

I don’t like it because it would affect my dear ones.

I can’t hide the naked egoism in here, otherwise I’d be a hypocrite.

I don’t like it because whether a Ukrainian, Russian, American, Chinese, Dutch or German or any nationality person dies – in the end a person dies and I swear to fucking God I cannot fathom we’re still accepting this.

In a way this is what Russian people chose as leaders, but it’s hard to blame people for choosing bad leaders, I’ve seen it happen here as well many many times, but if you think about it in realistic terms – of course the poor sod with nothing to feed the kids will vote for the guy saying he’s going to bring milk and honey on all tables.

Which brings me to diplomacy, and how we’re fucking failing at it. We’ve made multiple bodies as time went on specifically to keep a relationship going between two of the world’s nuclear powers that have historically hated each other (without a good reason), seeing X person being denied access to a meeting of said body makes me furious, because that was the whole purpose of it – a meeting between those two parties. I’d also very much enjoy all diplomats to remember that their sole purpose is communicating, not being children that won’t talk to Y because “I don’t condone their attitude”, well, then you can go not condone it at home and stop representing me, since I stand for war not breaking out.

I also have some issues with the US press especially pushing the idea that Ukraine can win this – because I’m so sorry but it can’t. You’re a non-nuclear state fighting a nuclear state whose whole strategy in the World War was “throw as many bodies as we have” at it (granted, the US helped), and won. Even if you’d fight this strategy of theirs, would your people still exist to enjoy anything left of the country? At this point, no one can win – not Ukraine, not Russia. Everyone can cut their losses though, count their dead, mourn their loss, and strive for a better tomorrow. Putin’s going to take a hit because of this, definitely – but I’m always going to wonder if this could’ve happened 6 months ago if the diplomacy failure wouldn’t have happened, and he would’ve had an out for the local political scene in Russia.

I want, and need – more talks about peace, about reaching the middle ground, not someone losing, but everyone winning. This is a big planet with a lot of people on it, surely we can make an actual effort to all get along.

I may be naive in my views, but hope is one thing I still have, and if not obvious – this represents solely my views as a person.

I fucking hate war dogs.


Pages:1234