dBase CYYMMDD integer to usable date

Working on some SQL queries against a database running on an IBM iSeries recently, I had to deal with a numeric date format that (allegedly) makes it easier to compare dates. Right. Right? Here are a couple of select clauses to turn that CYYMMDD integer value into something you can actually use…and read:

-- Convert to YYYY-MM-DD
(INT(MOD(NULLIF(nullif(FIELD_NAME,999999),0),100)))) AS "YYYY-MM-DD DATE"

-- I forget where this one was going...
-- Convert CYYMMDD to YYYY-MM-DD and subtract (current date + 60) from it

Read or write to an XML datasource with C#

Quick post with a code snippet I was looking for to read or write to an XML datasource with C#. YMMV, so be sure to add some error checking ūüėČ

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Xml;
namespace XMLConfig
    public class dataAccess
        public static DataSet getData(string fileLocation)
            DataSet ds = new DataSet();
            return ds;
        public static bool setData(DataSet dx, string fileLocation)
            bool status = false;
            return status;
// this is some code to add or edit items in the dataset. These come from a gridview but whatevs
        public void confirmButton_Click(object sender, EventArgs e)
            if (rowNumberField.Value != "new")
                int rowNumber = Convert.ToInt16(rowNumberField.Value);
                GridView1.Rows[rowNumber].Cells[1].Text = editChoice.Text;
                GridView1.Rows[rowNumber].Cells[2].Text = editValue.Text;
                GridView1.Rows[rowNumber].Cells[3].Text = editTemplate.Text;
                GridView1.Rows[rowNumber].Cells[4].Text = selectVisible.SelectedValue;
                int x = 0;
                int y = 1;
                for (x = 0; x < ds.Tables[0].Rows.Count; x++)
                    for (y = 1; y < ds.Tables[0].Columns.Count + 1; y++)
                        ds.Tables[0].Rows[x].SetField<string>(y - 1, GridView1.Rows[x].Cells[y].Text.Trim());
                // DataRow r = new DataRow();
                DataRow r;
                string[] a;
                a = new string[4];
                a[0] = editChoice.Text;
                a[1] = editValue.Text;
                a[2] = editTemplate.Text;
                a[3] = selectVisible.SelectedValue;
                // r.ItemArray = a.ToArray();
                r = ds.Tables[0].NewRow();
                r.ItemArray = a.ToArray();


ClickOnce setup.exe switches

Quick note for a feature I never noticed before on ClickOnce setup.exe switches…they exist!

Use -url to see the URL he executable points to

To change the URL, use -url=newUrlValue

Used this to resolve issues with…other developers building and deploying differently.

WebLogic domain creation is stuck

Quick post for how to resolve an issue when your WebLogic domain creation is stuck at “creating domain security information”

Locate …/wlserver_10.3/common/bin/config.sh and create a backup before editing it

add the following to the JVM_ARGS





HTTPS website security checkup

Since making changes to this site to force a secure connection, I thought now would be a good time to do a security checkup. I used both the Symantec SSL Toolbx and Qualys SSL Labs site to see how well I did installing my certificate.

HTTPS website security checkup results

Symantec said I was in good shape against the vulnerabilities they check for, but did note that I wasn’t using a Symantec certificate (not made of money, you know)

Symantec says: Ok, but we would like your money
Symantec says: Ok, but we would like your money

I had run the sslLabs test earlier in the week and had to correct for Poodle by adding the following to /etc/httpd/conf.d/ssl.conf

SSLProtocol All -SSLv2 -SSLv3

I had originally set the value in the virtual host config files, but sslLabs still pegged the grade as a “C”. Making the change in /etc/httpd/conf.d/ssl.conf and refreshing the results brought my grade up to a “B”.

better than a "C", but a "B" leaves room for improvement
Still some work to be done

In the same /etc/httpd/conf.d/ssl.conf file I also updated the ciphers — and learned that¬†you have to add this value to your vhost siteName.conf file also!


and turned off SSL compression for CRIME attack mitigation

SSLCompression off

…and I finally got an A…well, A-

A- after all that work?
At least it’s an A

sslReport-20150718¬†to review later….

XMing client rejected error

The previous post worked well in general several times when connecting to servers to install WebLogic and other foolishness. This one time, however, I got an XMing client rejected error. Looking into the logs, here’s what I got:

Xming.exe: client 4 rejected from IP x.x.x.x

In the XMing installation folder, you’ll find a text file called¬†X0.hosts. Each line of this file should contain a hostname or IP address. Exit XMing, add the hostname or IP address to this file and restart XMing. ¬†You can also start XMing with the -ac option…but that’s just running it wide open, so X0.hosts is your friend…

Final side note on XMing and remote X Windows…I’ve had to run the following command on my remote Linux host one time also:

DISPLAY=hostname.domain:0; export DISPLAY

But that doesn’t seem to be every time, so I’m just putting this here in case I need to remember to try that later one time…

Remote X Window session on Windows with Putty and XMing

Did you know that you can’t install WebLogic on Linux without a GUI session? That’s because it runs a graphical Java installer. This post is a quick how to for getting a remote X Window session on Windows with Putty and XMing.

Setting up your Linux server

If your remote Linux server doesn’t already have it configured, install a minimal X Window environment:

