Techie
How to regenerate TLS/SSL keys after Heartbleed with CentOS
by Logan Rogers-Follis on Apr.11, 2014, under Techie
Below are some How-To’s on regenerating TLS/SSL keys after patching your CentOS server to fix the Heartbleed OpenSSL issue.
Regenerate new SSH Server Keys:
SSH1 protocol:
ssh-keygen -q -f /etc/ssh/ssh_host_key -N '' -t rsa1
SSH2 protocol:
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa
Generate/Regenerate new Exim SSL/TLS key:
- First make sure your Exim is compiles with SSL/TLS support
- Generate Keys (D-H key is optional; adjust .key and .cert names to match server config):
- Edit the Exim config file and add the following lines (as needed):
- Restart Exim
cd /etc
openssl req -x509 -newkey rsa:2048 -keyout eximrsa.key -out eximrsa.cert -days 9999 -nodes
openssl dhparam -out eximdeffie.key 1024
tls_dhparam = /etc/eximdeffie.key
tls_certificate = /etc/eximrsa.cert
tls_privatekey = /etc/eximrsa.key
tls_advertise_hosts = *
Generate/Regenerate new PureFTP TLS key:
Figure out the current location of the PureFTP TLS keys and then run the following to generate new keys (adjust file names as needed):
openssl req -x509 -nodes -days 7300 -newkey rsa:2048 -keyout pure-ftpd.pem -out pure-ftpd.pem
Migrating from Incredimail to Thunderbird
by Logan Rogers-Follis on Apr.05, 2014, under Techie
Recently while helping a friend I have found that Incredimail is even more horrible than I had thought. You can export contacts to CSV file to then import into Thunderbird, but the way Incredimail stores e-mail doesn’t allow them to be exported into another e-mail client. Luckily I found out how to export the e-mails from Incredimail and then import them into Thunderbird.
What I learned has mostly come from mozillaZine via http://kb.mozillazine.org/Importing_from_Incredimail
The application you need to use to successfully export from the current Incredimail version is the ReynardWare IncrediMail Converter and to do this you will need to locate the location for the Attachments and Messages. The locations should be something like “C:\Documents and Settings\[Your Account Name]\Local Settings\Application Data\IM\Message Store\” or “C:\Users\[Your Account Name]\AppData\[Local or Roaming]\IM\Message Store\” and the Attachment folder should be in the same area.
Once they are all exported and you have the save location noted (should be similar to the location for Messages and Attachments) you will want to launch Thunderbird (download here) and install the ImportExportTools Add-on and then follow the directions about how to import those freshly exported (above) .eml files so they will always be listed in the Inbox, Sent, etc.
Using 10-key (tenkey) with VIM through PuTTY
by Logan Rogers-Follis on Apr.04, 2014, under Techie
If you are like me and use PuTTY a lot and VIM a lot then you have noticed by default the 10-key causes odd issues when trying to edit a file. Below is an excerpt from the VIM Wikia:
- Run PuTTY Configuration.
- In the left pane, select Terminal, Features.
- Put a check mark next to “Disable application keypad mode”.
- In the left pane, select Session.
- Save the settings.
Clearing/Removing unwatned Recycle Bin Locations ($.recycle.bin) from Windows 7
by Logan Rogers-Follis on Mar.18, 2014, under Techie
I had a case where my Documents, My Music, My Pictures, and Video folders had been mapped to a network share. After tuning this off I had odd issues when emptying the Recycling Bin. I found that even though I had thought I remapped them back to my C:\ drive Windows didn’t agree. You will know you have this problem if you right-click the Recycle Bin -> Properties and see more than the Local (C:) (or whatever drive it is) listed. Obviously if you want Bins on these other drives that is up to you, but if you wanted to remove them as I did, see below.
Try the following I found while searching forums:
- Open the file explorer,
- navigate to the share in question that has the recycle bin,
- right click in the empty space,
- click on “Properties”,
- If there is a “Locations” tab at the top, go to that tab and click on “Restore Default” and press ok.
You might have to reboot, even though I didn’t.
Using “curl” instead of “php -q” in a cronjob for wp-cron.php
by Logan Rogers-Follis on Mar.01, 2014, under Techie
I found that a website running WordPress can become loaded down with a lot of page loads because wp-cron.php is called everytime, and on a site that isn’t and “active” blog it is not needed. In those cases it is helpful to the server load and page loads to disabled wp-cron.php from being ran automatically and set it up as a cronjob. See the below options to do this:
- Edit the wp-config.php file
- Disable the wp-cron.php from automatically running by going to the bottom of the database settings in wp-config.php (around line 37).
- Add the code:
define('DISABLE_WP_CRON', 'true');
Directly under the
define('DB_COLLATE', '');
like:/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');define('DISABLE_WP_CRON', 'true');
- Save the file wp-config.php file.
- Add a cronjob (via Cron Job in your Control Panel, or crontab via CLI) with something like the following and set it to run every 6 hours or so:
curl http://www.domain.name/wp-cron.php
You may have found the similar advise to what I wrote above on other web sites they will generally use “php -q” to run the wp-cron.php fil. Now the side-affect this can produce when using “php -q” vs “curl” (or “wget”) to call the wp-cron.php in your Crontab/Cronjob is you might start getting an error_log file with “Cannot send session cookie – headers already sent in” if one of your plugins or a file that is being ran by the cronjob has a session_start()
call in the code such as Nivo Slider does.
Example (found around line 19 of nivo-slider.php):
if ( !session_id() ) session_start();