Bash Script to read in a big text file and do something with it
At the office I often end up producing little scripts to do this and that and today I had to deal with a large file that was causing a custom app to bork. In short it needed to be read to the app in chunks; usually I have to do more prosaic stuff, but this is a neat little foundational app to get things done.
I needed this today to solve a very basic problem, maybe you can use it too
#!/bin/bash declare -i RESET=0 declare -i TOTAL=0 declare -i LINES=$(cat $1 | wc -l) echo -n > somefile while read LINE ; do RESET=$RESET+1 if [ $RESET -lt 1000 ]; then echo $LINE >> somefile else RESET=0 somecommand -file somefile | mail -s "Output from somecommand" 2someguy@somewhere.koo echo -n > somefile TOTAL=$TOTAL+1000; fi declare -i REMAINS=$LINES-$TOTAL if [ $REMAINS -lt 0 ]; then tail -$REMAINS $1 > somefile somecommand -file somefile | mail -s "Final Run of somecomand" someguy@somewhere.kooo fi done < $1
Popularity: 1% [?]
Housecleaning and Housecleaning and housecleaning
Ah bloggy; it's been a dog's age.
When I'm doing nothing at home I think I'm wasting my time; and when I think I have spare time I waste it on podcasts and video games. I've passed up inspiration a couple of times recently simply because I didn't feel like committing more time to putting pen to pad (as it were).
Yesterday I moved my photography work off of www.nitemayr.com and over to photography.nitemayr.com hosted on my rack here in London; rather than leaving it in Virginia. That way my images stay on my hard drives; I should be doing a daily mirror of my site over to here too ... hmm. Maybe I'll set that up today.
As for housekeeping on the for reals; I still have to move a proper doorknob onto the Spawn's door (she has one but it doesn't close correctly and I have a "spare" knob in the basement that locks like a bathroom door which should give her the privacy a teenager deserves (when she IS a teen in a few months) and the ability to keep the dog out of her room which she needs.
Our plants are really out of control too. I cut a bunch of them back but I think I'll spend some of the coming weekend just cutting more and more of them back as they are blocking the AC and so on. This will be unpopular; c'est la vie. I had to cut down a bunch of roses this Saturday to make our front porch habitable; so I don't see any problem with just cutting back some greenery; it's not like there will be a shortage. I'll size it up this Saturday morning and get it done before noon I guess. Hmm, I need a better sprinkler too; I had better keep that in mind this week.
I think, save for a couple of patches where drainage is an issue; I have the back yard taking shape. There is grass on about 98% of it now; as opposed to about 95% at the beginning of the year when we had a massive bald mud patch under the big tree (where the squirrel house used to be, but no longer is). It took two runs with seed and coverings to get the grass to really take in the patch; especially with how shady it is. The front lawn however is dying, for lack of watering and just from being weak. I think I'll need to put way more into it in the spring. I'll seed it and cover it with straw before the first frost this fall and maybe I'll get lucky in the spring.
Who knows; maybe I'll finally get my hands on a ladder and get my damn eaves trough cleaned out before august?
Popularity: 1% [?]
Taking Care of the house
It was a good weekend to get out and see London and the surroundings, which is why I spent the weekend poking around the house and looking where I could fix things and so on.
I didn't really get much done, what with spending Friday and Saturday fretting over a customer and the Sunday wondering if my basement was filling with gas after I *finally* managed to find the controls for the gas fireplace. I get light-headed with worry when I think about it; gas flooding my basement and killing us all. That thing is a hazard I just want rid of. I'll keep the one in the living room upstairs; but the basement one has to go.
Hung a few photos, realized that I have to dig out more of them to hang.
Our Yellow Roses have come and are going, fuchsia ones are growing along the path and Champagne and White are on the way.
On the other hand; it was a nice weekend for the sun. I had to pass on a lawn mower, 75 bucks for a toro is fine, but I couldn't swing it. Maybe some other time.
Popularity: 1% [?]
When the mercury was hitting 80 I was in the yard
Spent a good deal of this weekend enjoying having a yard.
Watered and patched the front lawn a bit on Saturday; put down a ton of "shady blend" grass seed and covered it up with soil in hope that in about 2 weeks those bald patches will be covered in soft grass. Watered it all down and enjoyed the cool spray; it was already 75 in the shade by 10 AM Saturday and Sunday!
The back yard took a bit more, as the gardener (Jen) wouldn't leave her basement lair in the morning, so she ended up toiling in her dirt corner in the hot sun. I spent some of this time tearing down the squirrel house from the big tree out back. I've been spoiling to take it down since the day I noticed the squirrels in it; they alternated between it and our roof all winter and I'm tired of the the pitter patter of little feet, truth be told. So I pulled it down and found it full of three things; dirt, fur and BEES. GOD-DAMNED BEES!!! A whole colony of BEES!!! RUN AUGH! AHHH! BUZZZZ.
Yeah, I found a bee's nest in the thing as I tore it down and spent about 30 minutes trying to coax them into abandoning the furry confines they had built into. After poking and hoping failed, water and drowning appears to have won out. As they (thumb sized, no joke) bumble bees left the pile of fur and dirt for me to spread them over my new grass seeds on the south (shady) side of the yard.
Every time I go back there I see more crap that needs to be taken out of the yard and I get depressed at the sheer volume of stuff that needs to leave; the former owners left us with a literal ton of garbage and random bullcrap to clean up, not to mention a couple hundred dollars worth of basic repairs and painting to take on when we moved in.
Look; I love that when I wake up and look out my window I'm looking at my yard; but all the repairs (we still don't have a stove due to the broken glass there) and the garbage cut the sweetness pretty hard.
Yellow roses and fresh cherries aside.
Sunday was nice, more watering more relishing the spray. More beers in the heat of the evening. Pad Thai for supper.
Still...
Popularity: 1% [?]
Hey Hey, look who is having a nice April Fool’s
Without cheating, which one is London Ontario and Which is Eugene?
Popularity: 1% [?]
We’re moving
I've taken a few pictures of the place as it was left for us; not pictured the creative use of extension cords to provide power external structures and my shame at not getting a proper inspection
Popularity: 1% [?]
Even more good news
As if having 15 centimeters of snow on the ground wasn't enough for the new year:
Yup, even more of the White Death Bringer!
I've already had one friend end up in a ditch this Winter, what new fun can come from even more of this heavy cold crap?
Popularity: 1% [?]
At least try and say what the ruling actually says
When a large media owner tells you that a government regulation is bad, you had better be willing to at least say "you know what, you feel the need to give me a substandard service while maintaining a monopoly handed to you by the very agency you are asking me to speak against. I think I might not trust your word on this"
I received the following from Bell Canada:
Dear Customer,
Help stop your TV fees from increasing. CTV, Global and the CBC have recently asked the Canadian Radio-television and Telecommunications Commission (CRTC) to significantly increase TV taxes.
The CRTC has been asked to do this by having Bell and the other operators pay more, which would result in higher fees for you.
We don’t think that’s right, you shouldn’t either. So please speak and have your say.
This is what’s happening.
The CRTC has told satellite and cable companies to hand over $100 million a year as of September 1, 2009. These fees are being passed on to you.
This money is passing through something called the Local Programming Improvement Fund (LPIF) – straight to media giants like CTVglobemedia and Canwest Global, straight to the CBC.
No new local programming, no improvement to anything other than the bottom line of broadcasters.
You are now likely paying for this on your TV bill.
You should also know that hot on the heels of that campaign, CTV, Global and the CBC are now lobbying for even more.
Each year, satellite and cable companies pay hundreds of millions of dollars to broadcasters. We contribute to the CRTC’s operating budget. Although to date these fees have not been broken out on monthly bills, you need to know they exist – especially because the TV networks still want more.
If the CRTC gives in to the broadcasters’ latest demand and lets local TV stations charge for their currently free over-the-air local signals, it would more than double the portion of your Bell TV bill going to government fees – and into the bank accounts of the broadcasters, like CTV, Global and the CBC.
In fact, if the CRTC lets broadcasters have their way, then government-imposed fees will be just shy of one billion dollars.
I've also seen the ads Rogers has been placing in the stream on various channels; here's what the CRTC is proposing:
http://www.crtc.gc.ca/eng/news/releases/2009/r090706.htm
OTTAWA-GATINEAU —The Canadian Radio-television and Telecommunications Commission (CRTC) today announced that the Local Programming Improvement Fund will have over $100 million to distribute during the 2009–2010 broadcast year. The fund was created in October 2008 to support local television programming in markets with a population of less than 1 million.
"Canadians have made it abundantly clear that they value local programming," said Konrad von Finckenstein, Q.C., Chairman of the CRTC. "We have taken steps to ensure that broadcasters, and particularly those in smaller markets, continue to provide Canadians with programming that reflects their needs and interests."
As a temporary measure for the upcoming broadcast year, cable and satellite companies will contribute 1.5 per cent of their gross broadcasting revenues to the fund, an increase of 0.5 per cent. As a result, the total funds available will rise from $68 million to over $100 million. Television stations in smaller markets will be able to draw on these funds to maintain their spending on local news and other types of local programming. The Commission will consider the appropriate long-term provisions for the Local Programming Improvement Fund at a public hearing to be held this fall.
In addition, the Commission has harmonized its requirements for the broadcast of local programming in English- and French-language markets. Each week, local television stations will have to air a minimum number of hours of programming that is produced locally and that speaks to, and about, the community.
On May 15, the Commission renewed the licences of the major English-language networks for one year. At the same time, the licences of the TVA Group’s conventional television stations were renewed for two years. The specific licence terms and conditions for these stations were made public today.
Developing a new regulatory framework
The Commission today also launched a public proceeding to develop a new regulatory framework for conventional television broadcasters. The proceeding will include a public hearing starting on September 29, 2009, in Gatineau, Que.
“The rapid evolution of the communications industry is forcing everyone to rethink the model for conventional television broadcasters,” said Mr. von Finckenstein. “This fall, we will develop a new framework that will give broadcasting ownership groups the flexibility to adapt to this changing environment.”
“However, in exchange for greater flexibility, we expect broadcasters to make meaningful commitments regarding the production, acquisition and broadcast of high-quality Canadian programming,” added Mr. von Finckenstein.
Through this public proceeding, Canadians are invited to share their views on a number of specific questions related to:
* a proposed model to conduct future licence renewals on the basis of ownership groups rather than categories of television services
* the provision of revenue support for conventional broadcasters, including:
o the terms and conditions of the Local Programming Improvement Fund
o further safeguards to protect the integrity of Canadian broadcasters’ signals, and
o mechanisms for establishing, though negotiation, the fair market value of these signals
* possible models for the transition to digital television, and
* Canadian programming commitments by English-language television broadcasters.
Interested parties may submit their comments by August 10, 2009, by filling out the online form by writing to the Secretary General, CRTC, Ottawa, Ontario, K1A 0N2, or by fax at 819-994-0218.
Broadcasting Regulatory Policy CRTC 2009-406
Broadcasting Notice of Consultation CRTC 2009-411
Broadcasting Decision CRTC 2009-409 (Canwest)
Broadcasting Decision CRTC 2009-407 (CTV)
Broadcasting Decision CRTC 2009-408 (Rogers)
Broadcasting Decision CRTC 2009-410 (TVA)
Funnier still is the tagline from Rogers about "More American Programming" (this is the Rogers that brought us HBO Canada after all and gutted the local and charming City TV)
So yeah, the CRTC wants to pay for more locally produced TV (as locally produced TV is dying out in Ontario for sure) and the Cable and Satellite firms are going to charge you more because of it, so they can bring you what, less local TV? Is that what they are agitating for? It certainly seems like it.
Popularity: unranked [?]
Girl, I hope you’ve got lots of money at the DOG PARK, DOG PARK, DOG PARK!

