Steeph's Web Site

Go To Navigation
Show/Hide Navigation

Entries tagged 'cat:Projects'

SBWG 0.12.8

I've recently published a new version of SBWG, my web site generating bash script. The time that I'm able to allocate to working on SBWG fluctuated a lot in the last year and when I do work on it, I often just feel like doing one type of thing. So, when that is starting a new feature, all the other types of tasks can take on a pile that takes months to resolve. But eventually I managed to test and stabilise the features that I've added and changed, edited the README file and tried out the new version with real web sites. Well, testing could be more professionel, but it's okay for a hobby project, I think.

It's been well over a year since I wrote a blog entry about what's new in SBWG. This entry goes through the main new things since version 0.11.1.

A big new thing, at least from the view of the author/me, is that certain options where that makes sense now support multiple arguments. For example if you've edited three entries and want to re-generate just those three, you don't have to run the script three times but rather define the entries like this: sbwg -e ENTRYNAME_1 ENTRYNAME_2 ENTRYNAME_3. The same goes for pages, tagpages, entry attachments and galleries. This doesn't just make it easier and quicker to generate just some changed pieces of content. It also allows the usage of shell globbing (like *, ? and […]) and brace expansion ({…}). For example you can now regenerate all entries that are stored in one subdirectory or all entries whose names start with a vertain string of characters. Another practicle use case is to add external entries and/or to the site that are not stored in the respective directories in the web site's input directory. Using option -E/-P on the contents of an entire directory creates HTML files in the web site's output directory that look like any other of the web site's pages, but without integrating them in the structure of categories and other tags.

There is now a way to create a custom menu in the navigation bar without writing any code in the settings file of a web site. By using the new 'menu:' tag type in the header of a page or entry source file, the page or entry will get added to the menu. This allows for a list of pages you want to link to from the site's navbar, or a nested tree of interesting blog entries. The tag can be used similarly to the 'topic:' tag with the main difference that it doesn't add the entry or page to a list of entries with that topic, but rather directly in the navigation bar. In the default style set that is a drop down menu like the list of categories, authors, languages and topics. But it is just an unordered list, so it can be styled like any web site menu.

The default style set has changed a bit over the year. It basically looks the same but it's a bit cleaner now and is split into more file more logically. It will become even cleaner in the future though. It now also makes use of the new possibility to present the list of categories in the navigation bar in the form of a tag cloud. Audio attachments are better to look at now, especially when there are several audio files attached to an entry. Image attachments are can now be previewed in a modal without loading the (large) original file and without leaving the page. This almost gallery-like display is about as far as I'd like to go without starting to use JavaScript in the default styleset. Some parts of a web site generated with SBWG are now collapsible/expandable. The parts with this new feature are: entry attachments, entire entries on tagpages, entire entries on their own pages, the custom menu, the category list, topic list, language list and author list in the navbar and the entire navbar. By default all of those things are extanded upon page lead and collapsible by clicking/tapping on their titles. But you can add a setting in your settings file for each of those types of things to be collapsed upon page load and expandable by cliking/tapping on them.

Another thing that behaves similarly is content warnings. Hiding the content of an entry, or parts of it, could always be done by hand, e.g. by adding a <details> and <summary> tag pair to the body of the entry. But it is now easily possible by adding a warn: tag to the header of an entry. For example adding warn:This entry contains spoilers. to an entry header results in the entire content being hidden behind a collapsed <details> tag. Initially visible is only the summary "This entry contains spoilers. (click to open)". The default style set makes this warning line very visible but dunking it into a strong red. If the entry has attachments, those will be collapsed and their title marked in red, too. Both the entry content and its attachments will be collapsed by default if the entry has a warn: tag, independently of what your settings for those parts is in the settins file.

New special tagpages: If there are entries that have a language tag and others don't have one, 'nolang.html' will be created that lists all entries that don't have a language tags. Similarly, if at least one entry on the blog has an author tag, but other entries don't, 'noauthor.html' is created and linked to from the navigation bar.

