Soemarko Ridwan

iOS & Web Developer ⟡ Coffee Addict ⟡ Scuba Diver

Buy Me a Coffee at ko-fi.com

Bludit’s Automated Regular Backup

So I just had a real scare, this blog suddenly just show this error on screen: Theme 'quark' does not exist, unable to display page. I was like, wtf?! And ready to scream in Bludit’s support chat room. But luckily before I did that, I looked for the backup I made when I updated bludit, then I saw it. The file structures all fucked up, seems like the shared hosting company did some kind of roll back and merged this /blog/ folder with old files, htmly files to be specific. And among other things, the index.php file was overwritten too.

I’m glad that the files under ./bl-content are intact, so I can create a clean backup from there. Nuke the whole thing, and start a new bludit instance, and restore the content. As usual, I need to learn things the hard way. Now I need to look into automated regular backup, from the situation mentioned above, you’d already know how simple it is to back-up a Bludit’s site. Just create a script to zip-up a directory, and throw that script into crontab. And here’s the script:

Read more…


Updating Bludit
Updating Bludit

I’m sure this also applies to any other flat file CMSs. Before doing anything, make sure of a few things below:

  1. Backup. Bludit backup plugin exists, but it currently has a weird bug where you need to download the file via ftp instead of from the plugin page. But I prefer just zip up the whole thing and create a snapshot outside of the installation.
  2. Do not touch the core. Anything under bl-kernel in Bludit’s case. If you need to touch the core, consider using other CMS or framework instead. If you touched the core, you literally maintain another fork of the CMS.
  3. Duplicate and renamed modified plugins. Plugins are okay to touch, just make another copy, rename, change the metadata a bit, and do whatever changes you need. This way, the changes will not get restored to the original state when files are being overwritten. For example, I duplicated the Search plugin, because I want to remove the submit button and user just need to hit return to execute the search. I just duplicate everything and call it “Search Clean.

Now with everything above is done, all you need to do is exactly like the cover image:

  1. Merge all folders
  2. Overwrite all files
  3. done.

ez pz


Wat?!

This talk is from 2012, but I just came across it. It is hilarious and too good to not share.

source


Dark Mode + CSS
Dark Mode + CSS

MacOS Mojave comes with the OS wide “dark mode” which sounds pretty awesome, I’m still on High Sierra. But I’m gonna update it soon, it’s already downloaded itself onto this Mac, and I want my disc space back.

That said, even with dark mode on, you’re going to be blinded with with a suddenly bright websites. For that, Safari is going to have a special media query for color scheme. First, you need to [download Safari Release 68] and making sure that Dark Mode CSS Support is turned on in the Develop > Experimental Features menu, and then you can add the following into your CSS:

div {
  background-color: pink;
}

@media (prefers-color-scheme: light) {
  div {
    background-color: yellow;
  }
}

@media (prefers-color-scheme: dark) {
  div {
    background-color: purple;
  }
}

Dark mode CSS

How simple is that?! I’m just touching the surface for the overall implementation, if you want to do this right, please read further into it.


DIY O₂ Analyzer: Part 2 — Make your own oxygen analyzer
DIY O₂ Analyzer: Part 2 — Make your own oxygen analyzer

In part 1, I’ve explained that all the we really need is a millivoltmeter, but ideally, we’d like to see the oxygen percentage on some kind of display.

There are two way to achieve this. First is by using Ohm’s Law, amplify the voltage (so we have more resolution), add a voltage divider, with a potentiometer as one of the resistor, that’ll be the calibration tool. Expose the sensor to air, turn the knob until the number shows 20.9. This what the El Cheapo from OxyCheq really is.

The second way is by using a micro controller, Arduino if you will. Which is the approach I took, mostly because I have a lot of spare µC. And my main goal after learning that I can DIY the analyzer is to suppress as much cost as possible, just to see how cheap I can go. The comparison is this Analox O2EII Pro Nitrox Analyzer , sold by Master Selam for about US$400, while Leisure Pro has it for $266. The prices for scuba gears is so ridiculous here in Indonesia.

Read more…



DIY O₂ Analyzer: Part 1 — Understanding Oxygen Sensor
DIY O₂ Analyzer: Part 1 — Understanding Oxygen Sensor

DIY-ing O₂ analyzer is one of the simplest project you can do, for those of you who’s electronically literate will understand this after taking a look at a sensor’s data sheet. While when we mentioned this to other divers, they’ll say, “you’re making your own analyzer? You’ll die.”

So, I’ll split this into 2 parts. First is this post, I’ll basically just explaining data sheet and how the sensor operates. And I’ll go into the actual build, BOM, source code, etc. in part two. I’ll use my own sensor as an example, it is the cheapest one that checks all the boxes for it to be scuba oxygen analyzer. Let me know if you found anything cheaper 😜

O₂ sensor tech specs

Pictured above is the technical specs from the sensor data sheet. From the data sheet we know that if you expose the sensor to gas, it’ll spit out mV out of the other end. With the only caveat it being in the most ideal conditions, hence the calibration button. As mentioned in there, the numbers will drift over time, and humidity will affect the numbers too.

DMM output

Let’s use the pic above as example, We know “air” is 20.9% oxygen, so 9mV = 20.9% we use this as the baseline, the calibration value if you will. From that, if we were to expose the sensor to EAN32, it’ll spit out 13.8 mV. 13.8 / 9 * 20.9 = 32.05

That’s it! All you really need is a millivoltmeter really, and you can math it out. But ideally, you’d want a screen that display the actual oxygen percentage to simplify a lot of things. As mentioned, I’ll get into the how to in part 2.


On writing in 2018
On writing in 2018

… or lack there of 😝 As promised let’s get into the reasons why there were significant lack of writing this year. I probably has mentioned this before, but for me, writing organizes my thoughts into something more coherent so that I can progress and plan further into a topic or a certain subject.

Read more…