Sunday, February 13, 2011

Gnome Wallpaper Changer

One feature I really liked about Windows 7 that is lacking on F13 Gnome is the ability to automatically rotate desktop wallpapers. This minor aesthetic functionality is easily implemented using crontab and a simple python script. I set the script to run every 15 minutes using crontab and to read from a specific folder of wallpapers (.backgrounds/dual). I used Davyd's Madeley's python script:


#!/usr/bin/python
#
# change-background.py
#
# A script to change to a random background image
#
# (c) 2004, Davyd Madeley
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#

backgrounds = ".backgrounds/dual"

import gconf
import os
import random
import mimetypes

class GConfClient:
def __init__ (self):
self.__client__ = gconf.client_get_default ()
def get_background (self):
return self.__client__.get_string ("/desktop/gnome/background/picture_filename")
def set_background (self, background):
self.__client__.set_string ("/desktop/gnome/background/picture_filename", background)

client = GConfClient ()


dir_items = os.listdir (os.path.join (os.environ["HOME"], backgrounds))
items = []

for item in dir_items:
mimetype = mimetypes.guess_type (item)[0]
if mimetype and mimetype.split ('/')[0] == "image":
items.append (item)

item = random.randint (0, len (items) - 1)
current_bg = client.get_background ()

while (items[item] == current_bg):
item = random.randint (0, len (items) - 1)

client.set_background (os.path.join (os.environ["HOME"], backgrounds, items[item]))



The crontab file is set as:


*/15 * * * * DISPLAY=:0.0 /usr/local/bin/change-background.py

Thursday, December 23, 2010

Citrix VDI

Haven't had much time to post lately as we're deep in our Citrix VDI build at work. Our lead VDI engineer left the firm about the same time our hardware arrived, which means I am not the full time engineer on the project, which I'm sincerely enjoying as it affords me the opportunity to learn and really familiarize myself with our XenDesktop 4, PVS 5.6 SP1, XenApp 6 environment. The downside is I definitely am caught spinning my wheels sometimes simply because I'm not that familiar with the technology. As a result, below is a list of a few things that I've learned thus far that is not documented on Citrix's site that may be useful for others experiencing similar issues:

  1. When installing UPM on Windows XP VDIs, change the default installation location to C:\Citrix\ProfMgr. Supposedly, it can handle 8.3 filenames (filenames like C:\Prog~\Citrix\Prof), however we never got it working in our environment, even though 8.3 filenames are enabled.
  2. When working on the GoldenImage or vdisk in private mode, make sure you delete all domain user profiles before XenConverting or putting the vdisk in standard mode. Otherwise UPM will complain of log file issues as it can't write to the log file because the log file is read-only, imprinted in the user profile on the vdisk, which is read-only
  3. XenDesktop 4 does not like MS SQL 2008 SP2. While SQL 2008 is not officially supported, we've had no issues using it until SP2 was applied. Once SP2 was applied, XenDesktop continued to work, but could not reliably determine the power state of the VDIs and the XenDesktop Setup Wizard would always fail on the PVS with an error of "Invalid Host ID" when trying to create the desktop gropu
  4. Make sure to check the "Manage Machine Account Password" on the VDisk File properties! Otherwise you'll have a nightmare of AD issues and the VDIs won't register using the Desktop Agent to the DDC
  5. In a somewhat unique environment, we are required to stream to two separate VLANs. To accomplish this, we teamed two of our physical NICs on our PVS servers and trunked the teamed connection to each VLAN. This alone will not accomplish streaming to both VLANs as both the TFTP service and Provisioning Server Two Stage Boot Process only listen on one NIC by default. If you try opening the tftp.cpl control panel, it only allows you to check one adapter for the service. As for the PVS two-stage boot process control panel (.cpl), we couldn't even get it to open on our 2008 R2 Server. To allow the services to listen on all adapters, go into the registry HKLM\System\Controlset001\services\\parameters, clear the value of the "Adapter" reg key. If you run a netstat -a you'll see the service is listening on 0.0.0.0 *.*
  6. Due to a client security requirement, TFTP is disallowed in the environment. As a result, we use boot ISOs to boot to our VDisks. Through trial and error, we discovered that to boot to an empy vdisk for the first time, you must use PXE boot (and subsequently, TFTP). You cannot use a boot iso when first creating a vdisk.
Off the top of my head, that's all I can think of right now. As we continue through our build phase, I will continue to supplement this list.

Friday, September 17, 2010

Helpdesk Tickets

As I may have noted in earlier posts, on my current project I split time between two roles: Citrix Virtual Desktop Engineer and Desktop Engineer, the latter essentially a glorified helpdesk technician.

On the project, we do in fact have a "helpdesk," although not in the traditional sense. Our "helpdesk" functions more as a service desk, where the helpdesk representative doesn't actually perform any troubleshooting or support duties. These "helpdesk" personnel simply take phone calls and transcribe the issue the end-user is having into our archaic and cumbersome ticketing system, and then assigns the ticket to either me or another "Desktop Engineer". Two important and relevant points follow:

