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*
Server migration Ubuntu 12.04 -> Centos 7
August 30th, 2018I'm in the process of migrating from Ubuntu 12.04 to Centos 7. I'm going to document links and as much as I can of the process here.
I've been running this server for over 12 years at this point. It's been through multiple upgrades and the last was quite some time ago. Ubuntu 18 is out at this point so the existing software base is quite dated.
Mysql has been replaced by MariaDB which is a free fork. Again, not too big a deal but there are some hurdles like a change to the password encryption. The mysql client connects fine but php applications can't connect until the password has been re-encrypted.
Export/Import Links
Export and Import all MySQL databases at one time
Miscellaneous Links
MySQL error 2006: mysql server has gone away
mysql sql command to change a user password
Changing MariaDB passwords
Changing the Time Zone in MySQL
Postgres information
Postgres is failing with 'could not open relation mapping file “global/pg_filenode.map”'
Apache is changing from version 2.2 to version 2.4. Overall this is not too big a deal, but they did make a significant change to the Authorization syntax
How To Migrate your Apache Configuration from 2.2 to 2.4 Syntax
script to migrate apache 2.2 to 2.4 configuration files
2.2 configuration:
Order deny,allow
Deny from all
2.4 configuration:
Require all denied
2.2 configuration:
Order allow,deny
Allow from all
2.4 configuration:
Require all granted
Access Control
SSL Certificates with Apache on CentOS 7
Mail configuration and migration has been one of the most difficult parts. The old server used postfix, procmail and cyrus. I'm going with postfix, sieve and dovecot for the new server. Dovecot appears to be a more standardized IMAP server. I had nothing but trouble trying to get postfix set up so looked into sieve. Sieve will allow for user side rule management and the server side seems to be much simpler syntax.
Postfix
Postfix error: private/smtp No such file or directory
Postfix TLS Support
Postfix status=deferred (mail transport unavailable)
connect #n to subsystem private/proxymap: Connection refused
Mail filtering with procmail in a postfix/dovecot system with virtual users
Postfix and TLS encryption
Postfix unable to receive mail
antispam techniques in postfix on linux
Dovecot
Dovecot installation and configuration on CentOS
Dovecot Mail Location
Dovecot Virtual Users
Dovecot Virtual Users / Home
Migrating from any IMAP/POP3 server to Dovecot via dsync
Migration to Dovecot
Roundcube Mail - Finally!!!
Custom Roundcube Install Centos 7
How to install Roundcube
Install latest version of Roundcube (Webmail) on CentOS 7
Roundcube configuration options
Sieve
sieve filter not working
Sieve Syntax and Common Recipes
Pigeonhole Sieve Configuration
Amavis / ClamAV / SpamAssassin
Fighting Spam/Viruses with Amavisd-New, Maia and Postfix
amavis + SA not marking messages as spam
PostfixAmavisNew
amavisd-new
Integrating SpamAssassin with Postfix
Configure Postfix to use Spamassassin as a filter
SpamAssassin with dovecot-antispam training
Can't receive mail with dovecot + postfix setup
What to do with SpamAssassin after installing Amavis?
Postfix + Clamav + Amavisd
Amavisd-new, ClamAV and SpamAssassin
Amavis / spamassassin setup, how to disable quarantine and get default spamassassin behavior back?
Mail Filtering
Handling Spam with Postfix, SpamAssassin, Dovecot and Sieve.
How to move spam to spam folder?
MailMan - links to get MailMan working
Migrating mailman lists
cgi in URLs
HOW-TO: Fix MailMan URL after a transfer or change of hostname
[Mailman-Users] URL incorrect in web interface
Integrating Postfix and Mailman
Postfix alias database maintenance - man 1 postalias
Mailman - Postfix integration with Mailman generated transport or other maps
[Mailman-Users] postfix to mailman: User doesn't exist/relay access denied
postfix to mailman: User doesn't exist/relay access denied
How do I change the name of (rename) a list?
[Mailman-Users] Mail transport postfix with dovecot and virtual domains
Postfix Configuration Parameters
Cyrus to Dovecot Migration
Migration to Dovecot
Migration / Cyrus
Migration from any IMAP/POP3 Server to Dovecot via dsync
Doveadm-Sync
Simple Mailserver With Postfix, Dovecot, And Sieve On CentOS 7
Configuring pigeonhole/sieve
Postfix and Dovecot LMTP
Dovecot LMTP Server
Dovecot LDA
Postfix → Dovecot LMTP: User does not exist: uid@domain
Migrating from any IMAP/POP3 server to Dovecot
Dovecot replictor/dsync over tcp
Problem migration from cyrus with imapc
dsync: INBOX Can't be deleted
Miscellaneous Mail Links
How to Test the Sendmail Command On Linux
Setup mail server with Postfix, Dovecot, Roundcube
How To Run Your Own Mail Server
Tackle spam with SpamAssassin on CentOS 7 & Postfix
How to Setup an Email Server on CentOS 7
How to FORCE secure authentication (over SSL or TLS) with Postfix
PXE Server
Setting up a ‘PXE Network Boot Server’ for Multiple Linux Distribution Installations in RHEL/CentOS 7
Etherboot Download
iPXE
How to build ipxelinux.0
Bootstrapping full iPXE native menu
A Complete Guide For Installing TFTP Server In CentOS 7
Clients fail to PXE boot using in.tftpd
OpenVPN
How To Set Up and Configure an OpenVPN Server on CentOS 7
How to install OpenVPN Server and Client on CentOS 7
Installing OpenVPN on CentOS 7
OpenVPN : Configure VPN Server
Using OpenVPN with systemd
Centos 7 - Miscellaneous
How to fix the warning: “RPMDB altered outside of yum”?
How to install Pydio (formerly AjaXplorer) on CentOS 7.0
Creating a virtual Network Interface in CentOS 6
How to add virtual IP to network interface in CentOS?
How To Fix ‘lsb_release’ Command Not Found In CentOS?
Samba Add a User
How to Install Webmin on CentOS 7
How To Install and Use Webmin on CentOS 7
Enable or Disable SELinux
How to Add New Disks Using LVM to an Existing Linux System
How can I fix “uuid/uuid.h - No such file” error in CentOS
x86_64 Linux Error: gnu/stub-32.h Missing Error and Solution
fatal error: lzma.h: No such file or directory
‘Ifconfig’ Command Not Found In CentOS 7
How to shrink a XFS filesystem?
Install and Configure VNC Server in CentOS 7 and RHEL 7
How To Install and Configure VNC Remote Access for the GNOME Desktop on CentOS 7
Install Plex Media Server on CentOS 7
Let’s Encrypt wildcard certificates, acme.sh and automated DNS verification
How to Set or Change Hostname in CentOS 7
Overview of systemd for RHEL 7
How to Set Up Apache Web Server on CentOS 7
How to configure a static IP address on CentOS 7 / RHEL 7
How can I add additional search domains to the resolv.conf created by dhclient in CentOS
Network configuration using a text user interface (NMTUI)
How To Install Nginx on CentOS 7










