Tuesday, July 5, 2016

I Am A Junkie - A Tool Junkie

Hello. My name is Silverhawk. I haven't been sober (tool-wise) for some time. Someone had posted about old tools on a local classifieds website, and so I jumped at the chance. I offered $220, and ended up with a small lathe (yes, it is tiny, but it's a cute little thing), an old Montgomery Ward scroll saw, a pedestal grinder (without the pedestal), a small table saw, a drill, a couple of pulleys, a small hand drill, and five or six motors. I have yet to determine if the motors actually work.  If they do, I came out ahead. If they don't.... well, we shall see.

The table saw is labeled "Sears  Roebuck and CO.", model number 103.0211.  It's a nifty, belt-driven little device that was made fairly solidly.  The bearings run pretty good, and they were kind enough to throw in a nice blade along with it.






The scroll saw is labeled with "14FD8398".  It is frozen, but it can be freed up with some acetone/AFT :



Also included was a nice little "drill" attachment that could easily be made into a grinding attachment for the lathe :


As well, a grinder was also thrown in :



The bearings all seem to operate.  Everything in the lot uses belt drive, but the small lathe's pulley is small enough, I don't know if we'd ever find a belt that will fit it.  I think I might donate that to my nephew and his desire to make pens.

The small lathe is a King-Seeley, and doesn't allow for much in the way of tapers.  Here's the lathe next to it's big brother from about the same year (yes, both are from 1941) :



And the small lathe itself :





That really is a cute little thing!  Here's the rest of it :


Saturday, July 2, 2016

Transparent Proxy with CentOS 7, Squid, and Firewalld