sudo yum install xorg-x11-xauth xterm

I also installed XEyes because it makes me laugh — and it’s all about making me laugh:

sudo yum install xeyes

You may need to edit¬†/etc/ssh/sshd_config to ensure that the value for the line¬†X11Forwarding is yes and that the line isn’t commented out. If you had to change the sshd_config file, you’ll need to restart sshd and hope you don’t lock yourself out…

sudo systemctl restart sshd

At your next logon, you may see a message similar to the following, and it can be ignored:

/usr/bin/xauth:  creating new authority file /home/scott/.Xauthority

Setting up the remote X Window session on Windows with Putty and XMing

Download and install XMing. I ended up having to get the installer from SourceForge. Once installed, just start it up. That was it. Well, there’s a follow-up post about a problem I had with one particular system, but we’ll get to that next time.

With XMing running, fire up Putty and either load your session or enter a host name to connect to. In he Category pane, expand Connection and SSH to click on X11. Check the box next to Enable X11 forwarding and make sure the MIT-Magic-Cookie-1 is selected, then open your connection


Since I have already installed XEyes, I simply type in the command xeyes and hit enter to get a nice pair of XEyes running on my Windows desktop:

I see you!

Bonus tip! Remote X Window session on a Mac

Much easier. Just throw a -Y into your ssh command in Terminal:

ssh -Y your_username@your_server.your_domain.com


Fixing permalinks after moving a WordPress site

The <Code/> blog has been moved back to a Linode! As a part of the migration process, I discovered that all of my content pages spat back a lovely 404 error. So here’s a quick post about fixing permalinks after moving a WordPress site to a¬†clean install of CentOS 7.

Find “AllowOverride None” in /etc/httpd/conf/httpd.conf near line 151

and replace it with

AllowOverride All

I noticed that the default httpd.conf has a lot less stuff in it on the Linode than my previous CentOS 6.x installation. That will be something to worry about another day, I guess. (That other day has come and I realized that I generally do my CentOS installs from the minimal ISO and manually add packages that I want. This Linode is the first time in a LONG time that I’ve used a different type of CentOS image.

…Now to determine why my text editor is somewhat more limited than on the previous incarnation of the blog…turns out I just needed to toggle the toolbar in the editor.

Convert a self hosted WordPress site to HTTPS for free

Check another box on the endless to do list. Today I decided to convert a self hosted WordPress site to HTTPS for free. It took about 10 minutes of actual work and only a little bit of additional time for research and verification emails.

Tools used to convert a WordPress site to HTTPS for free:

  • A Class 1 SSL certificate from StartSSL
  • Eric Miller’s post, without which I never would have known there that free SSL certificates were even a thing
  • WordPress Force HTTPS plugin
  • Perseverance

I got flagged for additional review every step of the way by StartSSL, so that did add a couple of hours to the job just waiting for emails. It probably had something to do with using code.circayou.com instead of www.circayou.com, but who can know. My review of the process follows after the jump.


Continuing CentOS 7 OpenLDAP SSSD authentication setup

In this post, I’m continuing CentOS 7 OpenLDAP SSSD authentication setup which was started earlier. OpenLDAP should be up and running from the previous post, so now it’s time to install and configure SSSD.

Continuing CentOS 7 OpenLDAP SSSD authentication setup: install the OpenLDAP clients and sssd components

yum install -y openldap-clients sssd

Edit your new /etc/sssd/sssd.conf file

You’ll be adding your domain or domain/default info similar to the following (but with your info). Note that I have debug_level=9. This is overkill, but was what I was using to work out the process.

 ldap_tls_reqcert = never
 auth_provider = ldap
 ldap_schema = rfc2307bis
 krb5_realm = circayou.com
 ldap_search_base = dc=circayou,dc=com
 ldap_group_member = uniquemember
 id_provider = ldap
 ldap_id_use_start_tls = True
 chpass_provider = ldap
 ldap_uri = ldaps://ldap.circayou.com
 krb5_kdcip = ldap.circayou.com
 cache_credentials = True
 ldap_tls_cacertdir = /etc/openldap/cacerts
 entry_cache_timeout = 600
 ldap_network_timeout = 3
 krb5_server = ldap.localhost.com
 autofs_provider = ldap

Update permissions on /etc/sssd/sssd.conf

chmod 600 sssd.conf

The result should be

-rw-------. 1 root root 731 May 17 20:53 sssd.conf

Use authconfig to enable sssd authentication

authconfig --enablesssd --enablesssdauth --enableldap --enableldapauth --enablemkhomedir --ldapserver=ldaps://ldap.circayou.com --ldapbasedn=dc=circayou,dc=com --enablelocauthorize --enableldaptls --update

Restart sssd and test your authconfig settings

systemctl restart sssd
authconfig --test

The authconfig –test command will provide a lot of output and show what your current settings are…and give you some ideas on settings you may want to enable.

Applying this configuration to another server

So far, I’ve manually installed the openldap client and sssd packages to other servers and copied the /etc/openldap/ldap.conf and /etc/sssd/sssd.conf files to these new systems. Running authconfig (with the options noted above) and restarting sssd enables LDAP authentication on these other servers.

Yes, I need to make a script or otherwise automate it…

Sounds like a good future post.