We've had a dog for about 9 days now; Lucy the "Jug" or "Puggle" or "Jack Russel Mutant" something. She's about four months old and just getting the hang of asking to go out and not chewing on our hands for comfort. She's small enough to pick up and carry around, but large enough to not look a toy dog when she is out for a walk. Which brings us to the weekend, when we took her to the off-leash dog park off of Hamilton Road.
It's a nice park; lots of trees and open spaces. There's a small dog area, where (on Saturday) Lucy got a taste of real open freedom in the city, running around like crazy and chasing sticks. There's a a no toys rule in the park to avoid fights (smart) and a poop-scoop rule (smart, but a number of the dog owners seem to ignore it, more on this) the small dog area was deserted, so after a bit we took Lucy to the regular area so she could see other dogs. Good news, she behaves off of the leash in the large area, bad news every male dog that saw her wanted to hump her into a hole in the ground. It was cute when the tiny little black pug mutt wanted to, it stopped being funny when 5 or six dogs were trying.
So I picked her up, walked away and we took an off-leash walk through the woods and then out of the park, leashed up of course when we left.
The next day we skipped milling around with the other people and just went for a walk through the trees and grass. Lucy was great, walking with us and then coming when she lagged to sniff the plants. What a good dog.
We took her into the small dog area where some other small dogs were playing, but they just ended up chasing her around and trying to hump her. Oh well. We leashed her and walked her out to the big dog area where the largest dog at the park decided to try an arial full-speed mounting, repeatedly. The monster's owner didn't make any real attempt to stop "Kirby" from repeatedly making my little dog yelp in pain when his monster tried to run down and mount a puppy, it should come as no surprise that he had just let his dog drop a massive load in the trails just 10 minutes earlier while I watched. No scoop, not so much as a look over his shoulder.
Assholes come in all stripes.
I picked Lucy up and walked her away from the fracas and then let her down to walk out of the park.
She's none the worse for wear, but I'll keep her out of there until she is fixed and has had more time with other dogs in the small dog area.
Popularity: unranked [?]











October Chillin’
After a Summer that barely was, what could we expect of an Autumn that has just fell upon us?
Look at that, a ten degree miss on the "normal" target. I've borne the "Global Warming, what?" guffaws but at this point one has to wonder why it has been so cool this year? Is this a "La Nena" year or something? Is there a very cold breeze just hanging out over London? I was up in Kincardine a few weeks back and found it comfortable sweaty, now there is snow on the ground?
The weather this year (and really since last october 26th), has sucked, and there is nothing we can do about it.
Popularity: 1% [?]