Entries Tagged as 'Linux'
Posted by Jordan Michaels
Just recently I found myself needing to verify if a server I was working on - which required image manipulation - was actually running in headless mode. On Linux servers, graphical user interfaces (GUI's) aren't usually running because they take up additional resources (like memory) and server administrators usually want to give all the resources they can to actual server processes rather then a GUI which they only use occasionally. However, the JRE that ColdFusion engines run on needs the window processing engines in order to perform graphic manipulation - image resizing, rotating, etc - all require image processing libraries.
The following code bit allows you to see if your CFML engine (Railo, OpenBD, or ACF) is actually running in headless mode. This is useful if you're debugging a pesky image processing problem and you want to make sure your JRE's access to the XORG libraries aren't the problem.
<cfobject
action=create
name=geObj
type="JAVA"
class="java.awt.GraphicsEnvironment">
<cfset geResponse = geObj.isHeadless()>
<cfdump var="#geResponse#">
The code calls java directly and returns a true or false response if you're running in headless mode or not.
Hope this helps!
Posted by Jordan Michaels
I've experenced this problem many times on both Ubuntu and Linux Mint, and I've had to go research this problem several times each time I encountered it. (I can never remember where to find it.) So, I'm writing it down here in case I ever need it again, or perhaps someone else out on the Net is experiencing this same issue and hasn't figured out how to fix it.
The problem is that whenever I used SSH to get a remote terminal to another computer, I would occasionally get a long delay before SSH would prompt me for a password. Once I logged in, the connection was very fast, so I knew it wasn't a network problem. It had to be something related to the servers I was connecting to. This perplexed me for a long time.

After much research, I came across this post, by a fellow with the username "gpowers01", right close to the bottom:
http://ubuntuforums.org/archive/index.php/t-630623.html
So... I tried it. I added the following line to my local /etc/ssh/ssh_config file:
GSSAPIAuthentication no
... and VIOLA! No more stinking pause. Thank you "gpowers01"!
For the record, I did try the SSH DNS thing that's mentioned in the post too, but that's never worked for me. Maybe it's because my NAT doesn't suck, but the GSSAPI thing works for me every single time.
So... the next time I go to look for this, I won't have to go any further then my own blog. And perhaps I may help someone else out too. The Interwebs are cool that way. ;)
Posted by Jordan Michaels
What is "icoutils"?
Recently I had a project that required that I have a Windows icon associated with it. This didn't seem too daunting to me at first, because I know that the image editor I was using could save images in the "ico" format I needed. .ico files are used for things like websites (favicon.ico) and program executables. In my case, I was creating a program executable, and I needed to create an icon for it once it was compiled.
The "icoutils" is a free project that can be used to both create ico files or it can be used to extract images from ico files. The "icoutils" home page can be found over here:
http://www.nongnu.org/icoutils/
While I am personally okay with compiling things, I did find that "icoutils" was in my local software repository, (I'm currently using Linux Mint), so you can probably find it in other repositories as well (I haven't checked).
"icoutils" Online Documentation (or Lack Thereof)
While I was happy to find that there was a free utility to create ico files, I was disappointed because I couldn't find online documentation *anywhere* about how to use it. I ended up looking at the source package and seeing that the source creates 3 utilities, none of which are actually named "icoutils". Instead, the three utilities that are created are "icotool", "extresso", and "wrestool".
Since I installed "icoutils" via my repository, I could run each command followed by a "--help", which was nice because it provided me with some basic usage information. I also found that "info" worked, so "info icotool" provided some good documentation on how to use it. There were no actual command examples, so I had to figure out the hard way which command sequence was necessary to create an actual ico file, but eventually I was able to figure it out. So... I thought I'd document the process here.
Using "icoutils" to Create a .ico File

After reading a bit about .ico files, I found that .ico files are actually a grouping of several different files at various resolutions and color depths. bundling up all the image files into a single "ico" file allows that file to become larger and smaller depending on how it's used. For example, the favicon.ico has a smaller image that is used in a browser's favorites list, and a larger version that is used as a desktop icon. The same rule applies to an executable file. If the executable is shown in Windows Explorer's "list" view, the small icon is shown, where if you use "tile" view, the larger icon is shown.
With this in mind, I had to create several iamges in order to create my icon. I chose to create the following resolutions: 16x16, 32x32, and 48x48. I created each image and saved each one as a .png file. I did this using The Gimp, which is a free image editor that I use on my Linux Desktop. Next, I used the "icoutils" tool called "icotool", to bundle the images together using the following command:
- $ icotool -c viv-16-16.png viv-32-32.png viv-48-48.png -o viv.ico
After that, I was immediately provided with my "viv.ico" file which had each image nicely bundled together.
Thanks to the makers of Gimp and "icoutils" for their hard work and for letting folks like me from the community benefit from it!
Posted by Jordan Michaels
Recently I bought a second monitor for my home system. I installed the second monitor and booted into ubuntu only to find that the OS was only displaying on one screen. In order to fix this, I needed to run:
System -> Administration -> NVIDIA X Server Settings
... since I'm running with the NVidia propriatary drivers on my system. I found that I could configure the second monitor easily enough under "X Server Display Configuration" settings, but in order to make the changes *LIVE*, you have to hit the "Save to XX Configuration File".
This didn't work for me. Instead I got a "Can't Save to /etc/X11/xorg.conf" error message. I thought this might be a problem with permissions
, but running the following:
"gksudo /usr/bin/nvidia-settings"
... got me the same results. After that I assumed it must be a parsing problem, and I found that I could have the NVIDIA driver re-write the xorg.conf file using the following command:
"sudo /usr/bin/nvidia-xconfig"
Then the driver re-wrote my xorg.conf, and I was able to run the "gksudo /usr/bin/nvidia-settings", and SAVE with no problems.
Hope this helps!
Posted by Jordan Michaels
It's pretty annoying to me that the latest version of phpMyAdmin requires PHP 5.2, which as some of you may know, is NOT installed on CentOS 5 by default. Instead, you have to use scary-looking RPM's with the word "testing" in them. So... to remove some of the scaryness/complexity of installing PHP 5.2 on CentOS 5 for use with phpMyAdmin, I've written down the following steps that makes the upgrade process pretty easy.
- First install the yum-priorities package. This enables you to specify which repo you want yum to prioritize when it's checking for updates.
# yum -y install yum-priorities
- Next, you'll want to add the scary "CentOS 5 Testing" repository to your listof repo's for YUM to check. You can do that by adding the contents of THIS FILE to your own /etc/yum.conf. I just copied and pasted the contents of that file to the very bottom of my yum.conf and it worked fine.
- Now you should be able to perform a PHP upgrade with YUM by specifying that you want to use the "testing" server as a priority:
# yum --enablerepo=c5-testing upgrade php
or... if you haven't installed PHP yet:
# yum --enablerepo=c5-testing -y install php
- You will probably also want to install the following modules for use with phpMyAdmin:
# yum --enablerepo=c5-testing -y install php-mysql php-mcrypt php-mbstring
- After you're done installing/upgrading php and all required modules, don't forget to give Apache a quick restart so your upgrades take effect:
# /etc/init.d/httpd restart

That's all there is to it! Your phpMyAdmin install should work great now.