a.) the helpdesk representatives don't in fact really utilize their brains. They are simply human transcribing machines. The message is spoken to the helpdesk representative, then transcribed into our ticketing system.
b.) there exists software today, and has existed for nearly a decade, that does exactly this function... better.

Here are a few tickets I've received just today; I can't decide whether it is more sad or funny. Keep in mind that the individuals authoring these tickets are grown adults that assert they are college-educated.

9/17/2010 11:02AM user name when she put in her flash drive in her computer it is not recognized it

9/17/2010 10:20AM user name he need to have his lapt top configure for wirless in the office location

9/17/2010 11:52AM user name is will be in office location the week of September 27 she was told by team lead to sey up her computer so that she can use a wireless card.

Wednesday, September 15, 2010

Linux Kernel Contributors

Consistent with what I found in my research for my undergraduate economics thesis, "A Theoretical Analysis of the Efficiencies of Software Development Models," virtualization.info cites Citrix and VMWare as being ranked as the #12 and #20 (respectively) contributors to the newest Linux Kernel (2.6.34). Although this may seem initially counterintuitive that two proprietary software development firms are such large contributors to open source software, it is consistent with my research findings that the largest contributors to open source software communities are in fact private, for-profit industry firms.

Monday, August 16, 2010

openSUSE on KVM

Most recent guest OS on my RHEL KVM/Qemu setup:






OpenSUSE 11.2 with KDE 4.3. Initial impression is that KDE is pretty slick, but quite different from what I'm used to, back the days of KDE 2 and 3. In terms of usability, it definitely has a learning curve. I'm definitely partial to the simple elegance of Gnome, but I intend to play a bit more with OpenSUSE and KDE.

Tuesday, August 3, 2010

Creating ISO images from a Directory

Recently at work, we had a need to transfer Citrix XenDesktop installation files into our VSphere 4 lab environment, however our ESX servers did not support USB, as the hypervisor did not have usb-storage.ko, uhci-hcd.ko, or ehci-hcd.ko modules compiled and we didn't have time to compile and load them into the kernel.

From our VSphere console, we can only mount ISOs and we can't drag and drop files into the VM, like in VMWare workstation, so the easiest way to get our files into our VMs was to burn an ISO. Fortunately this is pretty easy to do in Linux:

mkisofs -o files.iso -J ./folder


Credit where credit is due, this blog post was extremely helpful.

Sunday, August 1, 2010

Playing DVDs on RHEL5

As a consultant, one critical functionality on my laptop is the ability to watch DVDs- as trivial as it sounds, my laptop serves more than just the sole purpose of a work tool. Outside of work, it's my portal to the world, including personal e-mail, online television, and watching movies. Since I'm staying in hotels 4-5 days a week, I don't have the option to go home to my desktop every day after work. My firm understands this, and while the work laptop is primarily for work, the official policy allows us to use our laptops for "limited personal use," which I believe is the right approach- its more of a quality of life factor than anything else.

So after installing RHEL5 as my primary OS and virtualizing my work OS on KVM (whether this falls under "limited personal use" is somewhat murky :-), I needed to ensure that I could still watch movies on the laptop. Unfortunately unlike Ubuntu, Fedora, or Gentoo, RHEL does not have a robust media offering in the standard supported repositories. One reason being that RHEL is really designed for enterprise use, so generally, DVD playback and media handling is unnecessary. Another reason for RHEL's lack of official support for proprietary formats is due to patent and copyright issues- since RedHat markets and sells its OS and accompanying software, it cannot support potentially contentious packages such as libdvdcss.

Nonetheless, RHEL being Linux, I knew that I'd be able to install a DVD playing application, even if installed from source, however I wanted to avoid installing from source if possible simply because of dependency issues and having to write a seamless configuration file with all the right option flags set.

Since RHEL has its Fedora cousin and CentOS brother, I was confident that I could find the appropriate RPMs to install a media player. I also knew that I'd want to install xine, as I really like its simple interface, large support of proprietary and open formats, and I had had good experience with it in Ubuntu.

I began by installing the RHEL officially supported totem package as well as an rpm of libdvdcss. While both installed rather seamlessly, it appeared that totem either couldn't find or couldn't use the libdvdcss plugin. I then tried installing xine from custom packages, but this proved unsuccesfuly with too many unresolved dependencies. After a bit of googling, this Linux Questions forum post directed me to Dag Wieers (Dutch?) repository, which included Dag's custom yum repository with packages created for RHEL5. Once on the site, installation was relatively painless. To create the repository, only one command is necessary:

# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm


After that

# yum install xine


The xine package resolved all dependencies and installed cleanly, and sure enough, I can play commercial DVDs with no issues!