Archive for April, 2010

Getting your wireless card to work in XP on your Acer Extensa 5420-5038

So a friend brought his laptop over for what is becoming a regular event down here for me.  That is to wipe Vista off the machine and load it up with XP.  I think this is my 3rd laptop in 2 months.

So his was an Acer Extensa 5420-5038 and finding the drivers for it seemed pretty straight forward and easy enough..  You can simply go to acer.com and search around until the site leads you to them or you can pull them up on the Euro FTP here: ftp://ftp.work.acer-euro.com/notebook/extensa_5420/driver/

Or for the proper webcam drivers go here and go through notebooks>extensa>5420:

http://us.acer.com/acer/service.do?LanguageISOCtxParam=en&miu10einu24.current.attN2B2F2EEF=3750&sp=page15e&ctx2.c2att1=25&miu10ekcond13.attN2B2F2EEF=3750&CountryISOCtxParam=US&ctx1g.c2att92=453&ctx1.att21k=1&CRC=2054404012

And there seems to be an abundance of wireless drivers for you to choose from however you’ll soon discover that none of them work.. None of them at all, none of the XP drivers, none of the Vista drivers, hell I even found XP Pro and XP home driver variants..  Nothing on the Acer website, nothing anywhere that would even detect the card at all.. Well almost anywhere.

In the end I finally tracked down a mediafire link that much to my surprise provided a driver set that actually worked..  So to hopefully save you the hassle of going through all these hoops and trying 100 drivers out just head here: http://www.mediafire.com/?ctxvypzdb3d and get that wifi working.

Oh and surprise surprise the ATI/VGA video drivers provided everywhere for this computer also don’t work, so you will need to go to ati.amd.com search through the integrated graphic card drivers and then find the x1250.

Tags: , , , ,

Your own free content spinner shell script in bash (fTW!)

So today I set out to modify my massive unique tweet and content generator for my Netsyphon network(ie: hotel-kelowna, innkelowna.com, kelownasrestaurants.com, etc etc) and add an inline content spinner to it.  To date there are a lot of search/replaces happening but they are all one time replaces and reference external files for the replace values..  Usually there were only one or two possible s/r results per line so I could handle it easily with gsub.

But now I wanted to be able to take a single article with a ton of spinnable content and have a script generate 10-20-100 different versions of this article.  I would have a sentence where 80% of the content was spinnable with infinite amount of results.  I could handle this with the old method but it would require creating a ton of external files for each search/replace possibility which would get insane.  Instead I knew that there had to be a relatively simple method with bash to make this happen, and much to my delight the boys over at #bash on irc.freenode came to the rescue

Big props out to \amethyst and geirha, my two heroes for the day.  Some useful info from #bash as well:

FAQ: http://mywiki.wooledge.org/BashFAQ | Guide: http://mywiki.wooledge.org/BashGuide | ref: http://tinyurl.com/txlv | http://bash-hackers.org/wiki/ | USE MORE QUOTES!: http://www.grymoire.com/Unix/Quote.html | Scripts and more: http://www.shelldorado.com/

And without further ado here are the scripts that were created by these two gents.

http://pastebin.com/xNgKaR2c:

FAQ: http://mywiki.wooledge.org/BashFAQ | Guide: http://mywiki.wooledge.org/BashGuide | ref: http://tinyurl.com/txlv | http://bash-hackers.org/wiki/ | USE MORE QUOTES!: http://www.grymoire.com/Unix/Quote.html | Scripts and more: http://www.shelldorado.com/

And without further ado here are the scripts that were created by these two gents.

The first by Geirha, is setup to read from an external file , and if not will take the input from stdin

http://pastebin.com/xNgKaR2c:

spinner_thingy ()
{
while read -r -d ‘{‘; do
printf “%s” “$REPLY”;
IFS=’|’ read -r -d ‘}’ -a words;
n=${#words[@]};
((n)) && printf “%s” “${words[RANDOM%n]}”;
done < “${1:-/dev/stdin}”;
printf “%s” “$REPLY”
}

The second by\amethyst can be found here: http://pastebin.com/tAXJ04L6

I went ahead and replaced the example line at the top with a reference to a filename

line=”$(<test.txt)”
makesentence ()
{
local line=”$1″
while [[ $line = *{*}* ]]; do
local -a choices
local prefix=${line%%{*} rest=${line#*{}
local choice=${rest%%\}*}
line=${rest#*\}}
IFS=’|’ read -a choices <<< “$choice”
[[ $choice = *"|" ]] && choices+=( “” )
printf “%s” “$prefix”
if (( ${#choices[@]} )); then
printf “%s” “${choices[RANDOM % ${#choices[@]}]}”
fi
done
printf “%s\n” “$line”
}
makesentence “$line”

So there you have it.. 30 minutes in IRC and the helpful boys over at #bash have me right as rain.. Again a big shout out, these guys have been integral in helping me with all of my scripting in this project.. I would have jack if it wasn’t for them.

As a parting gift I also found a way to do this with php, but alas I wanted a shell script that I could easily integrate into the mothership so it was all one nice neat package.. But for those php guys here it is:

<?php
$text = "The {quick|slow|reasonably paced} {brown|green|blue|pink} {fox|goat|rat|camel}
{jumped|walked|hopped} {over|past|under} the {lazy|tired|boring} {dog|cat|stoat}";
$count = 0;
while ($count++ < 100){
echo Spin($text);
echo "<br />";
}
?>

Now go generate some content!

Tags: , , , , , , , ,

Page optimized by WP Minify WordPress Plugin