RSS feeds are now created for every tagpage. That means visitors can now subscribe to individual topics or categories or authors or languages. It also means a longer generation time for a complete regeneration process. But permanent caching reduces that to an acceptable amount. Other feed formats are still not created because I reckon that writing those will be particularly fun and satisfying. So I want to get to that when more of the less interesting todo bullet points are done.

Many small changes make web sites with different structures than mine cleaner. Empty directories or menu entries aren't created. There are new hooks for the various different new functions and loops which a user might want to hook into. Various changes around the default language being used for RSS feeds and HTML documents in order to abide by the standards. Many bugs around all sorts of things have been fixed. The logging option works pretty reliable now. It may still be completely removed one day because it's a large chunk in the code, makes the script slower when enabled and can now be entirely replaced by redirecting output from the script on the shell level. The new flags 'hideinfeeds', 'noshow', 'nogal', 'noatts' and 'noheader' control how and where entries are presented and which parts are visible. See the README for descriptions of those flags.

Reading these update blog posts shouldn't be seen as a replacement for reading the CHANGELOG file. If you have a SBWG web site and consider updating SBWG, at least check the CHANGELOG for lines marked with ! since your current version. That makes it much much less likely that you miss something that you should change upon updating SBWG. I mean, I don't think anybody except me uses any version of SBWG. But I've always approached this project working as if it would be used by others in order to produce something that is practically usable without reading and understanding the codebase first.

The list of things that I'd like to do with SBWG is still long and includes heavy changes on how content is placed in the website's input directory. I reckon that it would take me something like 10 - 16 years to get there is I would continue advancing through the todo list at the pace at which I have in the last year. But if I would loose interest at any point along this path, I could feel okay for at least have gotton as far as testing and publishing version 0.12.8 because it's getting closer to looking how I want it to look in regards to the results it produces.

SBWG 0.11.1

I'm glad to have this version done and published. Even though it has new features compared to the last published version, I've used it enough to feel relatively comfortable saying it is also more stable and has fewer bugs than the last version. There are known bugs still left. But those aren't new.

Caching options and settings are slowly getting a bit elaborate, but also close to what I imagined them being able to do. There are new cachegroups and parts of entries can now be chosed as individual cachegroups, giving the user more control over what is cached and what caches are used. The lifetime of caches can now be set to make sure that no matter how the caching options are used, no outdated content, tags, attachments, etc. will stay on the web site for too long because cache files have been forgotten to be purges. The cache lifetime can be chosen from 1 second to unfinite. The directory used for persistant caches can now be chosen via command line option. I think the caching options are now in a state in which they can seriously be used reliably. Changes to existing cachegroups, like in previous versions, will probably not be made anymore. Just more cachegroups will be added.

The README file has grown a lot. Not only from new features and options. It's now also more complete. A lot of bugs have been fixed. And some general little code quality improvements took place. The stylesheets of the example web site have been improved a bit.

The messaging and logging system has been completely rewritten. It's not really an important part of the script and strictly doesn't matter for its functionality at all. But I decided to have a messaging system and a logging option that doesn't rely on shell redirects. So I did want to redo it properly. Different message types can now be redirected using file descriptors. The option parser has also been party re-written. It's approaching a state in which it's close to what I think personally a complete option parser for Bash should be like.

Alternate styles can now be defined in a web site's settings file. That way alternate style sheets will be offered to the web browser. If the browser supports alternate style sheets, the visitor can select from them to view the page in a different style. There is now an option to change the tagstyle, enabling a web site to have tags of the same type grouped for a more readable look of the entries' headers. Tags now show in parenthesis the number of entries that carry that tag. The number of file attachments is also displayed below entries.

The options for generating a single entry, page or gallery that is not located in the input directory/isn't actually part of the web site can now be used. They were very buggy or nonexistant before. Entries (and other items) with duplicate names are handled in defined ways now. Text files can now be used as file attachments to entries. But if the script determines one to look like a SBWG source file, it is omitted/not displayed/not linked to.

