Quick Tips: Mail Templates for the Mac Mail app

A common problem is sending form letter mails  to a small number of recipients individually. Mail merge is over kill. It would have been nice to select an email pre-filled with the content, subject and other parameters where you just fill in the “To” field and send.

Well it turns out that the Mac Mail app has just this feature but to use it needs the template message to be saved in any folder other than the default Draft.

The short version is to draft a message and save it. Then move it from the Drafts to another folder e.g. Templates. Now right-click this message in the Templates folder and select “Send Again”. That’s it.

Steps:

  1. Mail > Mailbox > Click the (+)  sign next to the mailbox name > Create a “Templates” folder
  2. Draft a new message and save > Go to Drafts folder > Move this message to the “Templates” folder
  3. Go to the “Templates” folder > Right-click message > Click “Send Again”

Apple Support Link

The "Send Again" option is available on messages in any folder except for the "Drafts".

Python/Django app on CentOS 7 Apache server using mod_wsgi

Python/Django apps can be hosted on Linux Apache web server using the mod_wsgi module. However, the mod_wsgi module has to be compiled with  same version as the one in the virtual environment.

OS: CentOS 7.3

Python: 3.6.2

Get source code

Apache source

$ yum install httpd-deve

Download Python-3.6.2 Gzipped source tarball

Download mod_wsgi Source code (tar.gz)

 

Compile Python and mod_wsgi

Compile Python with the –enable-shared option

cd Puthon-3.6.*-source
./configure --enable-shared
make
make altinstall

 

Post compile add library path /usr/local/lib to ldconfig and check with

# ldconfig –v | grep python

 

now compile mod_wsgi

./configure --with-python=/usr/local/bin/python3.6
make
make install

 

Enable Apache module

Create /etc/httpd/conf.modules.d/10-mod_wsgi.conf

LoadModule wsgi_module modules/mod_wsgi.so

 

Restart apache

Quick Tips: Seamless network backup for windows terminal

Create a text file backup.cmd (Notepad Save As > Change Text File dropdown  to All files)  and add a single line per backup source. Double-click to run.

robocopy.exe \\192.168.0.1\source D:\destination /MIR /ZB /XF *.exe *.pdf /XD "\\192.168.0.1\source\dir1" "\\192.168.0.1\source\dir2" /LOG+:log.txt /TEE

pause

Options:

  1. /S – copy subfolders
  2. /ZB – Copy files in restartable mode, else Backup mode
  3. /XF – Skip, Exclude File patterns e.g. *.exe
  4. /XD – Skip, Exclude directories. No trailing backslash.
  5. /LOG+: log.txt – Log to file log.txt
  6. /MIR – Create an exact copy (Warning: deletes data from destination that does not exist on source)
  7. /TEE – Used with /LOG to enable console logging

 

Quick Tip: Single drive on IBM ServerRAID

Server hardware upgrade needed a new 2 TB drive on an IBM X-series server with LSI RAID. Here are the steps followed using the BIOS configuration utility;

  1. F2 [Diagnostics] at boot, then CTRL+H to enter MegaRAID WebConfig utility
  2. The default Logical view will display existing configuration of Virtual and Physical drives along with any unconfigured drives at the end
  3. Click “Configuration Wizard” > Click “Add Configuration > choose Manual
  4. In the Drives window select the newly added drive and click “Add to Array”
  5. This drive will now move to the Drive Groups window under a new group
  6.  Click “Accept DG”  > click Next
  7. Click “Add to SPAN” > click Next
  8. Click Accept
  9. Click Yes to accept the RAID 0 with single drive configuration as shown > click Accept
  10. Logical View will display the new disk group initialising
  11. Save and reboot

The OS will now detect a new drive, format … etc

Quick Tip: Delete existing partitions during CentOS 7 installation

Got stuck recently during a remote gig installing CentOS. Vanilla install failed  due to a hardware error and had to be reinstalled but unlike the earlier versions there wasn’t a clearly defined path to delete existing partitions. So here is what we did;

Installation destination:

  1. Custom partitoning, create automatic partitions will prompt that there is not enough free space
  2. Click Done to go back
  3. Select Automatic partition, click Done
  4. Click the recover free space option on the Error prompt window
  5. Delete all exiting partitions (or as needed)
  6. Click preserve to save changes
  7. Click Done to go back
  8. The Disk free space displayed near the bottom has increased

That’s it. You can now proceed with the usual installation steps.