using imagemagick to strip out colors for .png

It took me a while to figure this out but I was happy with the results and figured this might help someone else.  I had about 100 two color .png files that I wanted to change the color on.  I didn’t feel like editing each one by hand in an image editor so I stumbled on imagemagick.

I am on a Mac (OSX) so I installed it via brew:

➜  ~  brew install imagemagick
Warning: imagemagick-6.9.2-4 already installed
➜  ~

As you can see, I had already installed it. It was obvious, but here’s the command I eventually came up with:

convert filename.png -fuzz 25% -fill "#000000" -opaque "#4e9db3" filename_new.png

The infile is obvious. The “-fuzz 25%” seemed to make the entire replacement more thorough. If I went above 25% I found all the colors were replaced. The “-fill” tells imagemagick what you want to use as the replacement color. The “-opaque” is what you are replacing. To make it easier for me, I also outputted my altered file into a sub folder. Here’s how I looped through all the files:

for i in *.png : do
convert $i -fuzz 25% -fill "#000000" -opaque "#4e9db3" done/$i
done

And off it went. I was very happy with this result. You can read more about it here: Replacing Colors in an Image

usb 2.0 not working in windows 7?

Man, I wished I saved some screenshots.

I wasn’t sure when it happened, but I was getting a pop-up whenever I plugged my USB devices in that said, “This Device may be able to perform faster…” and then it said I had no USB 2.0 or Hi-Speed USB connections installed on my system.

It was driving me nuts since I had a combo USB/Firewire PCI-E card installed and my Kindle, iPod, HTC phone, all complained and I was getting slow(er) USB transfer speeds.

I didn’t know what it could be!  I took out the card, blew the dust out, resat the card, etc, re-installed drivers, but nothing made a difference.

Then I read a forum post that said it might be related to the recent Service Pack for Windows 7.

In my device manager, I had three yellow exclamation points next to my USB devices.  The forum post said to delete them from your device manager, reboot, and then Windows 7 would reinstall the right driver.

Sure enough, it worked!

All my yellow "!" are gone!

In looking back through my Google Search History, I see that I saw an interesting thing in my Event Log:

The driver Driverusbehci failed to load for the device PCI

I work with a real sharp Microsoft Engineer and the first place he always looks is the Event Log.

Here’s the forum post that helped me solve this all:

http://www.sevenforums.com/hardware-devices/139441-standard-enhanced-pci-usb-host-controller-not-running.html

 

 

winxp mode, virtualbox, and VMware Player

Man, I haven’t posted in a long dang time. I’ve been working on a lot of really different and cool things at work and at home.

backdoor man

The other day, I read a post about using split tunnel vpn on WinXP Mode on Windows 7. I like this idea. Essentially, it is simply setting up a virtual machine, installing VPN software on the virtual machine, and using the virtual machine to VPN into your destination network.

I like it for a couple of reasons:

  • My host OS (Windows 7) continues to do whatever it was doing, (bitorrent, IM, etc).
  • My WinXP virtual machine can be 100% dedicated to work stuff

Don’t get me wrong. For work, I have a really nice Macbook Pro. And in the office, I have all the accessories set up so I can just “plug in” and be productive. But at home, I have a pretty beefy Win7 machine and I like using the big monitor and ergo keyboard.

keep moving forward

I was using LogMeIn to access my Mac from my Win7 desktop, but it wasn’t great. I use Virtualbox on my Win7 desktop with Ubuntu Linux and love it, but the VPN doesn’t work great, so and I really need some of the Microsoft functionality.

So, I tried to get it set up with WinXP Mode and it worked pretty well. I installed Office 2007 and use Ninite to install my typical Windows apps. It worked great.  I used WinXP Mode for a couple of days with work and it was okay; I’ve got no major complaints… except I don’t care for the Virtual PC interface and graphic performance stinks.

At first I ran the VMWare converter utility and I created a Physical to Virtual machine and stored the .vmdk on a different harddrive.  Then I installed the VMWare Player and discovered it had an option already to “import Win XP Mode Virtual Machine.” How cool, I thought!

… and so it begins

Computers sometimes suck.

Computers sometimes suck.

After a few minutes, the import completed and I tried to fire it up.  I got an error message that said, “Unable to connect to this virtual machine. Make sure you have proper permissions…. etc” or something along those lines. Uh-oh, I thought.

So then I went to open the converted image I created and got the same error.  Boo!  At that point, I tried to start Virtualbox and I got an even more cryptic error about some kernel.dll not being able to load.  I assumed it was a conflict between VMWare Player and Virtualbox.  So I uninstalled the VMWare Player.