There are still big plans for future versions. Small and big features as well as a complete re-thinking of how the input directory is structured. Nicer looking web sites, more flexible command line options, more options for speeding up the script in cases where a complete website is updated/re-built. A pause like the one before this release will probably occur more often in the future.

Fred - Part 3 - Power Supplies
This entry is a reply to or continuation of the entry 'Fred - Part 2 - The Case Lid And Cooling'.

After getting rid of the fan wall, the power supply was the main source of noise. The original PSU was a 3U redundant (2+1) server power supply. Noise does not matter with machines like that. I wanted to be able to have it running in my living room though, so the noise had to drop a fucking lot. Seriously, that's said so many times for people who don't work with servers like this. But people are still surprised when they hear a server fan for the first time. One of original 60 mm fans in the back is louder than my vaccum cleaner. And there were two of those, four 80 mm fans and five 40 mm fans. Three of the latter in the power supplies. Because I have no means to control the fans in software and don't need all the power the power supply can supply, I tried how much I can lower the noise by adding resistors in series to the fans. That did reduce noise a lot. But not only aren't these fans optimated for quiet operation, they are 40 mm fans. They will nver be quiet enough.

So I looked online for a power supply that

  1. fits in the case (it's not completely an ATX case)
  2. can supply enough current for everything and
  3. is trustworthy/doesn't appear to be too cheaply built

I found a Newton Power Model NPS-300AB B, which doesn't meat points 2 and 3 but fits so perfectly into the case that it was a weird feeling to accept that it is mostly coincidence. I got it for a couple of euros on ebay. Most sellers seem to think it's some piece of premium equipment because it's used in some Fujitsu servers or something. But it's really just a cheap ATX power supply in a non-standard case. But because of that non-standard case fitted so well into my non-standard server case, I got it anyway. I only had to drill the screw holes and that was it. It's hardly enough for 14 HDDs and the internet says it's really cheap and not trustworthy. But I went with it anyway in order to pay tribute to r/thingsfittinginthings.

Not a year later the PSU died. Probably overstressed it for too long. I replaced it with a better SFX unit. I had a nice and thick plate of stainless steel lying around, from which I cut an adapter plate.

I'll attach some photos below. Maybe I'll continue this series of entries on Fred some other day with experiences of dust and heat and such over time.

File Attachments (5 files)
The old power supply after it died_ (The unplugged fan and the missing screws do not resemble how it looked while it was in use_)
The old power supply after it died. (The unplugged fan and the missing screws do not resemble how it looked while it was in use.)
Maybe it would have lived longer if I had cooled it better_ It wasn't efficient_ It would have been too loud_
Maybe it would have lived longer if I had cooled it better. It wasn't efficient. It would have been too loud.
The new power supply_ Fits well in height and leaves more than enough room for its modular cables (even for the ones that aren't used) and airflow_
The new power supply. Fits well in height and leaves more than enough room for its modular cables (even for the ones that aren't used) and airflow.
I'm happy with the adapter plate and how it turned out, even though I originally made it for a different SFX unit and the fan cutout now seems redundant_ But it actually looks kind of professional_ That's rare enough with me_ I bet you can't tell which part I made myself_ (Or is this because the photo is so bad?)
I'm happy with the adapter plate and how it turned out, even though I originally made it for a different SFX unit and the fan cutout now seems redundant. But it actually looks kind of professional. That's rare enough with me. I bet you can't tell which part I made myself. (Or is this because the photo is so bad?)
I made my own modular cables with old molex connectors for the HDD backplane_ The unused cables in the plastic bag has its place at the back of the PSU_
I made my own modular cables with old molex connectors for the HDD backplane. The unused cables in the plastic bag has its place at the back of the PSU.
SBWG 0.10.11

It's been two months since I published a new version of SBWG (and therefore since I worked enough on it to make me feel that an increase in the version number may be justified). I hardly get around to working on it, lately. But when I do, I try to make some solid small steps towards the improvements I wish do be done to SBWG.

So, now there is a new version (0.10.11) but I haven't published it yet because before I do I want to test it a bit more when I'm not as fucking tired as I am right now. Writing this entry could actually be considered part of the testing that I still want to do. But as I said, I'm fucking tired right now. So I'll continue this entry another time.

Edit 2022-09-12: I did some tests with fake content offline and feel confident that I fixed more than I broke in this version. I'll add it to the project page soon.

Two long procrastinate areas that have been overdue to get fixed for a while now are permanent caching and parallelisation. For permanent caching, the bugs that I found are fixed. Aggressive caching with option `--cache` (`-C`) works and certain groups can be selected (excluding others) for permanent caching. In my test this speeds up everyday web site re-generations by up to 100%. But it also means the user has to be aware of the cache files that persist after SBWG is done and will be used the next time. Changes to existing entries will not take effect without removing the relevant cache files. For parallelisation, the bugs that I found and that affect the generated HTML are fixed. I still consider parallel mode to be experimental. Sometimes messages on stdout are weird or cut off. But who uses very verbose mode and looks at every message anyway? Parallelisation is functional and usable is what I mean to say. In my test on a Core i5 with 4 cores (8 threads) it speeds up everyday web site re-generation by around 380% with default settings. It depends a lot on how much of web site generation is generating thumbnails and other image sizes of file attachments or gallery images. Those aren't sped up that much because the CPU already is the bottleneck for those. HTML file generation profits more from having more parallel threads than CPU cores (or threads) running.

Fred - Part 2 - The Case Lid And Cooling
This entry is a reply to or continuation of the entry 'Fred - Part 1 - Modding The Quiet Into A Server Rack Case'.

In this entry I'll describe how Fred's components are air cooled.

So, after removing the fan wall and unplugging the two fans in the back of the case there was no active cooling left. That's good for reducing noise, but not enough cooling for the hard drives, the CPU and the SAS controller cards. Since the case is not mounted in a rack and nothing is placed on top of it, I decided to use the space in the case lid to place larger fans.

The CPU

My idea was to replace the CPU cooler with a larger one that just fits into the case and have a fan above it suck out its hot air (also pulling in ait from the RAM modules next to the CPU socket). I fount a heat sink from Scythe called Iori (SCIOR-1000). Mounted on the socket there would be just enough space for a 15 mm fan above it. As it turns out though, the heat sink is large enough to cool the CPU passively and the RAM doesn't need any additional cooling, too. So the fan above it is not even plugged in.

The Extension Cards

Since the HBA and the RAID card that I'm using are designed for servers with a proper airflow, they need at least some additional cooling. Their heat sinks are quite small for the amount of heat they produce. But there was enough room above them to place a fan that sucks the hot ait directly from the extension card area out of the case. I was told these cards usually don't have any problems getting extremely hot. But I rather don't want to have them do their things for hours or days streight without any active cooling. Replacing their heat sinks with larger ones would only be a sufficiant option if there was room for much much larger heat sinks.

The Hard Drives

I don't want to have have hard drives run continuesly without any active cooling, especially when they are sitting in enclosures that don't allow for any aitflow without some amount of pressure. There is just no-where for the heat to go on its own in these tight drawers. I decided for three 140 mm fans that would neatly in a row behind the hard drive compartment and backplane. Since the motherboard isn't that large, there was nothing but a few cables in that area of the case. I've mounted an aluminium bar that I had lying around and tucked two pieces of flat plastic between this bar and the bar that originally held the fan wall at the bottom. That way, the air that is pressed in from above gets directed only into the hard drive compartment where it has no way to escape without passing the hard drives.

Unfortunately the room around the hard drives is so small that quite a lot of air preassure is needed to cool them as much as I wanted to. Running the fans at full speed all the time is hardly enough to keep them at a temperature that I deem acceptable. I tried to increase the cooling effect by sealing all the edges and other tiny spaces where some air could escape without cooling the hard drives. But this didn't lead to a measurable difference. I ended up taking out two of the 16 hard drives to increase the size of the duct. I chose two drives in the centre so that there now is a large surface where the air cools the remaining drives. That lowered the temperatures of the surrounding drives a lot. The temperature of the drives at the edges was of course hardly effected. But those weren't the problem anyway.

I'll probably continue about the rest of the case mod in a followup entry.

File Attachments (12 files)
Making the holes for the fans was easier than I expected_ I marked the borders with a pencil by following the outlines of the actual fans, cut the rough holes with an angle grinder with a cutting disk, then did the finishing with a rotary tool (a not Dremel)_
Making the holes for the fans was easier than I expected. I marked the borders with a pencil by following the outlines of the actual fans, cut the rough holes with an angle grinder with a cutting disk, then did the finishing with a rotary tool (a not Dremel).
I used up several cheap grinding bits for the finishing_ The remaining borders between the fas are only a few millimeters wide_ But the ~2 mm thick steel holds up surprisingly well_ They don't make regular home computer cases from that material_
I used up several cheap grinding bits for the finishing. The remaining borders between the fas are only a few millimeters wide. But the ~2 mm thick steel holds up surprisingly well. They don't make regular home computer cases from that material.
First coat: primer, second coat: matte black, thirdly added sparkly sprinkles_ In the picture I started taping the sides for what comes next_
First coat: primer, second coat: matte black, thirdly added sparkly sprinkles. In the picture I started taping the sides for what comes next.
Then I painted the middle part pink_ After the tape was removed I noticed the paint came off in one spot_ Well, that's how it goes if you don't do it right_ I can just cover this with a sticker_ For now I just added a matte clearcoat_
Then I painted the middle part pink. After the tape was removed I noticed the paint came off in one spot. Well, that's how it goes if you don't do it right. I can just cover this with a sticker. For now I just added a matte clearcoat.
In between cooling systems_ I tested the modded lid as it was in the picture but closed_ It did do something and it was better than the open case with scattered fans in the next picture, but not by much_
In between cooling systems. I tested the modded lid as it was in the picture but closed. It did do something and it was better than the open case with scattered fans in the next picture, but not by much.
That's how it looked for a day while I used the NAS before finishing the new cooling system_ Notice the large space in the middle_ That will be used in the next pictures_
That's how it looked for a day while I used the NAS before finishing the new cooling system. Notice the large space in the middle. That will be used in the next pictures.
This is how the case looked inside now_ (I'll write about the power supply in the next entry_)
This is how the case looked inside now. (I'll write about the power supply in the next entry.)
And from the outside_ The fan on the bottom right cools the RAID card and the HBA_ I don't know if it's cooling it enough because I don't know what the cards/processors are made to withstand_ But they still ran a few years after that picture was taken_ The CPU fan is off because it stays cool enough during a hours-long burn test_
And from the outside. The fan on the bottom right cools the RAID card and the HBA. I don't know if it's cooling it enough because I don't know what the cards/processors are made to withstand. But they still ran a few years after that picture was taken. The CPU fan is off because it stays cool enough during a hours-long burn test.
The cooler mount wasn't made for that socket_ I think it was for an AMD socket_ The bracket was really strong and tight and eventually broke in two_ The CPU lid didn't take any damage though and I simply used a few zipties to hold the cooler in place without much preasure on the CPU_ That still was enough to cool the CPU passively and the machine ran three quarters of a year that way_
The cooler mount wasn't made for that socket. I think it was for an AMD socket. The bracket was really strong and tight and eventually broke in two. The CPU lid didn't take any damage though and I simply used a few zipties to hold the cooler in place without much preasure on the CPU. That still was enough to cool the CPU passively and the machine ran three quarters of a year that way.
Eventually I made my own bracket (not in the picture) and now that is held down by zipties_ It's quite sturdy_
Eventually I made my own bracket (not in the picture) and now that is held down by zipties. It's quite sturdy.