vi paste contents of another file in current file
June 18th, 2019While editing a file in vi, in order to paste the contents of another file at the current location type:
:r filename_to_paste
Perl file open details
June 18th, 2019There are several ways to open files in Perl and it seems that there are many opinions on the best way to do so. I've looked into it a bit and I believe that I'm going to use the three-argument version of open going forward.
open (my $filename_fh, '<', $filename);
As stated in the linked page, benefits include:
- Perl will open files even if they contain file operation (< > |) characters
- The scalar file handle ends in _fh so it should be obvious it is a file handle everywhere
- The file handle should be meaningful
- The file handle will be cleaned up automatically if it goes out of scope
Accessing Plex media from Sonos
June 18th, 2019Since I got my first Sonos device, I wanted to be able to play music from my Plex server. Unfortunately, due to the way Sonos issues the network requests, it didn't work properly. I use pfSense for my router and tried a number of workarounds but the one that finally worked was this one:
In the pfSense Plex NAT firewall rule (pfSense->Firewall->NAT->Port Forward->Edit) change the NAT reflection setting to "Enable (NAT + Proxy).
Home Depot DIY Garage Shelves
April 3rd, 2019DIY Garage Shelves
-
TIME REQUIRED: 2-4 hours
-
DIFFICULTY: Beginner
While ready-made storage shelves are convenient, turn your desire for additional storage space into a DIY project and build a custom shelving unit to fit the exact space you have available. These DIY garage shelves offer spacing flexibility and are easy to reconfigure if you decide to reorganize the space. Additionally, you can dress them up by installing side panels and stock trim molding on the face of the frame. This project guide explains how to build garage shelves and anchor them to the wall and floor for extra support.
Tip: Take your custom garage shelving plans a step further by anchoring it to the ceiling joists and the floor. This will make it sturdier under a heavy load than other garage wall shelving.
TOOLS












Jump to Specific Step
Before you begin, gather the following tools and materials:
- One plate should be flush against the wall and the other should be parallel to it with its front edge 24 inches from the wall.
- Cut the 2- x 4-inch top plates to the full length of the shelves, then attach to the ceiling joists using 3-inch screws.
- Measure and cut the sole plates to their desired lengths and align on top of the lines you just drew.
- Drill the sole plates into the ground for additional support.
Tip: Learn how to drill into concrete with this handy guide.
- Prepare the shelf risers by cutting 7/8-inch wide dado grooves with a router. Cut dadoes every 4 inches along the inside face of each 2- x 4-inch riser with the top and bottom dadoes about 12 inches from the ends.
- Gang-cut the risers by laying them flat, clamping them together and attaching a straightedge guide to align your dado cuts.
- For each cut, make several passes with the router, gradually extending the bit depth until the dadoes are ¾-inch deep.
- Build two center supports by positioning pairs of shelf risers back-to-back.
- Joining them with wood glue and 2 ½-inch screws.
- Build four end shelf supports by positioning the back of the dadoes shelf riser against a 2 -x 4-inch board of the same length.
- Join them with glue and 2 ½-inch screws.
- Position a center shelf support, one with both faces dadoed, at each end of the center sole plate, then anchor the shelf supports to the sole plate using 3-inch screws driven at an angle.
- Use a framing square to align the center shelf supports perpendicular to the top plates. Then, screw them to the top plates.
Spam and Virus test strings
August 31st, 2018When working with mail servers, it is handy to be able to check to ensure your configuration is working as expected. To that end, here are some test strings that you can use to check it out:
SPAM: XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
VIRUS: X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*










