Installing and Using phpMyAdmin through YUM

Today is Stephen Hawking’s birthday. He turns 70.

I got PHPMyAdmin installed through YUM after enabling the EPEL (Extra Packages for Enterprise Linux) repository. Once I enabled EPEL, it was a simple

yum install phpMyAdmin

It installs to /usr/share/phpMyAdmin, so from there you just create a symbolic link in the web root to that directory, or change the httpd config to serve out that directory for a virtual host. Your choice. It’s just easier to run this and be done:

ln -s /usr/share/phpMyAdmin/ /var/www/html/mysql

So then http://mywebserver/mysql goes to my phpMyAdmin installation. However, if you’ve just set up MySQL, you will need to set the root user password by bringing up mysqld and running the following command as root:

mysqladmin -u root password P@55w0rd

You should, of course, replace ‘P@55w0rd’ with the password of your choice. At that time you can visit your phpMyAdmin installation through the web interface and log in with those credentials. You are encouraged to then create a user for yourself that does not have root privileges and use it instead, but I don’t see that practiced very often.

So there it is – phpMyAdmin installed through YUM.

I had another problem when I tried to get to phpMyAdmin on that server – none of the PHP code was run. It just showed the raw PHP files as if I’d asked for copies of them. PHP was installed, but I had never encountered an installation that wasn’t configured in apache.

Turns out it was a simple inclusion needed in httpd.conf of the PHP configurations. In /etc/httpd/conf.d/ there are some files that end in .conf that need to be included. So at the end of httpd.conf I put a line that says

