Archive for the 'Annoyances' Category
I got hit with a weird bug when I upgraded to VMWare 6.0.3. Before, my Debian Linux guest could happily browse the Internet with a NAT interface. After, I could resolve both internal and external IP addresses, but could not resolve any domain names using DNS.
I can only guess at why, but I believe the problem was not the configuration of my guest, but rather that the problem lays in how VMWare deals with the DNS queries. I use DHCP to obtain an address from the built-in DHCP server, and I was being assigned a DNS server along with my IP (as verified by checking /etc/resolv.conf), but it wouldn’t resolve any names for me.
My solution for now is to step around the assigned DNS address given by the DHCP server, and choose another one instead. I opted to use OpenDNS’s servers, and configuring Debian to use them is trivial – just open /etc/resolv.conf as root with your favorite editor, and change the ‘nameserver’ line to use OpenDNS’s DNS servers. Mine looks like this:
domain localdomain
search localdomain
nameserver 208.67.222.222
Restarting the network isn’t even necessary, the next named request you make should be resolved successfully and everything should be peachy!
If you want to make the change more permanent, you can assign a static IP and a static nameserver to the active interface of your guest operating system (hint, /etc/network/interfaces), which will circumvent the DHCP server. If you want to keep using the DHCP server, you’ll have to change the nameserver line every time you request a new address.
Hope this helps someone else!
When looking at a web page or some other piece of hypertext, the pieces of text that are interactive have historically been set apart by some style change. This really refers to links, which in the majority of pages, are the only pieces of text a user would click on and expect something to happen.
As a small tangent before I continue, I have a weird habit. When I read text on a computer screen, I rapidly highlight the lines I’m currently reading from top to bottom, then release and do the same from bottom to top. Repeating this action helps me track what I am reading, By interacting with the text ‘physically,’ I find I am better able to focus, retain information, and process text quickly.
Now with this behavior in mind, imagine a text interface where simply selecting text results in a behavior the user doesn’t expect. If you are having trouble thinking of an example, allow me to point you to a political article hosted by the New York Times, and another from the Free Dictionary on spectator ions. The common feature shared by these two websites is they both have a hidden feature. Selecting and clicking on words will open a new window containing their definition.
This behavior is unexpected, as there are no visual cues to hint that the above action will have that result. Surprising your users with behavior like this is an annoyance, but not having the ability to turn off this behavior results in blog posts (like this one!).
The lessons here are short, and barely warrant a full post as they should be common sense:
- Your interfaces should behave as the user expects.
- Separate your interactive elements visually.
If you ignore either, you risk frustrating the very same group of people you are trying to attract – a behavior that most developers try to avoid.
One of the relatively recent additions to KDE/Gnome has been the ‘network-manager’ tool. It attempts to make the life of its users easier by automagically managing your interfaces. I can’t comment on its effectiveness during a normal user’s session, but my experiences were frustrating.
I guess it isn’t fair to say network-manager’s operation was frustrating, but rather that it was running without my knowledge, causing weird behavior. I’m setting up dhcpd in a virtual machine to provide addresses for an isolated network. Normally this requires that you only set up the interface, grab the package, set up the subnets you want to assign addresses to in /etc/dhcp/dhcpd.conf, and start up the daemon. However, this time around, I ran into some problems.
First, I attempted to set up my primary interface to use a static IP. I edited /etc/network/interfaces to set eth0 to use a static IP, set it and its netmask, and then brought the interface back up. The output from ifconfig showed no IP assignment. What!? Thinking it was something I was doing wrong, I brought the interface back down and ignored it while I configured dhcpd.
The dhcpd.conf file isn’t difficult to set up. The subnets to service were declared, as were the address ranges to use when assigning addresses dynamically. When the configuration was done, I attempted to bring up the daemon. /etc/init.d/dhcp3-server start… and… errors. “Not configured to listen on any interfaces?” Ugh. Further digging revealed that dhcpd was looking to serve addresses on a 10.10.1.0 network that I had configured, but the only active interface was listening on a 169.0.0.0 network.
Wait – an interface is up? I took it down! I again checked the syslogs, and sure enough, something is initiating dhclient to find an IP address, and upon failing, is assigning a private IP from the 169.0.0.0 range to my interface. The root cause of it ended up being network manager trying to maintain a connection on the interface utilizing its own configuration. Stopping the network-manager service immediately fixed the problem – bringing up the eth0 interface resulted in it being assigned the static IP I wanted, dhcpd ran without a problem, and I was happy.
I have some gripes with network-manager from this experience.
First, I edited /etc/network/interfaces to make the changes to eth0’s configuration. That is the way changes have been made to interfaces since before I started using Linux. I understand what network manager was trying to do, but two things perplex me. Why did it block my static IP assignment when I tried to bring the interface up? It wasn’t even immediately overridden, there was literally no address assigned to the interface. And also, why, WHY is it ignoring standard configuration files? /etc/network/interfaces should remain the be-all is-all configuration for network interfaces. Using another configuration file just makes things confusing.
Second, I believe the behavior of network-manager needs to be changed. I don’t know how this would be possible, so it may be an unreasonable thought – but if I bring down an interface manually, I don’t want it back up until I manually bring it up. Network-manager bringing up that interface after I had manually taken it down was confusing as all hell, and I certainly don’t use Linux to have my machine work against me.
I have disabled network manager permanently on my system. For a standard user (are there any ’standard’ Linux users?) it may function well, but for anyone that wants control of their machine, I suggest they do the same.
When converting a raw image (such as an image created using dd) to a VMWare vmdk image in Windows using Qemu’s qemu-img utility, I came across an error. The command I used is as follows:
qemu-img convert -f raw L:\\VMtmp\\winImage.img -O vmdk D:\\vmtmp\\xp.vmdk
Which works fine until the output image reached 2GB in size, at which point it exits with this error:
qemu-img: error while writing
Yay for descriptive error messages! I hunted through the qemu-devel mailing lists, as this is an apparently undocumented feature. The cause behind the error is that the Qemu binaries were compiled for Windows with MinGW, which apparently doesn’t have large file support built in. So the solution to the problem is to either compile your own version of Qemu for Windows using Cygwin (which has had large file support for some time), or do what I do – use linux. The Qemu binaries in linux aren’t affected by this problem, and you can create files of whatever size you desire.
As previously mentioned in this blog, I’m taking a programming skills course focusing on Aspect Oriented Programming (AOP) using AspectJ. I am using eclipse with the AspectJ plugin to develop, and recently came across a situation where I wanted to define a pointcut based on an object that uses generics. In attempting to do so, I got the following error in eclipse:
parameterized types not supported for this and target pointcuts (erasure limitation)
While the error puzzled me momentarily, a quick hop over to the AspectJ developer notebook sorted things out. The full description of the solution is there if you want to read, but the quick fix is easy: remove the generic identifier of whatever you are trying to match against.
For example, this is incorrect:
pointcut badPointcut(): target( List<String> );
While this is the fixed version:
pointcut goodPointcut(): target( List );
Now get back to work :)
Along with the common acceptance of ‘lolspeak’ as a method of legitimate communication, IT websites are a scourge of the Internet.
I really enjoy reading their articles, I do. You can gauge an author’s technical competence by how well they describe the concepts they are covering, so I play a little game. I first read the article, taking note of all the areas they introduce then gloss over (exposing their lack of knowledge). For each occurrence, I tally a point on an invisible scrap of paper in my head. At the end, I read the author’s credentials. You’ll generally find that the number of points tallied equals the number of times ‘expert,’ ‘authority,’ and ’specialized’ appear in their biography, with any points left over being assigned to each of their degrees and certifications.
If I ever write for a website or paper, you know what my biography is going to say?
“Robert Peaslee is an author. If you have no idea how to verify whether everything he writes is made up, you probably shouldn’t be reading his articles.”
PS,
We need a firefox plugin to filter IT websites.
Different fields provide entire vocabularies to make communicating ideas specific to that field easier. The necessity of the words these languages use is variable. Guess which language we’ll be using for examples?
Necessary: abbreviations like TCP, NTFS, SDK… etcetera. You don’t want to say the full thing every time it comes up in conversation.
Justifiable: OO, RTFM, and any file format used to describe a data entity (exe, jpeg, etc). It gets weird hearing “oh oh” (OO) when talking to a peer, but probably because I always think of Office Space when the abbreviation graces my ears.
Unjustifiable: Any word that has been bastardized and is now being applied in the war on the English language. Flikr, Digg, and Writely are all included. Maybe not jargon, but I hear them way too much to go ignored.
Management: Any of the above terms used inappropriately.
Jargon: use responsibly.
I am a CS student at RIT, but commonly use the IT labs because they have nicer keyboards (yep, it matters). The main lab constantly staffs multiple student lab managers to watch over it – you know, to keep other students from eating, talking on their cell phones, and printing multiple copies of a document.
Alright, let’s focus on that last one. I’ve been employed as a systems administrator before, so I understand the need to keep the labs clean and quiet. The multiple copy restriction baffles me, however. The lab’s policy clearly states that multiple copies may not be printed in the lab, presumably as a courtesy to other students when many people try to print at once, and possibly to preserve lab printer supplies. But when someone does print multiple copies, there are no actions that the labbie can take against a student other than to withhold all but one copy of the document, verbally chastising the student in the process. The extra documents are then put into a recycle bin. Preserve lab resources my ass.
There are a couple ways to beat the system, which I have never used but see being used routinely. Here are my favorites:
- “It’s one document. The page numbers matter.”
- “Are these multiple copies of the same document?” “No, they are individual copies of *different* documents.”
- “Yes, they are multiple copies, but there was another document in there. Can I just pull it out real quick?” *Grab papers, walk away as lab manager stands helpless*
- Enter with a group of friends and one thumb drive, everyone prints the document.
- Two documents to print multiple copies of: print one copy of the first, one copy of the second, wait five minutes. Repeat.
I don’t even understand why after the documents have been printed, they throw them out instead of giving them to the user. There is no penalty for the now disgruntled student to use one of the above methods to print the number of documents they wanted to initially, but now at the cost of (2*copies)-1 resources utilized for 1*copies received.
Silly.
This really shouldn’t have taken me as long as it did to figure this out, but it was a big enough of an annoyance that I decided to share it.
How to convert a relative path to an absolute path in linux/unix/bash script:
#!/bin/bash
# Assume parameter passed in is a relative path to a directory.
# For brevity, we won't do argument type or length checking.
echo "Absolute path: `cd $1; pwd`"
For those unaware, you don’t have to ‘cd -’ because the backticks perform command substitution and don’t modify the working directory of the script.
EDIT: Anonymous poster ‘foo’ left a comment mentioning that this only works if the path destination already exists, which is indeed the case. This isn’t at all elegant, but it is the ‘two minute hack’ version I could immediately come up with. The result only works if you have permission to write where the path should go, meaning *yes,* there will be a version three of this script when I have more time:
#!/bin/bash
# Alright, this time we'll do parameter checking.
if [ $# -eq 0 ]; then
echo "Usage: $0 "
exit 1
fi
if [ -d $1 ]; then
# Paramater is an existing directory. Print it using the method in the script above.
echo "Absolute path: `cd $1; pwd`"
elif [[ -e $1 && ! -d $1 ]]; then
# File already exists and isn't a directory. Be more safe with the conversion.
mkdir $1$$ 2> /dev/null
if[ $? -ne 0 ]; then
echo "We cannot conver this path without write permissions to the path's destination."
exit 1
fi
# I don't want to escape the quotes. This is already ugly, anyway.
dirName=`cd $1$$; pwd | awk -F"$$" {'print $1'}`
echo "Absolute path: $dirName"
rm -r $1$$
else
# File doesn't exist, begin unelegant conversion
mkdir $1 2> /dev/null
if [ $? -ne 0 ]; then
echo "We cannot convert this path without write permissions to the path's destination."
exit 1
fi
echo "Absolute path: `cd $1; pwd`"
rm -r $1
fi
Secondary notes: I really wrote this on the spot in a couple minutes, directly into this blog post. It is untested, and very ugly. I promise to post something better soon!
I use the StumbleUpon firefox plugin to try and find those ‘gold nugget’ webpages in things I am interested in. One of those things happens to be (surprise!) technology. Now, probably two out of every 5 sites is some ’search engine optimization’ or ‘how to improve your blog’ blog post that offers zero-science techniques for improving your pagerank and increasing traffic.
As far as I can tell, the only people these posts appeal to are other bloggers. So the traffic these sites are attracting are bloggers, who implement the changes, who then attract the bloggers they got the idea from. All I see here is a bunch of reciprocal traffic. Kudos, blogger. Your site is a raging success among other bloggers doing the exact same thing you are.
And as far as techniques used, who invented the ‘insert advertisement in the middle of an article’ technique? And furthermore, who was the idiot that decided to call it a ‘jump’? It is not a jump, it is an advertisement in the middle of your content. I strongly believe the concept was the result of a blogger angry that the blink tag they were so fond of is no longer supported in most browsers. “Hey, I can’t annoy people with blinking text. Time to come up with something new.” Viola, the ‘jump’ is born. Bloggers: if I think your content is good, I’ll probably keep reading despite the annoyance (yay adblock). But if your content isn’t fantastic and I see the word ‘jump’ in your post, I’m leaving your site and am likely to never return.
Stop being silly.
All of you. I mean it. You are ruining my StumbleUpon experience.