Sunday, November 16, 2014

disable ssh root login

Install the ssh server and client.
ROOTPROMPT$ apt-get install openssh_client openssh_server
Then open the /etc/ssh/sshd_config file
ROOTPROMPT$ emacs /etc/ssh/sshd_config

and change the"PermitRootLogin" option to 'no'
...#SKIP to relevant section
# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes yes


More details at the ssh man page.

Replace Cracked Dash Cam Lens

   I bought a top dawg electronics dash cam but within a week of use I broke the camera lens.  This was my fault (my kid knocked it off my desk one evening), but unfortunately they don't repair these units.  They did offer to sell me a refurb for approximately half retail price.  However, after some research on dashcamtalk I decided to try to repair it myself.  The dashcamtalk thread is on a different unit, but pointed me in the right direction for a lens replacement.  I selected this 2.8mm 115 Degree Wide Angle lens after some research on aliexpress.  This lens is longer than the original and extends past the camera body when the image is in focus, so my research was not perfect, but it works and I purchased it for $5USD shipped.  When selecting a lens make sure the it is infrared capable if your camera has infrared (night vision) recording.  Follow these instructions at your own risk because you can easily destroy the camera.
    Detach the suction cup arm and remove the battery cover and battery.  Screws are accesable on battery side.  Remove the two screws near the camera lens end and the two beneath the batter cover.  Figure 1 shows the battery side of the case propped open.  Be careful not to break the red and black wires that attach the speaker to the board.  The four small red circles show the screws that attach the circuit board to the case.  Remove these.  The large red circle on the right of the image highlights the circuit board subassembly that has the CCD (imaging chip) and the lens.  This board is mounted perpendicular to the main board by a right angle header pin.  This image was taken during reassembly and doesn't show the large amount of hot glue used to help hold them together.  Carefully remove the hot glue with a razor and tweezers until you can unplug the CCD board as shown in Figure 2 and 3.
 
Figure 1: Open case and unscrew the circuit board
Figure 2: Bottom of ciruit board showing CCD connection
Figure 3: CCD subassembly detached

The lens was super glued to the CCD mount, but only a couple threads.  Use a razor and/or tweezers to remove all visible super glue between the lens and mount.  Then you have to apply some torque to break it free, but be careful not to break the mount.  Figure 4 shows the lens separated from the CCD.

Replace the lens and attach the CCD to the main circuit board, then replace the screws to hold the circuit board in place (Figure 1).  Don't screw the case together yet because you need to power up the unit and adjust the lens to achieve a focused image.  I just held the case together and inserted the battery to do this.  Once I found the focus I backed the lens out 1.5 turns, applied a couple drops of super glue to the threads, then screwed the lens back in 1.5 turns.  Then - rapidly before the glue dries - install the battery and power up to make the final fine adjustments.
   As stated this worked, but the new lens protrudes from the camera case as shown in Figure 1.  This is only a cosmetic issue, and I'm not sure how to spec a part to correct this since I'm not a camera hobbyist (as evidenced by my blurry pictures).  However, for $5USD I'm happy with the results.