Include conf.d/*.conf

I restarted Apache with that configuration and it worked. I can’t say if that’s the best way to do it, but for my test VM that’s fine with me.

Posting Code

So here we are

sed -i '1/,/^$/ s/this/that/g'

Well that worked out!  Now can I color it?

sed -i '1/,/^$/ s/this/that/g'

Apparently I can. One must edit the post in HTML mode and color everything by hand, which is a pain in the rear. Now I wonder if there’s a WordPress tool that will auto-color code snippets based on the language.

Update January 7, 2012:
I learned from a friend that there exists a plugin to automatically color the code samples. He showed me how it works, and now I will try it a different way. Basically, he used the <pre> tags with a class declaration to turn on the syntax highlighting. I will try it here with the <code> tags:

ls -l /etc/sysconfig/network-scripts/ | grep ifcfg

Did it work? No.

Now I’ll display the same thing with the <pre> tags:

1
ls -l /etc/sysconfig/network-scripts/ | grep ifcfg

The plugin is called WP-Syntax and it looks pretty cool. You can do the same thing without line numbers too:

ls -l /etc/sysconfig/network-scripts/ | grep ifcfg

And now a multi-line Bash script that performs a simple yum update and reboots the machine if there was a kernel update (no logic, YMMV):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
 
##*****************************************************************************
## TITLE:                   YUM Update with Kernel Reboot
## FILENAME:                yum.sh
## RELATED FILE(S)          /tmp/yum.catch
## PREPARED FOR:            Green Light IT Consulting
## PROGRAMMER(S):           Benjamin Rehberg
## DEVELOPMENT DATE:        11/22/2011
## COMPILER USED:           None (shell interpreter)
## TARGET PLATFORM:         Interpreted by UNIX/Linux POSIX-compliant
##=============================================================================
##                            REVISION HISTORY
##      DATE            PROGRAMMER      DESCRIPTION OF CHANGES MADE
##      11/22/2011      Ben Rehberg     Initial conception and testing
##
##*****************************************************************************
##             CLASSES, FREE, AND FRIEND FUNCTIONS IMPLEMENTED
##
##      Not OO; procedual script
##
##*****************************************************************************
##                               CONSTANTS
##*****************************************************************************
##                  STANDARD AND USER DEFINED INCLUDES
##*****************************************************************************
##             Definition of member functions for class MyUtilities
##*****************************************************************************
##                          DESCRIPTION/PURPOSE
##
## This script will run yum -y update to update the server software.  It will
## then look in the output for any update in the current iteration that was
## related to the kernel, and reboot the server if it found one.  This is
## designed to run weekly and only on servers that can tolerate an unattended
## reboot.
 
date=`date +'%b %d %H:%M:%S'`
log="/var/log/messages"
 
yum -y update --skip-broken | tee /tmp/yum.catch
 
if [ `grep kernel /tmp/yum.catch | wc -l` -gt 0 ]
then
        echo "$date YUM script run and the kernel was updated.  Rebooting..." >> $log
        reboot
else
        echo "$date YUM script run and the kernel was not updated." >> $log
fi

Greetings from the iPad

This morning, January 2, 2012: I am typing this post into a web form using a single-slate device with no physical keyboard. No wires. No big box under the desk. Not even a thin laptop on the couch. I’m just pecking away at this on-screen keyboard that seems to help me think as it slows me down but is intuitive enough to keep me going at a steady pace.

At the kitchen table this morning, I am not doing anything especially different than I did last year. Only that there isn’t a computer on the house that I use primarily.

I remember writing a couple of years ago about how far we’d come when I was totally wireless in the house without a desktop computer (or a desk at all for that matter). Now I don’t even have a computer in the general sense of the word. I just use this tablet to research, surf the web, watch instructional and entertainment videos (Netflix is too easy to use), and play games with the kids.

Sure, we have a laptop and a stationary computer still, but those are only used when someone else is using the iPad. I’m going to guess that if my family had two more iPads we would only need the iMac to print photos and create content for my business. All that I do on a daily basis I can do with iPad. Everything else can wait until I get back to the family machine in the corner.

Today the price for the 64GB iPad 2 is $699. Until that becomes more affordable to me or the price comes down considerably, I’ll just have to duke it out with the kids. Happy new year!

For Some Reason I Didn’t Publish This When I Wrote It

Found this post in my unpublished list just now:

I just read a story at PC World that revealed the obvious fact that the breaches by LulzSec and Anonymous were avoidable.  The groups used SQL Injection, XSS, social engineering, and took advantage of the misstep by their victims of not encrypting their data at rest.  All of these security practices were and have been avoidable – it’s up to the data maintainer to know about these vulnerabilities before and to keep up with the latest security threats.

Anonymous also used a really old, published exploit (for which a patch was available but never applied) in a Linux system at HB Gary during their playtime with that company and its schmuck CEO.

Security should always be a paramount issue at any organization that handles data for any type of computer users.  Sony failed to keep its users’ data secure, as did the other companies LulzSec and Anonymous has hammered in the past months.  And while releasing all the usernames, e-mails, and passswords was probably not a good idea and caused a lot of grief for millions of people, the companies themselves should be held responsible.  After all, if they had done what is right they wouldn’t be going through this misery right now.

 

The State of My Blog Address

I just took the survey that Technorati created to get some data about the blogosphere for 2011.  While I didn’t get any of the information yet (results are due out in November), I came to realize something: I am not a blogger.

Given that I don’t really have a passion for much to the extent that I need to write about it, there definitely isn’t a pattern of dedicated use here on my blog.  I’ve said many times that I’d like to change that, but whenever I tell my readers I’m going to post more regularly it always follows that I do not do that.

So here’s the state of my blogosphere: dismal.  I’d say I’m way too  busy to write, but that’s not the case.  I have plenty of time to do the things I need to do – I just don’t have the interest.  I just began to wonder how many blog posts I’ve made that reference my apathy about this site.

Anyways, I’ll write it again: I would love to write daily here and frequently discuss things that peak my interest, but blogging here doesn’t come to mind in my daily routine.  That could be due to my lack of any routine these days – I work in a city away from my family on the night shift, and the weekends are hectic with travel and housework.  Switching from nights to days every weekend wreaks havoc on the mind so that it isn’t productive at all.  And that’s just one reason.

Another detriment to my postings is the state of my mind when I finally do sit down to write.  There’s not just one thing on my plate – from the beginning of this post up to this point, I’ve vacuumed the carpet and also called the doctor’s office.  And I can’t be still.

And I just read an article at WebMD about ADHD.  I think I might have something close to it.  I won’t know for some time, though, because my doctor can’t see me as a new patient because it’s Friday.  And I’m not in town any other day.

What was I talking about?

Oh – this blog and why I don’t post often.  That’s right…

Fedora 15 Firstboot Problems

I had some trouble after installing Fedora Linux 15 tonight (on two separate occasions) and thought I’d post here since I didn’t find a thread on the tubes about my specific issue.

I installed FC15 on a desktop at work tonight and it went well.  However, at the first boot where it asks for the first user’s details, license agreement, etc., it would not progress past the time zone settings.  Pressing “Forward” did not go forward as expected.  There was no way to skip the setting, and I was frozen there.

I sat for a few minutes and decided that the machine was set up; I’d already entered my user details and the thing was ready to go except for the time zone and whether or not I’d like to send my system configuration to the Fedora team (I usually do).  But how to get past this screen that doesn’t let me through?  A trick I remembered from way back when…

If you were on FC3 or so, with root logged in to the desktop but with the screen locked, you could just hit CTRL+ALT+BKSP and it would kill the Gnome session and return you to a text console.  Bad security hole.  Nowadays it just restarts Gnome and you are presented with the logon screen.

So that’s what I did.  CTRL+ALT+BKSP skipped that first boot session and gave me a login prompt.  I continued to set up my environment and had to reboot after disabling SELinux.  Upon reboot, I was taken to the first boot sequence again, and it stuck at the time zone setting again.  Damn.

On to searching for a solution.

Found one.  /etc/init.d/firstboot runs at every startup and checks for a file at /etc/sysconfig/firstboot.  If it exists and contains “RUN_FIRSTBOOT=NO” it will not run the firstboot sequence.  There’s your solution to it.  Create a file, /etc/sysconfig/firstboot.  It should contain one line – RUN_FIRSTBOOT=NO

Reboot.  Be happy.

I’m not entirely sure what the issue is/was, but unless it’s an isolated event with the image I have or the disc quality I used when burning, I am very surprised I didn’t find a solution at the Fedora forums.

Remembering September 11, 2001

On the cool morning of September 11, 2001, I prepared myself for the last PT test I’d ever have to take in the Army.  I hated running, and never did very well at all with the physical activity.  I’m as surprised as anyone that I go out on somewhat of a regular basis to run and exercise now, nearly ten years out of the military.

I don’t remember much about the test, only that I barely passed and wouldn’t have to do remedial PT for the rest of my enlistment.  I was pleased with myself for doing just enough.  We rode in someone’s car back to the office, where I took care of records for my company, kept up with data, produced reports, and shuffled paperwork like awards and disciplinary actions.

When I got to the office that morning, though, it was different.  Our armorer was glued to the TV and told us that a plane had hit the World Trade Center.  “Some poor idiot,” I thought.  Sometimes Cessnas, Pipers, and Bonanzas did that with their pilots.  Private airplanes crashed all the time.

I went to my office, probably to print the attendance sheet for the morning’s meeting or something.  That was when the second plane hit, and that was too many planes for a coincidence.  I soon found out that they weren’t private planes but commercial airliners.  And we heard about the Pentagon – we’d just had a sergeant from my platoon go to work there.  And Pennsylvania.

I was still in my PT uniform, so I went off-base to my apartment to change.  It took me five hours to get back on to Fort Carson – they were checking every vehicle.  Security was up to the max, no exceptions.

The following days saw me riding my bicycle on to the post, as it was much faster than waiting in traffic.  Later in December I would hear of the U.S. bombing Kandahar, and the war had begun.  We’d had a down-range exercise scheduled for October, and it was not delayed.  We went on the exercise.  More bombing.  Looking at Iraq.  Elevated troop deployment.  Worries and talks of a stop-loss.  I was just months away from getting out.

I ended up discharging from the Army, half regretting my decision to get out, and half relieved that I wouldn’t have to go to war myself.  I never was much of a fighter – I wanted to go to college.

In April 2002, I was working at an airfield, fueling private airplanes and the commercial jets at the airport.  It was where all the folks from Fort Carson happened to get on big planes in big numbers, headed for Iraq or Afghanistan.  One night I was throwing bags on one of those big charter planes and I saw my own unit stamped on the bags.  My unit was going to Iraq.  That would have been me.  After all, I was in the bottom of the plane while my comrades were getting in on top.  Harrowing thought.

I’m not saying I’m changed forever, but this is just my story.  I sometimes wish I could use my skills to help the military, save lives during war, or fight the enemy.  But most of the time I just want to be home with my wife and children.  They are my brethren who make that possible.

My thanks goes out to all who have ever served in the United States military, in any capacity, for any length of time.  We also should be very proud of the paramedics, firefighters, and police who serve our communities in the best and worst of times.

Best Toy Ever

I recently found an article at MSNBC about a soldier whose brother sent him a radio-controlled truck with a video camera to help him check for bombs under vehicles. The truck became a favorite toy among the soldiers as it was a good way to pass some time playing with it.

Some time later, though, the soldier lent the truck to a patrol unit. The unit saw something funny during their route and decided after a few minutes to send the truck out to have a look. It ended up snagging on a trip wire and triggering what they estimated was a 500-pound bomb. The truck obviously didn’t survive, but six soldiers’ lives were spared because of it.

In a time of multi-million-dollar airplanes, efficient tactical satellites, huge tanks, and nuclear-powered ships, the Army made quite a difference with a $200 toy. I would doubt the Army would have a reason to send thousands of radio-controlled trucks over there, but a few hundred couldn’t hurt. I’m willing to send any help those soldiers can get on the ground. What do you think?

Where’s George?

Anika and I got a dollar yesterday at Starbucks that had wheresgeorge.com stamped on it. It’s the first one I’ve ever had myself. I’d seen friends who had come into contact with one but I never got to follow up on any.

We went to the site with it today and logged it. I was disappointed to find that this was only the second logging of this particular dollar, with the initial entry from Savannah over a year ago.

I signed up to receive updates on the bill. To ensure it really goes somewhere, I’m going to take my wife’s idea of spending it at the Atlanta airport this week. I’ll update this post if I hear back from the dollar.

Long Lunch

A man stops at a store on his lunch hour and buys a folding chair. It’s the type of chair that can fold up and slip into a sleeve, the sort of seat one takes to a tailgate party. He drives back toward work but doesn’t stop; he knows where he’s going. He should probably call his wife.

He parks in the short-term parking lot at the airport. He won’t be gone too long. He’s wanted to do something like this all his life, but hadn’t realized it until this afternoon. At the counter, he buys one ticket to Colorado Springs, round trip. Return tomorrow. He’ll need a car when he gets there.

The flight is tolerable. Nothing to take note of. The car is ready when he arrives. It’s a small airport and he’s off in minutes, driving toward the mountains. The weather in early fall is wonderfully pleasant.

After an hour or so of driving, he pulls over to the shoulder of a long, empty road. He gets out, opens the trunk, and retrieves the chair. He sets it up beside the car, sits down, and stares at this. Exactly as planned.