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
-DAYS(CURRENT DATE + 60 DAYS) AS "EXPIRES IN X DAYS"
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 😉
public class dataAccess
public static DataSet getData(string fileLocation)
DataSet ds = new DataSet();
public static bool setData(DataSet dx, string fileLocation)
bool status = false;
// 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.Text = editChoice.Text;
GridView1.Rows[rowNumber].Cells.Text = editValue.Text;
GridView1.Rows[rowNumber].Cells.Text = editTemplate.Text;
GridView1.Rows[rowNumber].Cells.Text = selectVisible.SelectedValue;
int x = 0;
int y = 1;
for (x = 0; x < ds.Tables.Rows.Count; x++)
for (y = 1; y < ds.Tables.Columns.Count + 1; y++)
ds.Tables.Rows[x].SetField<string>(y - 1, GridView1.Rows[x].Cells[y].Text.Trim());
// DataRow r = new DataRow();
a = new string;
a = editChoice.Text;
a = editValue.Text;
a = editTemplate.Text;
a = selectVisible.SelectedValue;
// r.ItemArray = a.ToArray();
r = ds.Tables.NewRow();
r.ItemArray = a.ToArray();
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)
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”.
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!
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…
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:
Bonus tip! Remote X Window session on a Mac
Much easier. Just throw a -Y into your ssh command in Terminal:
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
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.
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
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.
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.
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…