After a reboot, (to complete the de-installation), Virtualbox started up fine, I opened the .vmdk I created and it did open!  I thought I was making progress.  Then, as I read elsewhere, WinXP Mode wants to reactivate itself under Virtualbox.  I couldn’t even get logged in. Upon attempting to activate, it said my product code was invalid.

success!

Still, I was very intriqued about the VMWare Player’s WinXP import utility so I decided to reinstall it and try again.  This time, after I installed it, I did not reboot my system as the installation process requested.  Instead I tried the import again… and it worked!

It installed VMWare Tools… the only drawback was that it was the original WinXP VM so none of my installed apps or settings were there.  That’s cool, I thought since you always can do something better the second time around!

So right now, I just finished installing my favorite free apps using NiNite, and am installing Office, Communicator, and my companies VPN software.

So far, I can say the experience with VMWare Player is much better than the original WinXP Mode.  The VM is noticably faster and the graphics is very much improved.  My host system is pretty beefy, so YMMV, but here’s my settings for my WinXP VM:

  • Memory: 768MB
  • CPU’s: 2
  • Network Adapter: Bridged
  • Sound Card and Display: Autodetect

Great Success!

You can find the links to all the software I used if you want to play along.

non-traditional job interviewing advice

Following up with my previous post about non-traditional resume help, I had also given a few pointers to friends about interviewing. I’ve distilled them here:

  • In this economy, there are tons of people out looking for jobs and willing to take anything.  If you are a senior person, and you apply for a junior position, you probably won’t get the job.  Employers are savvy about this, and realize once the economy gets better, you’ll probably leave as soon as you can for a better paying job.
  • And you should, (if you got the job!)! Companies lay people off all the time; it’s a business decision. You and your family should be your number one business.  Think of it as a business decision that is good for you and your family!
  • Remember that the interview is for both involved parties. You should be interviewing your new company, boss, position, growth potential, quality of work/life balance, etc.  See how they treat you during the interview process.  Did they offer you bathroom breaks, sometime to drink or eat?
  • Are the people interviewing you qualified to assess your skills and/or qualifications?  If your hiring manager is not knowledgeable in your skill set, there will be some frustration around expectations.  I was recently asked to interview a candidate for a Cisco Network Engineer position.  I know nothing about the technology, I was brought in to evaluate the guy’s personality. But I was able to asses his ability to learn, lead, personality, and if he could get the job done if given what he needed.  I would not have been able to gauge his technical skills. I was upfront and honest about this.
  • If you get pre-screened by HR or the recruiters, they’ll ask you what you make now or what you made before. DO NOT give them a number until it comes down to an offer. If you give them a number, and it’s lower than the range for the position, they’ll give you that.  You can always say, “Before I give you a number, I want to learn more about the position. Until then, it’s hard for me to give a number that I think is appropriate…” or something along those lines.  If they press you for a number, I would give them a number around 10% above your current or last salary amount.  Don’t tell them, “I’d like to make, $XZY.”  Instead, make it a definite statement, “I am looking to make $XYZ!”
  • Remember, if you get an offer, to consider the total benefits package; vacation, sick time, work at home policy, breaks, insurances, etc, commute, along with the salary.  Work is not just about making a salary. It is also about these things, too.
  • Vacation is always a negotiation-able.  While HR says, “Nope, our standard policy is two weeks” you can always work out a deal with the hiring manager. Just get it in writing from them in case you move under a new boss or he moves out of their position.
  • Sometimes, a severance package is also something you can negotiate for.  “Since I was laid off at my last job where I was at for twelve years, I would feel more safe if some accommodations were made if I was to be let go within my first six months while I am here.”
  • When you get an offer, ALWAYS say, “Thank you.  I need 24 hours to think about it.” If they say, no, then you don’t want to work for them.  You do need to think over every offer and at least sleep on it and talk it over with the family.  Be sure to get back with them either way by the time you committed to.
  • Be prepared to ask questions or do the interview yourself.  Some people just aren’t good interviewers.  One guy I interviewed with when I was being interviewed was clearly uncomfortable so I began asking about his family, kids, etc and we talked for the whole hour about that sort of stuff.
  • This is a good one, but kind of scary.  When the interview is over, ask them if they have any reservations on hiring you. This might catch them off guard, but otherwise it will throw the door wide open for more discussion if there is any concerns. The interviewer might say, “Well, as a matter of fact, I am a little concerned about your lack of experience in XYZ…”  This gives you, as the interviewee, to specifically address this.  In this case, maybe you answer, “While I haven’t done XYZ, I have done ABC which is the same skill set…”  who knows.  But if this guy was worried and the interview ended and it never came up, it could hurt your chances when the other candidates are considered.

I hope you find these helpful.  These come from mypersonal experience as well as some other job finding groups I belong to.  If you have more ideas, I’d love to hear them!