Squid is fairly easy to set up.  The firewall took me a little longer, however, in CentOS 7 (IPTABLES isn't the default firewall any more, and instead, a new player is in the ring, firewalld).  This nice little tool can be much more user friendly, if you know what you are doing.  I started out here intending to place Squid (a proxy server) in between my internal network and the outside world for two reasons :
  • I wanted to prevent requests to pages or sites that were not kid-friendly
  • I wanted to cache some of the most heavily used images and sites to speed up requests and page loads
It did take me a bit to figure it out, but I managed.

The first step is to ensure the interfaces fall into the right zones.  Trust me on this, it's pretty important.  I found (before I did this) that often on boot up, DNS would fail to operate until I stopped and started the firewalld service after the initial boot.  Open up each of the /etc/sysconfig/network-scripts/if-cfg* interface files (safe to skip the lo* interface, obviously), and add a single line to them :
    ZONE=external
    
Options here are "work", "trusted", "internal", and "public".  Pick the right interfaces - this is vital.

Once you have that in place, enable IP forwarding :
    echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
    
The third step was enabling masquerading for my internal house guests, and to allow established connections.  This was done using :
    firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -o enp1s0 -j MASQUERADE
    firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i enp1s0 -o enp2s0 -m state --state RELATED,ESTABLISHED -j ACCEPT
    
Once that is working I wanted to punch a couple of holes through the firewall :
    firewall-cmd --zone=external --add-service=http --permanent
    firewall-cmd --zone=external --add-service=https --permanent
    firewall-cmd --zone=external --add-rich-rule="rule family=\"ipv4\" source address=\"123.45.67.89\" port protocol=\"tcp\" port=\"22\" accept"
    
Note that mine shows that I am only accepting SSH connections from a specific IP address - this is to prevent those jackass hackers from trying to brute force there way in through SSH.  If you need, it could have been a simple "--add-service=ssh" instead.

And lastly, you HAVE to make sure to intercept HTTP connections from the inside of the network, heading to the outside of the network.  I didn't want Squid responding to internal-to-internal connections, possibly getting in the way of some of the video feeds going across the network.
    firewall-cmd --zone=trusted --permanent --add-rich-rule=rule family="ipv4" source address="192.168.0.0/16" destination address="192.168.0.0/16" invert="True" forward-port port="80" to-port="3128" to-addr="192.168.8.1" protocol="tcp"
    
The above rule will fire off IF a request comes from an internal IP address (192.168.8.123), that is heading to Google.com for port 80 (HTTP).  It reroutes that to the local port 3128 (which is where squid is listening), and Squid handles the request from there on out (allowing the cache or block).  However, since we added the "destination address" with a following "invert", we are going to ignore anything that is NOT going to the outside world.

Squid

It's fairly easy - just install squid (yum install squid), open the "/etc/squid/squid.conf" file, and locate the line that reads "http_port 3128" .  Add a space followed by "intercept", e.g. "http_port 3128 intercept", and Squid will now act as a transparent proxy.

Since I also wanted to block some sites, I threw in a list of server names into a file called "/etc/squid/bad-sites.acl", e.g. :
    .redtube.com
    .youporn.com
    .playboy.com
    
and in the squid.conf file, I added the following at the top :
    acl bad_sites dstdomain "/etc/squid/bad-sites.acl"
    
Then, I located a line that began with "INSERT YOUR OWN RULE(S) HERE", and added :
    http_access deny bad_sites
    
After the comment block for that.  Restart it, and it will be blocking the sites listed in the bad-sites.acl!  Congratulations on setting up a transparent proxy!

Tuesday, June 21, 2016

Engine Compartment Nearly Complete

Well, I'll be a monkey's uncle!  This past weekend, we had the great fortune of having the nephew over at the house for a few days.  With his help, we completed the gas lines, got the vacuum lines arranged and installed, and even began the last of the electrical in the engine compartment.

There was one issue.  I could NOT get the plug out on the drivers side of the car for a temperature sensor (the small block head water jacket plug was stripping and not releasing).  So, part of the electrical included moving the temperature sensor to the passengers side.  It took a half of a can of PB Blaster, a ratcheting wrench with a cheater bar (5 feet of pipe on the end of the ratchet - I was more worried about the head, because I can always pick up a new ratchet).  It took soaking in PB Blaster for 3 days, and I still had to advance from the 1 1/2 foot bar to the 5 foot bar to get it to turn.  When it came out, it looked like this (yes, so much torque on that it was cockeyed) :



And, then we did some more electrical :



And while we were at it, the nephew (and the niece) worked on the lathe making a pen (those two are awesome - I claim them as my own) :




And lubed the whole thing, front-to-back :




We're getting close!

Monday, June 20, 2016

A New Set of Tools

Well, I lost out on a set of change gears for the lathe.  So, to soothe my troubled mind, I found some used tools and purchased them.  I ended up with a Guardian FDM 58-12S (12 speed, floor model, drill press), and a Harbor Freight small metal bandsaw.  First, the drill press :



The bandsaw is a little (that is good in my case, as I don't have that much shop space), 4.5" capacity horizontal/vertical, metal-cutting bandsaw from Harbor Freight, model 37151.  A small saw, this is a good addition to the shop!




That should allow me to really start making some parts!

Sunday, June 19, 2016

PC Engines' APU 2C4 - Installing CentOS 7 to the SD Card from the Mac

I purchased a little device from PC Engines called the APU 2C4.  It's a small, "embedded" system running an AMD GX-412TC (1 Ghz Jaguar quad core, 4Gb of RAM, 3 Gigabit ethernet ports).  It has no graphics card, and ONLY works with a serial console.

That means you have to use a null modem cable.  Make SURE it's a null modem cable, not a null modem cable with a null modem adapter.  I fought with that thinking it was a problem with the board for WEEKS, until I checked what I thought was a standard DB9 cable and found out it was a null modem cable.  That check came AFTER I ordered another one thinking I had a bad one.  But when the second one did the same thing - I knew something was wrong with the way I was doing it, and that's why I checked my cable.

Here is my installation :
  1. Download the PC Engines Tinycore Linux .bz file.
  2. Create a partition and mark it active in disk :

      fdisk /dev/sdg

    The type will be "e" when you change the type.
  3. Format a flash drive with fat 16 :

      mkfs.msdos -F 16 /dev/sdg1

    This will wipe out anything, and create the file system.
  4. Install syslinux :

      syslinux /dev/sdg1

    This will place the right configs into position.  If the USB disk does not boot, you may need to run a "dd bs=440 if=/usr/share/grub2/mbr.img of=/dev/sdg" to reset the master boot record.  Check the mbr filename - that came from memory that is days old.
  5. Download the Firmware update (the default firmware does not support booting from the SD card).
  6. Add the firmware to the boot disk for the tinycorelinux from PC Engines.
  7. Connect the console/serial null modem cable.
  8. Connect the USB tiny core flash drive to the device
  9. Power on the APU.
  10. At the prompt, change directories into /media/usbhd-sda1 .
  11. Update the flash :

      root@box:/media/usbhd-sda1# flashrom -w apu2_160311.rom -p internal
      flashrom v0.9.8-r1888 on Linux 3.16.6-tinycore (i686)
      flashrom is free software, get the source code at http://www.flashrom.org
      
      Calibrating delay loop... OK.
      coreboot table found at 0xdffae000.
      Found chipset "AMD FCH".
      Enabling flash write... OK.
      Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) mapped at physical address 0xff800000.
      Reading old flash chip contents... done.
      Erasing and writing flash chip... Erase/write done.
      Verifying flash... VERIFIED.
      root@box:/media/usbhd-sda1#

    This will allow you to boot from the internal SD card.  Now we can proceed to install CentOS.
  12. Download the ISO for CentOS 7, 64 bit.
  13. Create a USB boot disk for CentOS 7 64 Bit.  Make sure you have your USB device properly identified, as if you point it to the wrong device, you can easily destroy your system!

      dd if=CentOS-7-x86_64-bin-DVD1.iso of=/dev/sdg

    Again, make absolute sure you point that of= parameter to the correct device!
  14. Assemble the board, SD card, and case combination.
  15. Plug in the USB disk.
  16. Connect the null modem cable between your serial port (or functional USB serial port adapter).
  17. Start "screen" using the correct device, mine is a USB serial adapter device :

      screen /dev/tty.usbserial-A5001As7 115200 8N1

    That should immediately allow for the 11520 8n1 communication used by default.
  18. Power on the device.
  19. Boot the device to the USB stick.
  20. On the boot menu, highlight the option for installing CentOS, and then press the TAB key.
  21. Append to that line the following text :

      text console=ttyS0,115200n8 quiet

    This should give you the non-graphical, serial based installation options you need.
  22. Install CentOS the way you want to.
  23. Wait for the installation to complete.
  24. Change to the tiny core USB device and power cycle the device.
  25. Update the device firmware.
  26. Reboot (power cycle) the device.
  27. At the boot menu for the OS, select the "Troubleshooting", then the "rescue" option, and hit tab.
  28. Again, add :

      text console=ttyS0,115200n8 quiet

     Hit enter and allow it to boot.  You will be told your system is mounted under "/mnt/sysimage".
  29. Highlight the "Ok" button, and press enter.  You should have a root command prompt.
  30. Enter a chromed environment :

      chroot /mnt/sysimage

    This will put you at a root prompt in "/", which should be your systems root directory.
  31. Back up the initramfs :

      cp -p /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak

    I know, we don't need one that is missing the requisite modules for boot, but it's always better to be in the habit of backing things up.
  32. Add the sdhci components to the initramfs :

      dracut -f --add-drivers "mmc_core mmc_block sdhci sdhci-pci"

    This will rewrite your initramfs.
  33. Reboot (may need to exit a couple of times to trigger this).
  34. Allow the system to fully boot.
  35. Once the system has booted, edit "/etc/dracut.conf".  Ensure:

      add_drivers+=" mmc_core mmc_block sdhci sdhci-pci "

    This should force future updates to install the kernel modules to the initramfs that you need.
Now, you should be able to do what you want with it!

Monday, May 30, 2016

South Bend Junior Lathe Lives - Almost

Well, here we go.  It's been a while since I've posted, and I just HAD to post, since I've finally made some progress on my Jan 1930 SB Junior 9".  I bought it back in November, and it's the first foray into machining for me (after I rebuilt a 1939-1941 Craftsman Dunlap wood lathe, it was the next logical step).  I've refinished everything, cleaned up all of the surfaces, repaired the back gears using a hodgepodge of parts (try finding a decent back gear for a Junior 22YB - everything was either too big or not big enough) from a 13" and reusing the eccentric shaft.  But, it went back together.  I re-shimmed the headstock to make sure it was tight, and built a jackshaft to go between the treadmill motor from a C2000 NordicTrac, driven by a BC141.





The first time I tried to fire it up - it wouldn't turn.  I greased the zirks on the shaft pillow blocks, and tried it again.  I adjusted, thinking the belt was too tight.  Both of those helped, and the speed was nearly controllable, except when it engaged the headstock.  It barely turns the headstock.  I think I got the shims wrong on the headstock, and it's too tight.  We'll re-shim it again, and give it one more go in the near future, but I feel really close!

Wednesday, May 25, 2016

South Bend Lathe Motor - Finally Progress

So, I've had the South Bend Junior 9" lathe since late November.  As I've worked on getting an old lathe up and running, I've had some great experiences, from the "Eureka!" moments with calculating gear ratios for thread pitches, to finding some pretty great parts along the way.  However, the thing has yet to be put back into use.  One of the big hold-ups has been the lack of a good motor.

Don't get me wrong, I've had a good motor.  Just no way to control it.  I've had a Quadra Performance Drive 2.6 HP Peak (1.5 HP Continuous Duty) M-204432 (C3354B3352 or E62788) motor from a NordicTrack C2000 treadmill.  I also had the MC-2100 controller.  However, my pinouts must have been different from the others out there, because I could not get it to work based off of a potentiometer for speed control.

I finally gave up on all of that, and found a BC141 controller on eBay.  I ordered, it arrived today, and I've already connected everything up, and fired up the motor.  It works!  It actually works great!



My next step is to put a hinge on the jack shaft, fabricate a mount for the motor so that it can then attach to the jack shaft, and then install it.