Sunday, December 31, 2017

Power Supply Build

Finished a project that I'd been working on for too long. A power supply. I built the kit at one point and liked it so I wanted to put it in a professional looking case. It needed a cooling fan though as well. I think I got the kit from Bangood as well as the kit, and I think the case. By itself the kit isn't bad. two rotary encoders set the voltage and current clamps, the LCD screen gives you pretty good feedback. but the problem is that the power transistor doesn't have a thermal sink with the kit. There is a second kit available that does this. So I picked that up. works great except.. if I put the fan on top of the thermal sink, it was too tall for the case I picked out. Additionally, the kit didn't come with a transformer. That was an easy fix though. Essentially, I wired the encoders to the control board. so the control board is behind the LCD screen. then the outputs are just right next to it. I've some knobs on the way, aluminum. But I think they will take awhile. So I decided to just post this now before I forget. I'm pretty proud of how it turned out. Simple, functional, and fun.

Monday, December 25, 2017

Updates and backups and logs oh my!

I run Linux on my laptop. So when my daughter said she needed a laptop, I pieced one together, dropped Linux on it and handed it over. She took it home... and let me make this clear... she took it home. How to do upgrades? She isn't a technophobe, just lazy. So I thought, what if I wrote a script, that configures her laptop to handle updates, backups, then emails me when it's done.

That sounds ambitious. So lets find the best way to do all of this together.

so for backups I use

tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /


this puts a backup tar in the / folder (we have to start there too)

so we can say

#!/bin/bash
# let's talk to the lUser and let them know it's gonna take awhile
echo HI, I just need to do some configuration stuff, Please wait until I'm done
echo This will take a bit probably


:wq out of that and then change the permissions
chmod u+x updatescript

that allows it to be runnable.

I'm adding an option to shutdown when I'm done. something like

shutdown=true

if you use shutdown = true, it will try to run the command shutdown. That's not what we want, we want a bool shutdown that is initialized to true. Conversely, (and we may use this later) delete a variable with unset so unset shutdown, deletes the variable shutdown. We don't want that so we are just going to shut down by default, but ask if she wants us to leave it on.

echo would you like to shutdown on completion?

Windows NEEDS a reboot usually, Linux not so much. Thats just so that she has the option to come back to what she was doing the night before, or see that it's shut down and know it's done. so now we need to read in her answer. so I'm going to let her type in her answer and read it in and check it. so

read shutdown #important to note that c based programmers will pull their hair out with lack of ;

now you can
echo $shutdown

at this point you can read in anything to shutdown. If you type Floppychoppydingdang that's what that will save in the variable

So the NEXT thing that needs to be done, is to parse the input and decide if she wants it shutdown or not... or if one of her kids is banging on the keyboard again.
That sounds like another day.