I upgraded Chrome in my VM, to version 19.0.1084.46.
Which, apparently, forces use of the GPU Process task.
And, in a nice lovely screw you from the kind folks at Google, there's no way to disable this.
The end result is having the VM slow to a crawl (2 second pause between mouse movements, ignored clicks, etc...). Fixable by the agony of getting to the task manager and killing the GPU process by hand, and then, doing it again when it restarts.
My naive effort was to use Chrome's commandline switches... none of which solved it, and I eventually got to where I ran out of room in the shortcut target, and then in the Windows run dialog. So, I found myself with this on a commandline:
C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application=>chrome --disable-webgl --disable-accelerated-2d-canvas --disable-accelerated-layers --disable-accelerated-plugins --disable-accelerated-video --blacklist-webgl --disable-threaded-compositing --disable-gl-multisampling --disable-threaded-animation --disable-accelerated-compositing --blacklist-accelerated-compositing --disable-accelerated-painting --disable-accelerated-filters --disable-3d-apis
And, still, chrome://gpu-internals happily showed everything (and I mean everything, except the CSS bit) disabled... and yet, still it started.
So much for a big hammer.
But, ... a kludge was found... using --gpu-startup-dialog. This pops up a window (with only 'ok'), but since it doesn't switch modes, it's easy to kill the GPU Process in the task manager.
However, the final solution to running the broken, retarded, I-loved-this-browser-why'd-they-have-to-ruin-it Chrome version in a VM?
--gpu-launcher=pieceofshit
Using that, I didn't even have to do any of the other disabling; in a VM, leaving everything accelerated, the GPU Process never starts, everything's smooth, and fast, just the way it should be. (I'm assuming it works because by passing the launcher garbage, it bails instead of trying to keep going. Hopefully this 'feature' doesn't get fixed.)
Reference:
Chrome Commandline Switches
2012-05-23
2012-05-15
Using Conky's Template[x]
Conky's neat, but doesn't appear to allow user variables, and the documentation leaves a lot to be desired when it comes to templates. I found myself desperate for some way to clean up a .conkyrc when using Teo's weather scripts. (They work well, but are insane to edit by hand --- and the gui program (conky companion) appears to require using a mouse to drag. every. single. element. to one's configuration.)
Here's the stock USA Image Accuweather script from TEO:
TEXT
${font Arial:size=12}${color ffffe5e59595}WEATHER ${font}
${hr 2}$color${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}
${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,70 -s 180x108}
${font Arial:size=10}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${font}
${goto 200}${color ffe595}TEMP:$color${alignr}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 200}${color ffe595}WIND:$color${alignr}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}HUM:$color${alignr}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}PRESS:$color${alignr}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}CLOUD COVER:$color${alignr}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}UV INDEX:$color${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}DEW POINT:$color${alignr}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}AM. OF PRECIP.(1hr):$color${alignr}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}VISIB.:$color${alignr}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}SUNRISE:$color${alignr}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}SUNSET:$color${alignr}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${hr 1}
${goto 50}${font Arial:size=10}${color ffe595}TODAY$color$font${goto 230}${font Arial:size=10}${color ffe595}TONIGHT$color$font${image $HOME/Accuweather_Conky_USA_Images/today.png -p 0,230 -s 120x72}${image $HOME/Accuweather_Conky_USA_Images/tonight.png -p 190,230 -s 120x72}
${font Arial:size=8}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/messages_curr}${goto 195}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/messages_curr}$font
${font Arial:size=8}${execpi 600 sed -n '2p' $HOME/Accuweather_Conky_USA_Images/messages_curr}${goto 195}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/messages_curr}$font
${color ffe595}TEMP: $color${execpi 600 sed -n '28p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 195}${color ffe595}TEMP: $color${execpi 600 sed -n '32p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${color ffe595}REAL FEEL: $color${execpi 600 sed -n '29p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 195}${color ffe595}REAL FEEL: $color${execpi 600 sed -n '33p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${hr 1}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 155}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 270}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}$color${font}
${image $HOME/Accuweather_Conky_USA_Images/7.png -p 0,390 -s 90x54}
${font Arial:size=8}${goto 100}H:${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}H:${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}H:${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${font Arial:size=8}${goto 100}L:${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}L:${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}L:${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/messages}
${execpi 600 sed -n '2p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/messages}
${image $HOME/Accuweather_Conky_USA_Images/12.png -p 115,390 -s 90x54}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 230,390 -s 90x54}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 155}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 270}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}$color${font}
${image $HOME/Accuweather_Conky_USA_Images/22.png -p 0,505 -s 90x54}
${font Arial:size=8}${goto 100}H:${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}H:${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}H:${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font Arial:size=8}${goto 100}L:${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}L:${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}L:${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/messages}
${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/messages}
${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 115,505 -s 90x54}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 230,505 -s 90x54}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 155}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 270}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/last_days}$color${font}
${image $HOME/Accuweather_Conky_USA_Images/N12.png -p 0,620 -s 90x54}
${font Arial:size=8}${goto 100}H:${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}H:${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}H:${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font Arial:size=8}${goto 100}L:${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}L:${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}L:${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '17p' $HOME/Accuweather_Conky_USA_Images/messages}
${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '18p' $HOME/Accuweather_Conky_USA_Images/messages}
${image $HOME/Accuweather_Conky_USA_Images/N17.png -p 115,620 -s 90x54}${image $HOME/Accuweather_Conky_USA_Images/N22.png -p 230,620 -s 90x54}
That just shouts "There's got to be a better way.". Here's my use of Conky templates. I was also playing with fonts, so yes, it's most likely pretty putrid (the screenshot and colors), but the point is more editable (ie, hand tweakable) code which is functionally equivalent to the above:
While I'm hardly an expert with conky, or weather data scraping (I'd likely not be using someone else's script, if I were), I'd say the template way works quite a bit better for hand editing; after converting, it became trivial for me to quickly change the positioning of elements.
Reference:
Teo's Conky Weather Scripts
Conky - A light-weight system monitor
Here's the stock USA Image Accuweather script from TEO:
![]() |
| Stock Accuweather Conky |
TEXT
${font Arial:size=12}${color ffffe5e59595}WEATHER ${font}
${hr 2}$color${texeci 500 bash $HOME/Accuweather_Conky_USA_Images/acc_usa_images}
${image $HOME/Accuweather_Conky_USA_Images/cc.png -p 0,70 -s 180x108}
${font Arial:size=10}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/curr_cond}${font}
${goto 200}${color ffe595}TEMP:$color${alignr}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F (${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/curr_cond}°F)
${goto 200}${color ffe595}WIND:$color${alignr}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/curr_cond} ${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}HUM:$color${alignr}${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}PRESS:$color${alignr}${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}CLOUD COVER:$color${alignr}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}UV INDEX:$color${alignr 10}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}DEW POINT:$color${alignr}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}AM. OF PRECIP.(1hr):$color${alignr}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}VISIB.:$color${alignr}${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}SUNRISE:$color${alignr}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${goto 200}${color ffe595}SUNSET:$color${alignr}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/curr_cond}
${hr 1}
${goto 50}${font Arial:size=10}${color ffe595}TODAY$color$font${goto 230}${font Arial:size=10}${color ffe595}TONIGHT$color$font${image $HOME/Accuweather_Conky_USA_Images/today.png -p 0,230 -s 120x72}${image $HOME/Accuweather_Conky_USA_Images/tonight.png -p 190,230 -s 120x72}
${font Arial:size=8}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/messages_curr}${goto 195}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/messages_curr}$font
${font Arial:size=8}${execpi 600 sed -n '2p' $HOME/Accuweather_Conky_USA_Images/messages_curr}${goto 195}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/messages_curr}$font
${color ffe595}TEMP: $color${execpi 600 sed -n '28p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 195}${color ffe595}TEMP: $color${execpi 600 sed -n '32p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${color ffe595}REAL FEEL: $color${execpi 600 sed -n '29p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 195}${color ffe595}REAL FEEL: $color${execpi 600 sed -n '33p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${hr 1}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 155}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 270}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/tod_ton}$color${font}
${image $HOME/Accuweather_Conky_USA_Images/7.png -p 0,390 -s 90x54}
${font Arial:size=8}${goto 100}H:${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}H:${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}H:${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${font Arial:size=8}${goto 100}L:${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}L:${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 330}L:${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F
${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '3p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/messages}
${execpi 600 sed -n '2p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/messages}
${image $HOME/Accuweather_Conky_USA_Images/12.png -p 115,390 -s 90x54}${image $HOME/Accuweather_Conky_USA_Images/17.png -p 230,390 -s 90x54}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/tod_ton}${goto 155}${execpi 600 sed -n '1p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 270}${execpi 600 sed -n '6p' $HOME/Accuweather_Conky_USA_Images/last_days}$color${font}
${image $HOME/Accuweather_Conky_USA_Images/22.png -p 0,505 -s 90x54}
${font Arial:size=8}${goto 100}H:${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}H:${execpi 600 sed -n '4p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}H:${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font Arial:size=8}${goto 100}L:${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/tod_ton}°F${goto 210}L:${execpi 600 sed -n '5p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}L:${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${execpi 600 sed -n '7p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '9p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/messages}
${execpi 600 sed -n '8p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '10p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '12p' $HOME/Accuweather_Conky_USA_Images/messages}
${image $HOME/Accuweather_Conky_USA_Images/N2.png -p 115,505 -s 90x54}${image $HOME/Accuweather_Conky_USA_Images/N7.png -p 230,505 -s 90x54}
${font Arial:size=9}${goto 40}${color ffe595}${execpi 600 sed -n '11p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 155}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/last_days}${goto 270}${execpi 600 sed -n '21p' $HOME/Accuweather_Conky_USA_Images/last_days}$color${font}
${image $HOME/Accuweather_Conky_USA_Images/N12.png -p 0,620 -s 90x54}
${font Arial:size=8}${goto 100}H:${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}H:${execpi 600 sed -n '19p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}H:${execpi 600 sed -n '24p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${font Arial:size=8}${goto 100}L:${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 210}L:${execpi 600 sed -n '20p' $HOME/Accuweather_Conky_USA_Images/last_days}°F${goto 330}L:${execpi 600 sed -n '25p' $HOME/Accuweather_Conky_USA_Images/last_days}°F
${execpi 600 sed -n '13p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '15p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '17p' $HOME/Accuweather_Conky_USA_Images/messages}
${execpi 600 sed -n '14p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 128}${execpi 600 sed -n '16p' $HOME/Accuweather_Conky_USA_Images/messages}${goto 255}${execpi 600 sed -n '18p' $HOME/Accuweather_Conky_USA_Images/messages}
${image $HOME/Accuweather_Conky_USA_Images/N17.png -p 115,620 -s 90x54}${image $HOME/Accuweather_Conky_USA_Images/N22.png -p 230,620 -s 90x54}
That just shouts "There's got to be a better way.". Here's my use of Conky templates. I was also playing with fonts, so yes, it's most likely pretty putrid (the screenshot and colors), but the point is more editable (ie, hand tweakable) code which is functionally equivalent to the above:
![]() |
| My Modified Version |
#custom colors color0 85e5ef color1 42a5AA color2 75dfd5 # Current Conditions template0 ${execpi 3600 sed -n '\1' $HOME/.Accuweather_Conky_USA_Images/\2} # Formatting boilerplate template1 ${goto 285}${color0}\1:$color${alignr \2} # Image boilplate (get path here to make cleaner) : assumes all images are pngs template2 ${image $HOME/.Accuweather_Conky_USA_Images/\1.png -p \2 -s \3} # Temp/Feels Like template3 ${color0}${goto 75}\1: $color${template0 \2 \3}°F${goto 265}${color0}\1: $color${template0 \4 \3}°F # template4 : Day + Day + Day label (ie, "Tomorrow Thursday Friday") template4 ${font Caston:size=10}${color0}${alignc 100}${template0 \1 \2}${goto 210}${template0 \3 \4}${goto 355}${template0 \5 \4}$color$font # template5 : High/Low temperature prediction text template5 ${font Terminus:style=bold:size=10}${goto 125}${color0}\1:\ ${color}${template0 \2 \3}°F${goto 285}${color0}\1:\ $color${template0 \4 \5}°F${goto 420}${color0}\1:\ $color${template0 \6 \5}°F # template6 : message aka weather description template6 ${font Caston:size=9}${goto 40}${template0 \1 messages}${goto 195}${template0 \2 messages}${goto 345}${template0 \3 messages} TEXT ${font Metal Lord:style=bold:size=20}${color1}W E A T H E R ${font}$color${hr 2}$color${texeci 3600 bash $HOME/.Accuweather_Conky_USA_Images/acc_usa_images} ${template2 cc 50,70 180x108} ${offset 50}${font Terminus:style=bold:size=10}${template0 '3p' curr_cond} ${template1 TEMP}${template0 '4p' curr_cond}°F (${template0 '5p' curr_cond}°F) ${template1 WIND}${template0 '6p' curr_cond} ${template0 '14p' curr_cond} ${template1 HUMIDITY}${template0 '7p' curr_cond} ${template1 PRESSURE}${template0 '8p' curr_cond} ${template1 CLOUD\ COVER}${template0 '9p' curr_cond} ${template1 UV\ INDEX 10}${template0 '10p' curr_cond} ${template1 DEW\ POINT}${template0 '11p' curr_cond} ${template1 PRECIPITATION}${template0 '12p' curr_cond} ${template1 VISIBILITY}${template0 '13p' curr_cond} ${template1 SUNRISE}${template0 '15p' curr_cond} ${template1 SUNSET}${template0 '16p' curr_cond} ${hr 1} ${goto 85}${color1}${font Venus Rising:style=bold:size=10}TODAY${goto 265}TONIGHT$color$font ${template2 today 40,250 120x72}${template2 tonight 225,250 120x72} ${alignc 95}${voffset 60}${template0 '1p' messages_curr}${goto 270}${template0 '3p' messages_curr} ${template0 '2p' messages_curr}${goto 265}${template0 '4p' messages_curr} ${template3 TEMP '28p' tod_ton '32p'} ${template3 FEELS\ LIKE '29p' tod_ton '33p'} ${hr 1} # row 1 ${voffset 5} ${template4 '6p' tod_ton '11p' tod_ton '16p'} ${template2 7 15,435 90x54} ${template2 12 175,435 90x54} ${template2 17 310,435 90x54} ${template5 H '9p' tod_ton '14p' tod_ton '19p'} ${template5 L '10p' tod_ton '15p' tod_ton '20p'} ${voffset 15} ${template6 '1p' '3p' '5p'} ${template6 '2p' '4p' '6p'} # row 2 ${voffset 5} ${template4 '21p' tod_ton '1p' last_days '6p'} ${template2 22 15,565 90x54}${template2 N2 175,565 90x54}${template2 N7 310,565 90x54} ${template5 H '24p' tod_ton '4p' last_days '9p'} ${template5 L '25p' tod_ton '5p' last_days '10p'} ${voffset 15} ${template6 '7p' '9p' '11p'} ${template6 '8p' '10p' '12p'} # row 3 ${voffset 5} ${template4 '11p' last_days '16p' last_days '21p'} ${template2 N12 15,700 90x54}${template2 N17 175,700 90x54}${template2 N22 310,700 90x54} ${template5 H '14p' last_days '19p' last_days '24p'} ${template5 L '15p' last_days '20p' last_days '25p'} ${voffset 15} ${template6 '13p' '15p' '17p'}
While I'm hardly an expert with conky, or weather data scraping (I'd likely not be using someone else's script, if I were), I'd say the template way works quite a bit better for hand editing; after converting, it became trivial for me to quickly change the positioning of elements.
Reference:
Teo's Conky Weather Scripts
Conky - A light-weight system monitor
Posted by
.greyproc
at
4:20:00 AM
0
comments
tags:
conky,
crunchbang,
linux,
script
Links to this post
2012-04-20
Notes to self: ICH7 - i975x - BIOS
My notes on BIOS settings for the old validation board. Since the non-archived encrypted container I use for this sort of thing is on the system itself, it's somewhat annoying to reference when something's borked.
Some of these are right buggers to find, and my guesses are more than likely wrong -- but I'll think of them wrongly consistently, going forward, rather than this somewhat 3 year cycle of looking them up again when I need to revisit them and have forgotten what Intel's delightful abbreviations mean.
- CPU Configuration:
-
- Max CPUID Value Limit
- Determines the values that the OS can write to EAX to obtain processor information. When enabled, the processor will limit the max CPUID input value to 0x03 when queried. Disabled, processor returns actual CPUID input value. (1)
- GV3 Functionality
- Likely EIST (Enhanced Intel SpeedStep, from Geyserville codename?) - Would be V3.2 for my Kentsfield(?) - P-State power management (in effect while processor is active) - Dynamically adjust the clock speed and automatically switch between maximum performance mode and battery-optimized mode. (1)
- C1 Enhanced
- Enhanced Processor Halt State. Reduces power consumption in idle mode (by turning off some unused parts of the processor, reducing the supply voltage and frequency) - Disable to increase overall determinism of real-time applications. (Intel: "Allows the system to change voltage level (lower) of processor when no work is being done.).
- No-Execution Page Protection
- Later XD Technology (?) aka Execute Disable Bit (xdbit) - Sets bounds to ban execution in areas of memory where code shouldn't be running. (1)
- VT
- Intel Virtualization Technology
- PECI
- Platform Environment Control Interface - Thermal Management - Allows CPU to report temperature.
- Hardware Prefetcher
- Tries to predict which instructions and data are required in the near future and prefetches data/code into L2 cache to reduce latency with memory reads. (1)
- Application Processor(s)
- One CPU is the Bootstrap Processor (BSP) and others are Application Processors (AP). This setting controls whether to enable the additional cores. (1) (2)
- FSB Bus Park
- Intel Dynamic Bus Parking(?) - Allows the chipset to shut down during inactivity to save energy. (1) (2)
- IDE Config:
-
- IDE Detect Time Out (Sec)
- Amount of time to pause.
- Hard Disk Write Protect
- Prohibits recording on hard drives.
- ATA(PI) 80Pin Cable Detection
- Order of type checking for IDE cable (40pin, 80 conductor). Host & Device = checked from mobo and drive. Host = only from mobo, device = only from hdd.
- SATA Link Power Management
- Enable aggressive management and slumber and partial (AIPE&ASP) on all ports - Puts physical layer of link into low-power state. Potentially buggy with some linux utilities(?) (1) (2)
- Stagger Spinup Support
- Enabled: The BIOS will clear the staggered speed up supported bit in AHCI generic 'has capabilities' register.
- Set HPCP Bit
- Hot Plug Capable Port - When set to '1', indicates port's signal and power connectors are externally accessible. (1)
- ARMD Emulation Type
- ATAPI Removable Media Device - Devices which use removable media (LS-120, MO, Zip) (1)
- SuperIO Config:
-
- Assume PS2 Mouse Presence
- Likely equivalent to PS/2 Mouse Function Control (?) - If enabled, reserves IRQ12 for PS/2 mouse.
- USB Configuration:
-
- USB Mass Storage Reset Delay
- BIOS will wait [x] seconds for device to initialize.
- Boot Settings Config:
-
- AddOn ROM Display Mode
- If enabled, logo screen will be followed by AddOn ROM initial screen (showing add-on card BIOS message). Keep Current - 3rd party only displayed if manufacturer set to do so; Force BIOS forces display. (1)
- Interrupt 19 Capture
- Allows host adapters to capture int 19 during boot process.
- Chipset - Northbridge:
-
- Device 2 (IGD) Enable
- Device 2 (IGD) Enable - Auto: IGD enabled/disable based on GFX card detection and primary video device setup option. Disable: IGD is disabled regardless of card detection.
- GMCH (Graphics Memory Controller Hub) Operating Mode
- Paging modes(?) (1)
- TOLUD (Top of Low Usable DRAM)
- Contains address one byte above maximum DRAM memory below 4gb that is usable by the OS. TOLUD is the lowest address above both Graphics Stolen memory and TSEG. BIOS determines the base of Graphics Stolen Memory by subtracting the GSM size from TOLUD and further decrements by TSEG size to determine base of TSEG. All the bits in this register are locked in Intel VT-d mode. Choices: 3.25gb / 2.75gb / 2.50gb/ 2.25gb / 2gb / 1.75gb. Note: grub doesn't like anything over 2.75gb.
- Memory Reclaim
- Allows reclaiming physical memory overlapped by the MMIO logical address space. MCH remaps physical memory from the TOLM boundary up the 4gb boundary to an equivalent sized logical address range located just above the top of physical memory. (1)
- DRAM Throttling Threshold
- Reduces heat; if threshold temp is exceeded, uses additional cycles; can adversely affect computer performance -- disable.
- Chipset - Integrated Graphics Options:
-
- IGD BARs Programming - ?
- Device 2, Function 1
- ? (Related to IGD parellization?)
- Chipset - South Bridge Configuration:
-
- CPU BIST Enable
- Built-In Self Test - "To enter BIST, software sets CPU_BIST_EN bit and then does a full processor reset using the CF9 register."
- SSC Enable
- Spread Spectrum Clocking (?)
- SLP_S4# Assertion Width
- Minimum assertion width of the SLP_S4# signal to guarantee that the DRAMs have been safely power-cycled or... S4 Sleep Control: SLP_S4# is for power plane control; this signal shuts power to all non-critical systems when in the S4 (suspend to disk) or S5 (Soft Off) state. Pin must be used to control the DRAM power to use the ICH7's DRAM power-cycling feature.
- 80h,84-6h,88h,8C-Eh Routing
- Set to LPC -- functionality for the Port 0x80 Codes(?)
- LPC 4Eh-4Fh Decode
- CNF2_LPC_EN - R/W - Microcontroller Enable #2
- LPC 2Eh-2Fh Decode
- CNF1_LPC_EN - R/W - Super I/O Enable
- SPI Prefetch During Shadowing
- SPI Read Configuration(?) - 00b - No prefetching, but caching enabled, 01b - No prefetching and no caching, 10b - prefetching and caching enabled, 11b - reserved. (BIOS_CNTL - BIOS Control Register)
- ASF (Alert Standard Format) Management Controller Support
- Allows controller to collect and send information from system components to a remote server and accept commands back from the remote console and execute on local system.
- Energy Lake Support
- Disables or enables Energy Lake power management technology. Introduces two main end user features: "CE" like device power behavior and maintaining system state and data integrity during power loss events. (Now known as "Intel Quick Resume Technology"?)
- Intel® AMT BIOS Extension
- Active Management Technology - Remote pwnage. (1) (2)
- Force IDE-R (Integrated Device Electronics - Redirect) on Tekoa
- Forces redirect to the network card(?)
- HPET (High Precision Event Timer)
- Replaces 8254 PIT and RTC.
- PCIe Config:
-
- VC1/TC Map
- VC1 will be mapped to TC specified - Field indicates TCs (traffic classes) that are mapped to the VC (virtual channel) resource. Bit locations within this field correspond to TC values. For example, when bit 7 is set in this field, TC7 is mapped to this VC resource. (i975x reference of field this BIOS setting manipulates.) (1)
- Remove non-POR (Power on reset(?)) TCs from VC0
- Default is enabled - Removes traffic classes that don't come back after reset from virtual channel 0(??)
- Lock PCIE Credits Register
- Writes once to the PCIE credit register to prevent them from being modified. (src: C2D Q45 Express Chipset Development Kit)
- Northbridge PCIe:
-
- PEG Port
- PCI Express Graphics port 16x - auto/disable/enable
- PEG Scrambler Bypass
- GFX card: BIOS forces the scrambles to be bypassed without a link disable. Enable: BIOS forces the scrambles to be bypassed by disabling and enabling the link.
- PEG Retry Buffer Depth
- If forced, Retry Buffer is forced to less than optimal value. (Reduces retry buffer to a lower than typically required value)
- PEG Force x1
- Related to Force Link Width(?) - Auto / X1 / Reserve / X4 / X8
- PEG Isoch (isochronous) Flush Page
- Unknown, but chipset spec has: "IFPBAR - Any write to this window will trigger a flush of the MCH's GLobal Write Buffer to let software provide coherency between writes from an isochronous agent and writes from the processor (4-kb window)" which might be related.
- PEG Active State PM (power management)
- Controls level of active state power management supported on the given link: 00 = Disabled, 01 = L0s Entry Supported, 10 = Reserved, 11 = L0s and LI Entry Supported. (1)
- SERR# on Fatal (and Non-Fatal) Error
- System Error is generated if (error type) is detected on the PEG port and will result in NMI (non-maskable interrupt) or SMI depending upon state of NMI to SMI setup option.
- Link Stability Alogrithm
- Used for verifying PCIe Link is up and running for x16 slot for x16 graphics cards.
- Southbridge PCIe:
-
- PCI Express PME (Power Management Event) SCI (System Control Interrupt) Enable
- Routes PMEs through SCIs(?) (1)
- VC1 for HD Audio - ???
- Northway Training W/A - ???
- Northway S4 W/A - ???
- ACPI Advanced:
-
- BIOS->AML ACPI Table
- Allows update of AML. When set, the ACPI APIC table pointer is included in the RSDT pointer list.
- ACPI PCI0 _S1D (S1 Device State)
- The highest D-state supported by the device in the S1/S2/S3/S4 states, respectively. It should be noted that higher D-state values correspond to lower power consumption states, with D0 being the highest powered state and D5 being the lowest power state (off).
- ACPI Video Extensions
- Mostly for laptops(?) (1 (pg 877))
- Headless Mode
- Setting updates FACP (Fixed ACPI Description Table) - "System Type Attribute - If set indicates the system cannot detect the monitor or keyboard/mouse devices."
- SV (Silicon Validation) Options:
-
- Program ICH Native IDE BARs
- Unknown - (1)
- PCI Exp Bridge ISA Enable
- Needs to be disabled to support DOSODI and NDIS2. Detail: "This problem appears to be related to the specific I/O address assigned to the Tekoa LAN function by the BIOS. As configured by the BIOS, I/O reads to adapter registers always fail, returning 0xFFFFFFFF. This causes the driver to be unable to read the adapter EEPROM or configure the adapter for operation and thus it fails to load."
- Global SMI
- CPU SMBASE relocation will not occur if set to disable.
Posted by
.greyproc
at
4:20:00 PM
0
comments
tags:
BIOS,
chipset,
computers,
ICH7
Links to this post
2012-04-16
Using Python to Extract Data From a Smereka Created SQLite Database
I've been migrating my snippets of stuff to thinkery.me, but for more private/personal data, I've been using Smereka: It's open source, with a (for me) intuitive GUI, fast --- and uses sqlite for its backend database.
Unfortunately, its export absolutely sucks, and it looks like Smereka's author is trying to direct folks to his commercial version, and probably won't be adding many features/fixes to the free version.
So, having become set on doing something with all my random files (dot configs, equipment tracking, cake recipes (all the more important when navigating portals), contacts, TMF Yearmix track listings, pppd dial scripts, etc) beyond dumping them all in a backup directory in an encrypted container (and backing up to dropbox and Ubuntu One), I wanted to make sure I could liberate all the data, if I needed to, from whichever program I used. (Siderant: I looked at Evernote, Treeline, etc... why are there so many programs that do such a simple thing so wrongly?) Smereka was nearly perfect, except for putting all items into blobs, which my limited abilities don't allow me to retrieve directly with just an interactive sqlite3 session.
Enter Python. (And ni saying knights, spam, laden swallows and show tunes sung from crosses.)
I've been meaning to 'take a look' at python for the better part of a decade, but never had a big enough incentive to push me into doing so. In one of those weird instances of perfect timing, a good friend linked me to Alex Munroe's rant about PHP, unaware I was bracing myself for some soul destroying C++ spelunking. I read through it, nodding my head and agreeing with most of the points, and was ready to drink the koolaid by the time I got to the end.
What follows is my first ever python program; it's the result of (literally!) a couple days of learning the language. I'm definitely sold on Python; php was always, "Yeah, it's flawed, but what else is there, for quick scripts and web backends?" --- now, I know the answer is "Python."
This code is likely incredibly naive. There are almost certainly better/more elegant ways of accomplishing what I'm doing. However, for my purposes, all I needed was a way of being certain the stuff I was putting into Smereka could be liberated in the future, should I ever need to.
Thus, I'm simply extracting all the data (which, in my case, is text. Smereka also allows images, rich text, etc) and dumping it into a single file. It would be trivial to dump each record to its own file, or use the parent folder as a containing file, or whatever. Since the searching inside of Smereka works just fine, the only point for me was to be able to have something greppable, and zipped, 'just in case'. So, I'm not even bothering to grab the tags or descriptions, again which would be trivial. (Technical: I ignore the DataType: File, as well as the tags in StringsTbl.) I'm skipping error checking, or even politeness, like adding 'global var' to defs. (Obviously, I'm only reading...). I don't worry about memory management, or if it'd be better to create a table with folder names, rather than walk backwards each time... and, finally, I half-assed dealing with the unicode 'issues'. (Windows directory listings from over a decade ago have the obligatory broken bytes to make python kick up a UnicodeDecodeError.)
Note: This code was tested with Python 2.7.1+. YMMV.
Example output (ignore the cobwebs...):
General References:
Smereka - "Extensible Personal Freeform Database and Personal Information Manager"
SQLite Database Browser - Very useful app to play with sqlite databases graphically.
Python References:
PHP - A Fractal of Bad Design - Wonderful php hate manifesto.
Why Python? - Advocacy post by Eric S. Raymond, from all the way back in 2000!
The Python Tutorial - Start Here.
Learn Python The Hard Way - More Beginner Python
SQLite Python Tutorial - Useful for the database bits.
All About Python and Unicode - A staggeringly helpful document.
Unfortunately, its export absolutely sucks, and it looks like Smereka's author is trying to direct folks to his commercial version, and probably won't be adding many features/fixes to the free version.
So, having become set on doing something with all my random files (dot configs, equipment tracking, cake recipes (all the more important when navigating portals), contacts, TMF Yearmix track listings, pppd dial scripts, etc) beyond dumping them all in a backup directory in an encrypted container (and backing up to dropbox and Ubuntu One), I wanted to make sure I could liberate all the data, if I needed to, from whichever program I used. (Siderant: I looked at Evernote, Treeline, etc... why are there so many programs that do such a simple thing so wrongly?) Smereka was nearly perfect, except for putting all items into blobs, which my limited abilities don't allow me to retrieve directly with just an interactive sqlite3 session.
Enter Python. (And ni saying knights, spam, laden swallows and show tunes sung from crosses.)
I've been meaning to 'take a look' at python for the better part of a decade, but never had a big enough incentive to push me into doing so. In one of those weird instances of perfect timing, a good friend linked me to Alex Munroe's rant about PHP, unaware I was bracing myself for some soul destroying C++ spelunking. I read through it, nodding my head and agreeing with most of the points, and was ready to drink the koolaid by the time I got to the end.
What follows is my first ever python program; it's the result of (literally!) a couple days of learning the language. I'm definitely sold on Python; php was always, "Yeah, it's flawed, but what else is there, for quick scripts and web backends?" --- now, I know the answer is "Python."
This code is likely incredibly naive. There are almost certainly better/more elegant ways of accomplishing what I'm doing. However, for my purposes, all I needed was a way of being certain the stuff I was putting into Smereka could be liberated in the future, should I ever need to.
Thus, I'm simply extracting all the data (which, in my case, is text. Smereka also allows images, rich text, etc) and dumping it into a single file. It would be trivial to dump each record to its own file, or use the parent folder as a containing file, or whatever. Since the searching inside of Smereka works just fine, the only point for me was to be able to have something greppable, and zipped, 'just in case'. So, I'm not even bothering to grab the tags or descriptions, again which would be trivial. (Technical: I ignore the DataType: File, as well as the tags in StringsTbl.) I'm skipping error checking, or even politeness, like adding 'global var' to defs. (Obviously, I'm only reading...). I don't worry about memory management, or if it'd be better to create a table with folder names, rather than walk backwards each time... and, finally, I half-assed dealing with the unicode 'issues'. (Windows directory listings from over a decade ago have the obligatory broken bytes to make python kick up a UnicodeDecodeError.)
Note: This code was tested with Python 2.7.1+. YMMV.
#!/usr/bin/python # -*- coding: utf-8 -*- import sqlite3 as sql import sys import zlib import codecs DATABASE = "db.sqlite" DELIM = "\\" folders = {} titems = {} FQUERY = "SELECT ItemId, ParentId, KeyText FROM Items WHERE \ DataType = 'Folder|24A1B35E-B391-184F-12C3-FBB2A40B9B37'" DQUERY = "SELECT ItemId, ParentId, KeyText FROM Items WHERE \ DataType = 'Plain Text|49F238EA-38B0-1744-CD64-1947630FA367'" def traverse_tree(node, p): """traverse_tree - : Walks backward with the parentID until no : more parents are found. """ while node['parent'] != 0: p.append(node['keytext']+DELIM) node = folders[node['parent']] p.append(node['keytext']+DELIM) def debug_folderwalk(): """Debug function to verify tree iteration.""" for v in folders.values(): if v['parent'] == 0: print "DEBUG: Path: %s" % v['keytext'] + DELIM else: pathexpand = [] traverse_tree(v, pathexpand) print "DEBUG: Path: "+ "".join(reversed(pathexpand)) def debug_rawdata(d): """Debug function to show raw data from database""" for key, value in d.iteritems(): print "DEBUG: %s-%s" % (key, value) def path_parse(id): """path_parse - : Returns the folder tree in reverse : order of depth for the given item. """ if titems[id]['parent'] == 0: return DELIM else: pathexpand = [] traverse_tree(folders[titems[id]['parent']], pathexpand) return "".join(reversed(pathexpand)) def decorate(p, i, v): """decorate - : Decorates output for each text file : to make it clear which tree node this is, : as well as establing the start and end of item. """ t = "/* "+"*"*63+"\n" # top r = " "*3+"* " # right b = " "*3+"*"*63+" */\n" # bottom s = "\n/* "+"-"*63+" */\n" # eof marker return t+r+"Path: %s\n" % (p)+r+"Item: %s\n" % (i)+b+"%s" % (v)+s def populate_dict(c, q, d): """populate_dict - : Takes a cursor, query and dictionary, and populates : the dictionary with the results of the query. """ c.execute(q) while True: row = c.fetchone() if row == None: break d[row[0]] = dict({"parent":row[1], "keytext":row[2]}) byteswritten = 0 f = codecs.open("data", "wb", 'utf-8') with sql.connect(DATABASE) as con: cur = con.cursor() populate_dict(cur, FQUERY, folders) populate_dict(cur, DQUERY, titems) for item in titems: cur.execute("SELECT TheData FROM Blobs WHERE ItemId = ?", (item,)) cblob = cur.fetchone() zobj = zlib.decompressobj() dblob = unicode(zobj.decompress(cblob[0])[6:], 'utf-8') buf = decorate(path_parse(item), titems[item]['keytext'], dblob) f.write(buf) byteswritten += len(buf) f.close() print "Wrote {:,d} bytes from {:,d} item records.\n"\ .format(byteswritten, len(titems)) #debug_rawdata(folders) #debug_rawdata(titems) #debug_folderwalk()
Example output (ignore the cobwebs...):
/* *************************************************************** * Path: Equipment\APC Technical Information\ * Item: APC Backups BX1500G Original *************************************************************** */ Model: Back-UPS BX1500G Serial number: ------------ Firmware revision: 866.L4 .D USB firmware revision: L4 Result of last manual self-test: Not Recorded Last manual self-test date: Not Recorded Last battery replacement: 9/12/2010 /* --------------------------------------------------------------- */ /* *************************************************************** * Path: Equipment\APC Technical Information\ * Item: APC Backups BX1500G Replacement *************************************************************** */ Model: Back-UPS BX1500G Serial number: ----------- Firmware revision: 866.L5 .D USB firmware revision: L5 Result of last manual self-test: Not Recorded Last manual self-test date: Not Recorded Last battery replacement: 12/4/2010 /* --------------------------------------------------------------- */ /* *************************************************************** * Path: Scripts\ * Item: uudecode *************************************************************** */ grep -v ":\ " Alt.binaries.multimedia.repost | grep -v "From\ " | grep -v '^$' | uudecode -c /* --------------------------------------------------------------- */ /* *************************************************************** * Path: deprecated\linux_varg\rc\ * Item: linux_winmx_forward *************************************************************** */ ipmasqadm portfw -l prot localaddr rediraddr lport rport pcnt pref TCP xxxxxxxxxx.xxxxxxxx.dyndns.org xxxxxxxx.xxxxxxxx.dyndns.org 6699 6699 10 10 UDP xxxxxxxxxx.xxxxxxxx.dyndns.org xxxxxxxx.xxxxxxxx.dyndns.org 6257 6257 10 10 ipmasqadm portfw -a -P tcp -L 10.0.0.1 4000 -R 10.0.0.3 4000 iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 6699 -j DNAT --to 10.0.0.3:6699 iptables -t nat -A PREROUTING -p udp -i ppp0 --dport 6257 -j DNAT --to 10.0.0.3:6257 /* --------------------------------------------------------------- */
General References:
Smereka - "Extensible Personal Freeform Database and Personal Information Manager"
SQLite Database Browser - Very useful app to play with sqlite databases graphically.
Python References:
PHP - A Fractal of Bad Design - Wonderful php hate manifesto.
Why Python? - Advocacy post by Eric S. Raymond, from all the way back in 2000!
The Python Tutorial - Start Here.
Learn Python The Hard Way - More Beginner Python
SQLite Python Tutorial - Useful for the database bits.
All About Python and Unicode - A staggeringly helpful document.
Posted by
.greyproc
at
4:20:00 AM
0
comments
tags:
programming,
python,
script,
smereka
Links to this post
2012-03-21
Batch Straightening/Deskewing and Autocropping Scanned Images
Recently, I had the need to scan over 300 hand drawn "line art" pictures.
Vuescan's 'autocrop' is beyond worthless: it lacks the capability to properly crop where it should, resulting in me just scanning at 'maximum' and ending up with a mass of images flanked by black on all sides... and many of them, just slightly off center (some, more so than others, very noticeably skewed.)
For such a common task (take [x] amount of images, automatically do [y] and [z] to them), there seems to be precious little out there that'll do what I needed.
In my searching, Adobe Photoshop is fabled to have a batch 'Straighten and Crop' function. I don't have Photoshop, so I don't know if it does.
I DO have gimp, though, and got to the point of stopping just shy of copying a random script off the Internet into my plugins directory to try.
Prior to that, I verified:
- Irfanview couldn't do this in a batch,
- nor could Xnview,
- neither could Paintshop Pro 9
and based on google searches, both
- Windows Live Gallery,
- and Paint.net can't do it, either.
Many programs, of course, make it somewhat easy to select a given color, invert selection, crop to selection, and then slightly adjust the rotation. None (unless Photoshop's hype is correct) actually allow this to be done in a batch.
That brings us to ImageMagick (and not, sadly, its supposed faster cousin, GraphicsMagick, which vulgarly lacks its own deskew option.)
ImageMagick will happily let you batch what you want, and comes with the facility to autocrop and deskew.
Like all good opensource apps, though, ImageMagick's documentation leaves much to be desired: I never did figure out what the various percentages to deskew do (from a few tests, I couldn't see any difference between 1%, 40% (default), and 100%), or how to make the crop option for deskew actually work the way I wanted it to (ie, -set option:deskew:auto-crop [x]).
Also, in an effort to be as lazy as possible, I tried Fred Weinhaus' 'unrotate' script. Unfortunately, it was worse than junk; even after filling the black borders to be white, it still did the 'wrong thing' 100% of the time. Perhaps it's a version/configuration issue --- whatever the case, had it worked, it'd have been exactly what I needed. Since it didn't, I ended up with the following, which worked spectacularly well for me:
Some notes for my fellow IM noobs: The -background black is to fill the areas created with the -deskew option. By default, they're white. My initial (very naive) solution was to do this:
-fill black -floodfill +0+0 white -floodfill +0+90% white -floodfill +90%+1% white -floodfill +90%+98% white
which worked for all but 6 images in a batch of 142. The -fuzz 75% is for trim, and because the 'black' from around the image's sides is more of a 'mostly black with random coloured pixels thrown in'. I'm not positive the +repage is needed (again, ImageMagick's documentation is... lacking) but it seems like a good idea to make sure the canvas is resized when the image is (?). Also, for half my images, I needed to change from portrait to landscape orientation, which was easily accomplished with: -rotate 90.
Further note: mogrify, on my setup, seems to always ignore -path. After the batching of deskew/trim, I needed to up the DPI for publication: (tiff pixel reduction gave me 150dpi from 300dpi scans) mogrify -path jpg/ -units PixelsPerInch -resample 300 -format jpg *.png -> still results in the jpegs in the same directory.
Reference:
GIMP Plugin Registry - Deskew - Batch script in comments. (No auto-crop) - Didn't try this...
Fred Weinhaus' Unrotate Script - Tried this, couldn't get it to produce worthwhile results with any input I gave it.
ImageMagick Documentation - Some of the commandline parameters even work!
Scan Tailor - A neat, opensource program I ran across searching for a solution; it has an 'automatic batch mode', but unfortunately, its automatic deskew/content selection isn't really there yet. However, it is very useful for tweaking the few images too skewed for IM to properly handle.
Vuescan's 'autocrop' is beyond worthless: it lacks the capability to properly crop where it should, resulting in me just scanning at 'maximum' and ending up with a mass of images flanked by black on all sides... and many of them, just slightly off center (some, more so than others, very noticeably skewed.)
For such a common task (take [x] amount of images, automatically do [y] and [z] to them), there seems to be precious little out there that'll do what I needed.
In my searching, Adobe Photoshop is fabled to have a batch 'Straighten and Crop' function. I don't have Photoshop, so I don't know if it does.
I DO have gimp, though, and got to the point of stopping just shy of copying a random script off the Internet into my plugins directory to try.
Prior to that, I verified:
- Irfanview couldn't do this in a batch,
- nor could Xnview,
- neither could Paintshop Pro 9
and based on google searches, both
- Windows Live Gallery,
- and Paint.net can't do it, either.
Many programs, of course, make it somewhat easy to select a given color, invert selection, crop to selection, and then slightly adjust the rotation. None (unless Photoshop's hype is correct) actually allow this to be done in a batch.
That brings us to ImageMagick (and not, sadly, its supposed faster cousin, GraphicsMagick, which vulgarly lacks its own deskew option.)
ImageMagick will happily let you batch what you want, and comes with the facility to autocrop and deskew.
Like all good opensource apps, though, ImageMagick's documentation leaves much to be desired: I never did figure out what the various percentages to deskew do (from a few tests, I couldn't see any difference between 1%, 40% (default), and 100%), or how to make the crop option for deskew actually work the way I wanted it to (ie, -set option:deskew:auto-crop [x]).
Also, in an effort to be as lazy as possible, I tried Fred Weinhaus' 'unrotate' script. Unfortunately, it was worse than junk; even after filling the black borders to be white, it still did the 'wrong thing' 100% of the time. Perhaps it's a version/configuration issue --- whatever the case, had it worked, it'd have been exactly what I needed. Since it didn't, I ended up with the following, which worked spectacularly well for me:
for a in *.tif; do convert $a -set filename:f "%t" -background black -fuzz 75% -deskew 50% -trim +repage out/%[filename:f]_cropped.png; done;
Some notes for my fellow IM noobs: The -background black is to fill the areas created with the -deskew option. By default, they're white. My initial (very naive) solution was to do this:
-fill black -floodfill +0+0 white -floodfill +0+90% white -floodfill +90%+1% white -floodfill +90%+98% white
which worked for all but 6 images in a batch of 142. The -fuzz 75% is for trim, and because the 'black' from around the image's sides is more of a 'mostly black with random coloured pixels thrown in'. I'm not positive the +repage is needed (again, ImageMagick's documentation is... lacking) but it seems like a good idea to make sure the canvas is resized when the image is (?). Also, for half my images, I needed to change from portrait to landscape orientation, which was easily accomplished with: -rotate 90.
Further note: mogrify, on my setup, seems to always ignore -path. After the batching of deskew/trim, I needed to up the DPI for publication: (tiff pixel reduction gave me 150dpi from 300dpi scans) mogrify -path jpg/ -units PixelsPerInch -resample 300 -format jpg *.png -> still results in the jpegs in the same directory.
Reference:
GIMP Plugin Registry - Deskew - Batch script in comments. (No auto-crop) - Didn't try this...
Fred Weinhaus' Unrotate Script - Tried this, couldn't get it to produce worthwhile results with any input I gave it.
ImageMagick Documentation - Some of the commandline parameters even work!
Scan Tailor - A neat, opensource program I ran across searching for a solution; it has an 'automatic batch mode', but unfortunately, its automatic deskew/content selection isn't really there yet. However, it is very useful for tweaking the few images too skewed for IM to properly handle.
Posted by
.greyproc
at
4:20:00 AM
0
comments
tags:
applications,
deskew,
image processing,
imagemagick,
laziness,
linux,
rants,
scans,
script,
shell
Links to this post
2012-02-06
Virtual Peeping Tomery For Tomorrow's Skynet
The BBC News Article about the Trendnet camera security flaw, and presumably the blog it references engaged my curiosity enough for me to play with it a bit. Of course, having a large list of IPs to go through by hand is a bit lame. This blog has a nice method of aggregating, but is a bit heavier than what I wanted, which was just to see a single thumbnail for each exploitable camera.
In the end, I just used a list someone else did all the work in creating, and very messily modified someone's php code to do what I wanted. This is exceedingly ugly, but it works well enough; it hangs on a few cameras, but I didn't figure out why, since it ate through 600+ without too much problem. The generated thumbnails are viewable easily enough with xnview.
Please do your part in informing the folks running these cameras that they're paving the way for humanity to be enslaved by the machines: we won't even be able to find solace behind the counter at a coffee shoppe, clinged to by a cute barista, and certainly won't be able to sneak into the server rooms, due to these inconsiderate people. Based on the thumbnails I saw, not even remote ski resorts in the mountains will be safe from the omnipresent eyes of Skynet.
Damn you, Trendnet! Damn you, and your routers and little KVMs too!
My craptastic php script to iterate through a (hard coded file named urls.txt, containing one IP per line) list of Trendnet cameras and snag a thumbnail from each:
Reference:
In the end, I just used a list someone else did all the work in creating, and very messily modified someone's php code to do what I wanted. This is exceedingly ugly, but it works well enough; it hangs on a few cameras, but I didn't figure out why, since it ate through 600+ without too much problem. The generated thumbnails are viewable easily enough with xnview.
Please do your part in informing the folks running these cameras that they're paving the way for humanity to be enslaved by the machines: we won't even be able to find solace behind the counter at a coffee shoppe, clinged to by a cute barista, and certainly won't be able to sneak into the server rooms, due to these inconsiderate people. Based on the thumbnails I saw, not even remote ski resorts in the mountains will be safe from the omnipresent eyes of Skynet.
Damn you, Trendnet! Damn you, and your routers and little KVMs too!
My craptastic php script to iterate through a (hard coded file named urls.txt, containing one IP per line) list of Trendnet cameras and snag a thumbnail from each:
<?
ini_set('default_socket_timeout', 5);
if (! $lines = @file("urls.txt"))
exit("ERROR: Url file not found.\n\n");
$urls_to_do = count($lines);
$progress = 0;
foreach($lines as $line) {
$readtimedout = false;
$parsed = parse_url($line);
$outputname = $parsed['host'] . ".jpg";
$boundary="\n--";
$tline = trim($line);
echo "Processing ( " . $progress . " of " . $urls_to_do . ") from " . $tline;
$f = @fopen($tline,"r") ;
if(!$f) {
$err = error_get_last();
echo "\nError: " . $err['message'] . "\n";
} else {
echo ".";
stream_set_timeout($f, 5);
stream_set_blocking($f, false);
$r = "";
echo ".";
while ( substr_count($r,"Content-Length") != 2 && (strlen($r) < 128000)) {
$r.=@fread($f,512);
if ( ! $r ) {
echo "\n\tError: Read 0 bytes from URL. Passing on this one.\n";
$readtimedout = true;
break;
}
}
if (! $readtimedout ) {
$start = strpos($r,'ÿ');
$end = strpos($r,$boundary,$start)-1;
$frame = substr("$r",$start,$end - $start);
echo ".";
if (! $imgout = @fopen($outputname, "w"))
exit("\nERROR: Couldn't open file for output.\n");
echo "\nDebug: (probably) wrote " . fwrite($imgout, $frame) . " bytes to file.\n";
fclose($imgout);
fclose($f);
}
}
$progress++;
}
?>
Reference:
Posted by
.greyproc
at
4:20:00 AM
0
comments
tags:
camera,
exploit,
I for one welcome our machine overlords,
linux,
php,
programming,
script,
skynet,
trendnet,
voyeurism,
vulnerability
Links to this post
2012-02-01
Making WMP Keep Its Hooks Off My Disc
Windows 7, x64: For some reason with my settings, Windows Media Player insists on handling a double click on the DVD drive. The behavior I want, is to be able to manually manipulate files under VIDEO_TS. What I definitely don't want is WMP taking its sweet time loading and trying to play the DVD. (And I don't want to have to remember to right-click each time and go to Open... especially since WMP is only still installed for those rare times when using it is necessary.)
I was befuddled, of course, since Autorun/Autoplay is disabled, as is Shell Hardware Detection. Turns out, WMP integrates itself as the handler for the drive:
HKEY_CLASSES_ROOT\DVD\shell\play\command
which has:
"%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" /prefetch:4 /device:DVD "%L"
While that whole key can be deleted, the elegant solution is to just go to:
HKEY_CLASSES_ROOT\DVD\shell and change 'Default' there from 'Play' to 'Open'.
I was befuddled, of course, since Autorun/Autoplay is disabled, as is Shell Hardware Detection. Turns out, WMP integrates itself as the handler for the drive:
HKEY_CLASSES_ROOT\DVD\shell\play\command
which has:
"%ProgramFiles(x86)%\Windows Media Player\wmplayer.exe" /prefetch:4 /device:DVD "%L"
While that whole key can be deleted, the elegant solution is to just go to:
HKEY_CLASSES_ROOT\DVD\shell and change 'Default' there from 'Play' to 'Open'.
Posted by
.greyproc
at
4:20:00 AM
0
comments
tags:
dvd drive,
retardation,
stupidity,
W7,
Windows
Links to this post
Subscribe to:
Posts (Atom)


