One command ftp with error reporting

In the previous post I’ve wrote a one line ftp control using expect. It looked pretty good and it worked. Then I stumbled upon curl … and I had to rewrite the script. With curl the entire script could be made much simpler and faster. Here it is:


#!/bin/bash
#
# Curl array ftp wrapper
#
# ftp to/from <system> as user ftp

verbose=0

usage() {
    echo "Transfer files using ftp"
    echo "usage: `basename $0` [-v] get <system> <remote file> <local file>"
    echo "       `basename $0` [-v] put <system> <local file> <remote file>"
    exit 1
}

if [ "$1" == "-h" -o "$1" == "-?" ]; then
    usage
    exit 1
fi

if [ "$1" == "-v" ]; then
    verbose=1
fi

num_arg=`expr $# - $verbose`
if [ $num_arg != 4 ]; then
    usage
fi

args=("$@")
cmd=${args[`expr $verbose + 0`]}
target=${args[`expr $verbose + 1`]}
file1=${args[`expr $verbose + 2`]}
file2=${args[`expr $verbose + 3`]}

if [ "$cmd" != "get" ] && [ "$cmd" != "put" ]; then
    echo "Invalid command '$cmd'"
    usage
fi
if [ "$cmd" == "put" ] && [ ! -e $file1 ]; then
    echo "Source file $file1 doesn't exist"
    exit 1
fi

# set the verbose variable
curl_verbose="-s"
if [ $verbose == 1 ]; then
    curl_verbose="-v"
fi

if [ $cmd == "get" ]; then
    if [ $verbose == 1 ]; then
        echo "Copying file from $target:$file1 to $file2"
    fi

    curl $curl_verbose ftp://$target/$file1 --user ftp:ftp -o $file2

else
    if [ $cmd == "put" ]; then
        if [ $verbose == 1 ]; then
            echo "Copying file from $file1 to ftp://$target/$file2"
        fi

        curl $curl_verbose -T $file1 ftp://$target/$file2 --user ftp:ftp

    else
        echo "Invalid command"
        if [ $verbose == 1 ]; then
            usage
        fi
        exit 1
    fi
fi


References:

Posted in Computers, Linux | Tagged , | Leave a comment

Expect ftp with error reporting

I had a problem that required automating access to the ftp file transfer. This could be resolved with a simple expect script. There are many expect scripts on the net. However, they are all seem to be overly optimistic with the results. I wanted a script that could handle different errors that could occur during ftp operation. So I wrote my own (or improved someone else’s script). Here it is. Any constructive comments are welcome.


 #!/usr/bin/expect
 #
 # Expect ftp wrapper
 #
 # ftp to/from system as user ftp

 set timeout 10
 set verbose 0
 proc usage {} {
     puts "Transfer files using ftp"
     puts "usage: eftp [-v] get <system> <remote file> <local file>
     puts "       eftp [-v] put <system> <local file> <remote file>
     exit 1
 }

 if {[lindex $argv 0] == "-h" || [lindex $argv 0] == "-?"} {
     usage
 }
 if {[lindex $argv 0] == "-v"} {
     set verbose 1
 }

 set num_arg [expr [llength $argv] - $verbose]
 if {$num_arg != 4} {
     usage
 }

 set cmd     [lindex $argv [expr $verbose + 0]]
 set target  [lindex $argv [expr $verbose + 1]]
 set file1   [lindex $argv [expr $verbose + 2]]
 set file2   [lindex $argv [expr $verbose + 3]]
 
 if {$cmd != "get" && $cmd != "put"} {
     puts "Invalid command"
     usage
 }
 if {$cmd == "put" && ![file exists $file1]} {
     puts "Source file $file1 doesn't exist"
     exit 1
 }

 exp_log_user 0
 if {$cmd == "get"} {
     if {$verbose} {puts "Copying file from $target:$file1 to $file2"}
 } else {
     if {$cmd == "put"} {
         if {$verbose} {puts "Copying file from $file1 to $target:$file2"}
     } else {
         puts "Invalid command"
         if {$verbose} { usage }
         exit 1
     }
 }

 set ftp_result 0
 spawn ftp $target
 set timeout 2
 expect {
     "Name ($target:admin):" {
     }
     timeout {
         puts "Error connecting to $target"
         exit 1
     }
 }
 send -- "ftp\r"
 expect "Password:"
 send -- "ftp\r"        # change to your password
 expect "ftp> "
 send -- "binary\r"
 expect "ftp> "
 send -- "prompt\r"
 expect "ftp> "
 set timeout 40

 send "$cmd $file1 $file2 \r"
 expect {
     "227 Entering Passive Mode" {
         if {$verbose} { puts "Start transfer" }
     }
     "local: $file1: No such file or directory" {
         puts "Local file $file1 is missing"
         set ftp_result 1
     }
     timeout {
         puts "timeout on start"
         set ftp_result 1
     }
 }

 expect {
     "150 Opening BINARY mode data connection" {
     }
     -re {(\d+\s)(.*\n)} {
         puts "ftp error occurred: '$expect_out(1,string) [string trim $expect_out(2,string)]'"
         set ftp_result 1
     }
     timeout {
         #puts "timeout2"
         set ftp_result 1
     }
 }

 if {0 == $ftp_result} {
     expect {
          "226 Transfer complete." {
              if {$verbose} { puts "Transfer complete" }
          }
          timeout {
              #puts "timeout2"
              set ftp_result 1
          }
     }
 }

 expect "ftp> "
 send "quit\r"
 expect "Goodbye."

 exp_wait
 if {$verbose} { puts "Result $ftp_result" }
 exit  $ftp_result

Posted in Computers, Linux | Tagged , | 1 Comment

Canadian Rockies. Sept 2014

Prologue

One more Labor Day week-long trip that I had to plan. Last year’s one to North Cascades was great. This year I wanted to do something easier. Well, not that I wanted, but I wanted to bring Rita and thus the trip should be easier. Two ideas were in the running:

  1. Driving around Vancouver Island. In my trip to WCT I found that there are many lovely places on Vancouver. Nothing much there – mostly wet nature and fish (wild salmon). The actual salmon fishing is a bit expensive (~$1000 per day), but I thought that we could just buy the fish, if necessary.
  2. Canoeing in boundary waters. This would be a trip similar to the trip to Algonquin, just in US. I went to Google maps and searched for outfitters in the area. An outfitter would supply the necessary gear and sometimes housing. I found a lovely place called Tuscarora Lodge way in the boonies. They seemed the nicest to me (not trip pedaling and the website had all the info I was interested in).

We settled on the second one. Mostly because Rita said that we never went to the East side. Then I was feeling bad that the rest of the group (the cool kids) were going to Canada. At some point I’ve gotten sad and asked the leader of the Canadian trip if he had any spots and he did. That’s how we ended up going to Canadian Rockies and Kootenay NP in particular. The plan was simple: we fly to Calgary on Saturday, then do the famous Rockwall Trail for 5 days, then do some day hiking in Canadian Rockies for a couple of days and go home on Sunday.

Saturday, Aug 30

We missed the train. By 2 minutes! I could see it going off the station. How sad. That wasn’t an insanely early train – 7:10AM. I just thought it was leaving at 7:15AM. I probably misread the station. For the future reference – at least 10 minutes lead time before train schedule. Then we had to wait for the next train which was coming in an hour. Its time was cutting very close. I should have just picked a taxi right away instead of wasting one hour waiting. I tried calling a couple of local companies, but they had operators that couldn’t speak English at all. So we barely made it to the busy airport a bit more than an hour before the flight by skipping the last BART section by using a taxi. Since stingy United didn’t put enough people by the time we reached the counter it was too late for them check us in. Then we had to go to the first class line and be put on stand-by list for the next flight at 1PM. We should have flown Southwest from SJC. Luckily there was room on the next flight and we gotten to Calgary at reasonable 4PM.

One note about the plane we flown in – Canada Regional Jet 700. It was a relatively small 4 row airplane. When it left San Francisco with its stable weather it was fine. When it was flying high above clouds it was fine too. Once it went into the cloud layer – it started shaking like an autumn leaf in the wind. There were probably some areas of low pressure inside the cloud layer. As a result, the plane would sometimes just drop unexpectedly, which was rather scary.

After the usual long hassle with the rental cars we finally headed out to Banff. The drive was nice. Mostly due to the lovely green pastures around.

The mountains came up suddenly – there was all green farmland around, then they just sprung up. And very close to Calgary proper, just about an hour. Then we drove to Banff and the humongous Tunnel Mt Village campground. I have to admin that Canadians have nice campgrounds – free hot showers, hot water and soap in the toilet. Other than that the campground was fairly standard.

After setting up tents we went to Banff town for some dinner. It was a bit after 9PM and the only place open was The Old Spaghetti Factory.  It is easy to choose when there is no choice. I’ve had some honey based beer and spaghetti with seafood. Good enough.

Sunday, Aug 31

Our first night in the Rockies. Woo hoo. It was a bit chilly, but manageable. The tent, though, got loaded with dew. There was some packing in the camp and especially chasing around a very persistent small squirrel. Rockies_2014_021 I had to run after him all the time otherwise he would steal any food left unattended. After packing we went to Second Cup coffee shop for some breakfast before the road.

The town of Banff was very busy with tourists in the morning. The weather was good – warm and sunny – and people were going about their respective plans for the day, whatever touristy activity they could handle this day. Banff looked like any other outdoors gateway town – like Aspen or even Pucon. One can stay in a nice hotel, do some nature stuff during the day, and return to their stake in the evening. Not much different from any other amusement park.

For the Rockwall Trail we had to do a car shuttle. We left Valerie’s car at the finish and drove the other two to the starting point. Canadian parks have very nice clean trailhead parking lots, not paved, but outfitted with good toilets and maps. There were a lot of day hiking possibilities in Kootenay starting from many small parking lots along Icefields Parkway.

Rockies_2014_043

Start Group Photo

Finally, the hike started. The weather was good – a bit cloudy, not too hot or cold. Just how I like it. We crossed a very azure Vermillion river and started up the trail. The forest burned out several years ago and was all green and new for young pine trees and wild flowers. The trail was simple – just cut on the side of a mountain. We could still hear the busy highway, but it was going more and more soft the further we went. There were beautiful clouds rolling over the sharp sedimentary peaks. Interestingly there were these mountain slopes empty of trees where avalanches went down. They looked like ski slopes at a ski resort.

We met some people coming down from Floe Lake our destination of the day. They said that the lake was pretty and that they also were snowed in the night before. Sweet. There was some dude that we sort of picked up at the trailhead. He was alone and was concerned or scared to do a hike to Floe lake by himself due to bears. So he joined our group – no bear in the right mind would want to mess with us. After the main climb started he joined some other group going back.

There was a pretty significant climb right before the lake – the lake itself was on a plateau above the main ravine. We had some brief rain shower but nothing major. As soon as it was done the weather turned back to sunny+cloudy, there was even rainbow. I like the changing weather. When it is always sunny it isn’t that fun. After the climb the campground was right around the corner.

Rockies_2014_110

View of the Floe Lake from the eating area

The campground was well-organized and maintained. It had several areas with nice flat beam lined spots to put tents on (then people won’t put their tents anywhere). It had a chicken wire lined outhouse (not sure why). There was a very luxurious bear cabinets (can’t even call them bear boxes). And there was eating area with tables and benches with a nice view of the lake. Can’t even call it backcountry camping really. What the campground didn’t have was the nature’s gifts like berries or mushrooms. I expected for some blueberries, but there were very little. There were some mushrooms, especially in that young pine forest, but they were mostly slippery jacks and some other weird ones I didn’t dare to pick up. We did our chores, cooked the food, stared at the lake, some even did some hula-hooping, and retired a bit after sunset, which was around 9PM.

Monday, Sept 1

Relatively lovely weather – a bit cold, but dry, there was even some sun. We had breakfast by the lake, even though we forgot to tell Val about it. There was even some therapy sessions. After all this the group started the ascent of the Numa Pass.

Rockies_2014_187

The group on Numa Pass

The ascent wasn’t very difficult – just walk. The trail was there. None of the snow cowered scree nonsense. The further up we went the more alpine the nature looked. Above the tree line it was only grass with a lot of plants that looked like carrots and some mushrooms.

Once we went over the pass the group really booked it down hill. With all this booking they missed a large group of mountain goats on the slope of the mountain. I suppose they succumb to a very common notion to push miles as opposed to enjoy the process. I do that too sometimes and have to remind myself to slow down, look around, and smell the air.

The other side of Numa Pass was much greener. It was a nice forest. There were no signs of a recent fire. There were some mushrooms – different types, but not much use. Not much berries though, which was sad. But the views from the trail were great. The Canadian park service didn’t believe in easy trail construction. Though the trail didn’t just run straight up the hill, they didn’t really do soft switchbacks either – something in-between. So with this nice trail and good crisp cloudy weather we were in Numa campground just a couple of hours after lunch.

Rockies_2014_231The campground had the same design as the Floe Lake one the day before – a toilet, several flat tent spots, and eating area far away with good number of bear cabinets. There was no lake, but a little river. The cooking area was across the river. We had time to set up, cook, do some hula-hooping, even had some campfire.

Besides our group there were other people at the site. One group of Canadians (with a very well-trained dog) and one group of Europeans on vacation. These Europeans were on their 7th day or something like that.

Tuesday, Sept 2

It started raining, not a lot but all the time. It was raining all night. The trees as usual would make the rain feel in the tent like it was a deluge. I didn’t want to get up and get out of the tent to all this wetness. I wasn’t looking forward to the wet rainfly, wet backpack, and heavy load. There was some talk the day before about turning back due to some faulty equipment and the coming inclement weather. But the direct route was close – there was some sort of notice at the eating area describing that the bridge on Vermillion river was out.

We huddled in the trees from the rain for breakfast. After some discussion the decision was made to go back. At least it was known what we were facing. Going forward was all unknown.

Rockies_2014_246

Rain pants, rain jacket, rain fly on the backpack, some people used ponchos. Rain everywhere. Rain was coming down relentlessly. It was a long hard slog up hill to the pass we just crossed the day before. No one really spoke, make jokes or something. People were just silently pushing up and up, wishing for this to be over, at least I was. It would be nice to look forward to a dry warm cabin or something, even a storm shelter would be sufficient. But that luxury wasn’t coming. To add to all the water, the further up we went the colder it became eventually turning into wet snow. What was it? Beginning of September? And the pass wasn’t that high.

We reached the Floe Lake after lunch. It was still raining. It actually sucked to go back. But the leader made the decision and group needs to stay together. Good thing that there was a ranger cabin at the campground. It was locked, but it had a pretty substantial porch – large enough for us to huddle together out of the rain. The rangers had some class – they built their cabin with a nice view of the Floe Lake and the mountains. A small reward for the hard work they were doing. The cabin had a thermometer. It showed temperature went down to 2˚C.

I’ve hanged the rope inside the porch in the futile attempt to dry something. Some of the plastic material things like rain flies or muddy gaiters dried. Closes – not at all. Just Rita’s feet were completely wet. Her GoreTex boots as expected couldn’t hold that much rain. With the food and cold most of the booze were gone too. After that people just went to their respective tents trying to get warm. It was way early but what else could we do.

Wednesday, Sept 3

The rain seemed to have run out. There wasn’t much going on in the morning. We did the chores and in silence started on the way back. I don’t know about the others but I had this defeated feeling – we didn’t finish the planned route. But arguing with nature can have very detrimental consequences. You can have your plans, but the mountains can just say ‘no’ and there is nothing you can do. I mean – nothing you can do to change their mind. You can fight it, but at your own peril.

It was nice crisp weather. No sign of rain. The mountains above were dusted with fresh snow. There were some signs of bear activity on the trail (droppings and steps), but that was about it. We didn’t have any more wildlife sightings. Rockies_2014_318 The group made a good progress going downhill. By the time we reached the trailhead it was sunny and warm. I managed to dry all my gear in the parking lot while the car shuttle was done. There was a forest service worker in the parking lot taking care of some maintenance. He said that he never change his plans due to weather – just wait and the weather can change. Oh well.

After everything was packed we went to Radium – a small touristy town with lovely hot springs. The town was on a plateau. There was a nice park service campground called Redstreak on the hill overlooking the town. From there through some lovely pines we could see the enormous lumber yard below. The campground wasn’t that cheap, but it had all the amenities including how shower. It was also almost empty.

After setting up tents we went to have some food. After some usual wavering we settled on Back Country Jack’s place. It had lots of meat, something like all you can eat chicken or something. Rockies_2014_321 I’ve ordered salad and Rita ordered ribs so we could share. The ribs were sweet from the sauce. I should have ask for them to be just salted and peppered like V did. But there wasn’t too much food, which was good. Those ribs looked big, but there were mostly bones. After the food we headed out to the hot springs.

The Radium Hot Springs belonged to the Canadian park service. As a result it wasn’t fancy and it wasn’t expensive. Passes were about $6. They also rented swimming suits, even the old style ones – classic, very cute ones. They looked like half wetsuits. The hot spring had one large heated pool and some smaller pools. There was also a lap pool, but no one was swimming there. The large hot pool had very nice borders. They were designed in the way that a person can lay his/her head on it comfortably and enjoy the water. The water, though, wasn’t very smelly. It was just warm.

After the hot refreshing soaking in water Suji was trying to get some ice cream. There was a specialized gelato place, but it was closed. We had to settle for a gas station products.

Thursday, Sept 4

Cold foggy early morning get up. No sign of rain. Even though the get up time was quite early I didn’t really sleep. Mostly because the giant lumber yard woke up even earlier and started doing some heavy machinery work generating quite a bit of industrial noise. We went down from the mountain plateau where Redstreak campground was situated to get the coffee fix from a small coffee shop Meet on the higher ground coffee shop. The started driving North on the Icefields Highway to see the sights.

Rockies_2014_382

Group Photo

The Icefields Highway represents the quintessential touristy destination. If allows people to see most of the natural beauty of Canadian Rockies, take the proper amount of travel photos and then retire at some nice place after that while fighting the crowds of tourists doing the same. We kind of went into the same mode, except for the hotel. Since we started a bit early we managed to see some of the places without too much fighting for parking spaces. But eventually the hordes of Asian tourists reached us too. There was a stop for some nasty looking lunch and continuation to Columbia Icefield. Well, not that I knew where we were going. I was just following the leader – it was all new to me anyway.

Wilcox Pass sits on the other side of Icefields Highway from Athabasca Glacier. The nature on it looks like alpine tundra though the altitude and latitude isn’t that high. The hike was relatively easy, aside from some blister fixing. Rockies_2014_451 But at some point it became very windy and cold, even snowing. We did make it to the pass and gotten some great views of what left of Athabasca Glacier and some local wildlife.

After that it was all driving all the way to the lovely town of Jasper. As I’ve said before we weren’t following crowds to their hotel. Instead we followed one very long line to the Whistlers campground. Seriously, the line to register was long and very slow moving. There was enough time to get out of the car and move around. Enough even to read the weather report – no rain, but very low night temperatures – down to -2˚C. Interestingly, the members of our car who visited this place before, were disagreeing on what they did and where last time they were here. How sad. They visited Rockies just a couple of year ago. This made one more reason for me to keep writing these trip reports.

The dinner food was in the town of Jasper, to go. By the time we set the camp and gotten to the town it was already 9PM. Still light, but most of the places were closing soon. There was one fancy game burger joint, but they had waiting like as far as the eye can see. I had to settle to some Americanized Chinese food. Mostly because Rita have chosen it and it was cheap and fast. I didn’t understand why she couldn’t tell the cook to make something authentic. The real Chinese food would be much better. Then there was a campfire, shared food, and drinks. But people didn’t really stay long because it gotten cold.

Friday, Sept 5

Following the established routine we went to Bear’s Paw Bakery in Jasper to get the breakfast. I don’t remember which of their pastries I gotten, but I do remember the coffee. I wanted something unusual and not a plain boring regular coffee. So I wisely ordered espresso macchiato, to go. It was probably very good, but I don’t need a caffeine fix – I need how liquid with milk to go with my pastry and there just wasn’t enough of that in a tiny cup of macchiato. I ate my humble pie and drank Rita’s coffee. I should remember the names for things I order. After that we started driving back to our friend Athabasca Glacier for some glacier hiking.

On the other side of Athabasca Glacier the Canadians built a new sparkling Icefield Center. It has nice views of the Athabasca Glacier, probably some information and activities, food of course. It must be nice to sit inside this center with some hot drink and watch the glacier (though the views are not as good as from Wilcox Pass) if the weather is horrible. But this particular day was blessed with great sunny weather. As a result, the entire group except for the two deserters who were unwilling or unable to go on the glacier went to do the glacier walk.

Rockies_2014_523

Preparation for Glacier Hike

The main parking lot for the glacier closeup was further from the main touristy thoroughfare. It was ol dusty remains of the glacier from long ago covered with dry glacier silt. There were people there to do the simple “view of the glacier” hike. The rest were going with some outfitter companies. Or there were these unique characters like us with their own equipment and skills (one hopes).

At the close encounter the Athabasca Glacier looked a lot larger than from the distance.Rockies_2014_556 It was the same case of no reference. There were some people participating in the glacier abuse activities that could be used as a reference, but they couldn’t really indicate the real scale of the glacier.

What was that glacier abuse thing? Somewhere roughly in the middle of the glacier someone created a relatively flat area. There there were a whole group of snow buses laboriously going over very steep moraine to get to that flat area. I suspect it would be difficult to effect that mass of ice which is Columbia Icefield. But aside from spewing horrible amounts of diesel soot this looks like a gondola down the Great Canyon. Seriously people – if you want to get glacier experience put on crampons and walk it. Which was what we did. The truth was that the park service put many signs about the dangers of playing on the glacier full of crevasses. Well, this was similar to signs in Yosemite and Grand Canyon. It was a National Park after all. But we were prepared.

We played around on the glacier for a bit. I even gotten one bottle of glacier water.Rockies_2014_570 On the way back it became a bit interesting. So usually if someone wants to get on the glacier he/she would have to go along with some of the guide companies that probably charge quite a bit for that. This was not Chile after all and thus the guides were experienced and the clients most probably had to sign a very thick stack of papers. Those aforementioned guide companies most likely had to cut some kind of deal with the Canadian park service. Seeing some people just going on the glacier on their own would cut their busyness, so say the least. As a result when we were going back there was a guided group coming up. V tried to select a route such that we won’t meet this group. But their guide kept changing and trying to meet us which he did. Then he started asking “who organized this trip”, “was it a led trip?”, etc. He was trying to probe if we were cutting into his business. Funny.

After the hike which finished in the afternoon we just had a couple of minutes to get some food at Icefield Center. I thought to get some soup and fruits. Then I changed my mind because there was no time to eat it and it was late already for the upcoming dinner. We gotten into a small quarrel with Rita who, as usual, couldn’t decide on a short notice. As a result we had to eat some bowl of Pho and fruits in the car. No exactly the best place considering that the car was very packed.

The final resting place for this day was Lake Louise Campground. There was also a line to register. However, the campground was not at all full. Perhaps all those people pulling these giant trailers made it seem that the line was long. It was a standard Canadian campground with free hot showers. What was interesting about it was the high electric fence going around it and electrified cattle guard on the entrance road. I suspect they have gotten tired of all the bears coming in and harassing the uninitiated tourists. Personally, I wouldn’t mind of seeing some wildlife.

Within a walking distance from the campground was a small shopping area. Regular stuff – gas station, small strip mall, a couple of restaurants, some sort of visitor’s center. We picked a people said new place across from the strip mall called Mountain Restaurant. Personally I didn’t care that much – I was still full with Pho and this area would be full of touristy food like that so-called Chinese food the day before. This place most likely had a Korean cook because it had Bulgogi on the menu. I’ve ordered some sort of blueberry burger for Rita and I to share and some local beer. That was quite enough.

On the way people people drive but Paresh and me walked. The campground was close, the weather was crisp, and the food just sat in my stomach and needed some digestion. Besides, there was not much to do anyway.Rockies_2014_590The walk was actually very short. On the way I managed to take a long exposure photo of the starry sky. Bu we also managed to get lost in that wast campground. The group set up a campfire and was talking by the time we came. It was a lovely evening. Just Rita asked me to take a shower. It was free anyway.

Saturday, Sept 6

The night was very cold despite the weather report promising +7˚C. In the early morning I’ve have gotten coffee (proper size this time) and two bobs – an egg sandwich in a bun – at a local coffee shop. Then we quickly headed to Lake Louise. Good thing we started early. It would become clear why on the way back. At least in the early morning we could get some reasonable parking spots.

Rockies_2014_604Lake Louise is a touristy spot with a nice hotel overlooking a beautiful glacier lake. The glacier is promptly melting with increasing speed. There were several hiking trails going around the lake and to the surrounding mountains. It was nice early in the morning – cold and not crowded.

The main trail lead to the Tea House. One of several. There were Europeans in the are who tried to establish a system similar to the one existing in Alps with Tea Houses, trails, and other mountain activities including skiing.

Eventually the trail just ended at a scree slope. Technically, it was possible to continue, but that was involving pure rather steep glacier travel – would have been fun if we had more time. For some reason the rest of the group went or stayed in the Tea House. I really like the trail end – slope with gorgeous view.Rockies_2014_668I could just sit there and enjoy the view. The weather was great – a bit warm and sunny. It was easy to see a lot of things. This sort of view usually makes you contemplate life’s bigger things.

On the way back to the car it became clear why we had to start early. Perhaps it was Saturday or just nice weather (I wonder how this place would be in rain or blizzard), but the main plaza between the hotel and the lake was just packed with people (V called it “meat market”). There was someone wedding taking place on the lawn in front of the hotel. It would be cool if the newlyweds jumped into the lake after giving their wows. But it would probably ruin their expensive garments – that wedding was probably cost a fortune. The entire parking lot was full with cars stretching down the road approaching the place. It looked familiar – like Mission Peak in good weather.

After that we did a pokien stop at moraine lake that was just as crowded. Beautiful lake, yes. But it all felt like Disneyland rather than a national park. That was the last touristy stop after which we went back to Banff for the last supper.

There wasn’t really any plan any more. Some people had an early flight and had to basically go to Calgary late at night. Two were staying in Banff for one more day. Rita and I were a bit in-between. We agreed to meet at 8PM again. Some people wanted to eat and some didn’t. Our small group ended up eating some Thai food over my objections. Thai food? Seriously? Couldn’t we find some Canadian stuff. I could get Thai food fine in Bay Area. Though to tell the truth I wasn’t sure what constituted Canadian food. Well, something that wasn’t available in Bay Area.

After the hasty dinner we congregated in local Starbucks hogging their WiFi, along with a bunch of other people. Thus the network performance was less than stellar. But we managed to book a hotel in Calgary. The town was actually closing. A bit after 9PM all that bogus gift shops (well, there was one good with genuine native American crafts) and restaurants were closing. By 10PM the town was deserted. There were some bars open dujing by the rowdy groups of youngsters going around, but that was it. Perhaps all the tourists retired to their lodges resting after a day of activities.

That was all. The car that was driving to the airport dropped me and Rita at our hotel in Calgary. The workers at the hotel were a bit surprised at this late arrival of the two dirty guests.

Sunday, Sept 7

Rockies_2014_702 Beautiful day in Calgary. I thought it was regular weather for early Autumn. I procured a city map from the hotel front desk and we went for a short walk around town to spend the half a day we had before the flight.

Calgary presented itself as a nice, flat, green town. Easily walkable. The main downtown had a couple of walking blocks. It was clean with some weird modern art installations. Isn’t it redundant – weird and modern? Most of modern art is weird. There was a tiny Chinatown. Really tiny – just a block or so of a mall. On one corner there were old women selling vegetables. Rita hassled for some goji berries with them.

She wanted to eat some Chinese food (again) and I wanted regular food. In the end we ended up with some bogus burgers in the airport waiting area. The bus ride from hotel to the airport was very simple. Strange that I so got used to California neighborhood views with their particular hot weather nature that the Northern climate, which should look the same as what I grew up with, always looks unusual to me. It sort of like Minsk, but not the same.

The airport US customs didn’t really present themselves in the best light. First they force you to wait at least 2 hours before the flight when you can start immigration processing. Then the man checking boarding passes didn’t wash his hands and left whatever he was eating on my passport. Then the immigration dude – the one who tells you to look at the camera – was also checking his phone all the time. Yes, I understand your job is boring, but perhaps you want to go work on the Mexican border. The rest of the trip home was uneventful. Aside from the extreme shaking of the same small airplane in the sky above Calgary.


Photos.

Posted in Travel, Trip Reports, Wilderness | Leave a comment

Southwest Utah Trip. May 2014

Prologue

Once again a three day weekend poised a question of place to visit. Rouge River was always my favorite, though perhaps it should be visited a couple of weeks earlier before the rafting flood. For some reason I’ve decided against it. Instead I’ve decided to visit the South West corner of Utah. That would involve mostly Zion NP and Buckskin Gulch, in addition to some driving around and seeing sights.

Friday, May 23

Leave for the airport in the afternoon. As much as possible I try to travel from San Jose Airport. Mostly because it is just a one stop away on CalTrain, but also because it is small which results in less hassle. I worked from home this day so that we could just start going to the airport quickly. We met Wei on the train station and went to our scheduled Southwest flight.

We have gotten to Las Vegas on time and without any losses (losing a backpack would certainly change the trip substantially). I generally allocate quite a bit of time for getting a rental car – the companies throw a ton of paperwork at you and try to up-sell all sorts of things, thus creating quite a line. This time I’ve rented from Alamo for some reason and there was no-one. We’ve gotten a car faster than all the people collected in the rental area, which was located a bit away from the main airport. That was a good surprise. Perhaps it was a company dependent because Thrifty had a line of people as far as the eye can see.

After getting a standard issue Chrysler mini van (red color) we were off to find some dinner food. For some reason Rita wanted ramen. The place she found only served meat related stuff. Even a so-called vegetarian ramen was based on meat soup. Thus Parul felt quite excluded. Then there was a very long drive to Jacob Lake though the night. The crew was sleeping and I was driving. Cursing myself along the way for picking such a far away place. Kanab would have served fine. Well, I’ve read a couple of bad reviews about the two RV ‘resorts’ they had there so I wanted to find a nicer place. Plus it would have made driving on Monday more interesting (little did I know).

Saturday, May 24

The first item on my plan for this day was to visit Buckskin Gulch. However, that depended on the current weather. Mostly the possibility of rain and as a result a flush flood. We could have gone to the visitor’s center in Kanab, UT and inquire about it. The aforementioned visitor’s center was right on the way to either Zion or Buckskin Gulch. Originally, I did check that there was a bakery on the Jacob Lake Inn. That was a nice touch. We could have just got up, eat and be ready to go in 30 min. I thought it would be like Starbucks or something – ready to go baked goods and coffee. What I didn’t realize was that this place was the only place to eat for many miles. Thus there was no need for people running it to make any effort whatsoever to provide fast service. So we had to sit down, get water, stare at the menus, order the regular breakfast stuff, wait for food, eat, etc. All total 90 minutes. Perhaps it would be good for a slow relaxing trip. But late start turns into crowds and related problems.

The visitor’s center in Kanab was an interesting place. It could provide a lot of helpful information about the things that could be done in the vast South Utah desert. But the main thing was that it was handing out permits for The Wave, assuming you won the lottery of course. Thus there were these hordes of visitors who couldn’t figure out why they just couldn’t go see it. “No, you cannot come. Why? I’m just one person. Because the group permit is 6 people and the permit is given for a group …“. The people working in this visitor’s center must have a lot of patience. And what is so special about The Wave anyway? Yes, it is an interesting rock formation. But it requires a 3 mile slog to it, that is not including all the fight for permits. Buckskin Gulch is much more impressive and it’s free. But I digress.

It turned out that the weather could be raining and thus making visiting a narrow slot canyon a bit dangerous. So we went to Zion, which was in close proximity. Zion National Park was crowded. We drove from the East through that very long tunnel after waiting in line for our one way turn. I guess NPS stopped the two way traffic to accommodate all that giant RVs and rookies driving them. Trying to find some parking we quickly skipped to the town of Springdale, UT. Found one spot there. I wonder how the residents of Springdale handle all the hordes of tourists that flood their town every year. But, on the other hand, they bring quite a bit of money also. The park is well organized in terms of transportation. In reality, there is just one main road there. There is a free shuttle going around. The driver would provide some interesting information about the park with some route info about the stops. There were really two “doable” interesting hikes in the time we had (it was already passed noon) – angels landing (5 miles) and observation point (8 miles). Obviously I’ve picked the later.

DSC_2520

The View from Observation Point

In reality Zion is one giant canyon curved in the sandstone by Virgin river. Thus all the interesting hikes just go out from the canyon to the rim requiring a couple of thousand feet climb. Once the group started I had to leave Rita behind to do hike at her own pace. The trail was going through some interesting sandstone formations. There was even a short slot canyon. The color of the layers was slowly getting lighter. Eventually we made it to the top with great view of the Zion river valley and Angels Landing. We had lunch, sometimes feeding the begging chipmunks. Right when we started heading down we met Rita! Apparently she can hike much better on her own without me kicking her butt.

After the observation point we went all the way to the end of The Narrows. I wanted to show the group how this slot canyon look like. The water level was a lot lower than the last time I saw it. On the way we saw this family of ravens that built their nest in small eddy hole in the wall. They were noisily tending their little ones. By the time we reached the car on the last crowded bus it was already dark. People were hungry but driving to Kanab would take quite a bit of time. Aside from the fact that everything could be closed by the time we get there. However, Springdale offered some food choices. There was a decent steak house right outside the park entrance called Zion Canyon Brewing Company, or maybe we were just tired and hungry.

Sunday, May 25

The original plan for this day was to visit Zion. But now it had to be adjusted. We visited it yesterday, so today would be the visit to Buckskin Gulch. I’ve learned my lesson from the day before about the local food services and, thus, as soon as the group was ready we went off to Kanab. Well, I wanted to be safe. The ranger there, however, said that there was some tini-bini chance of rain maybe and so on. A typical avoidance of responsibility. That was a bit discouraging. I’ve picked up some information and we went off to look for breakfast. For some reason we found another “relaxed” place. Could have just gone to McDonald’s. However, that slow breakfast gave me time to think things over. There was a ranger station on US89. I figured that the people there could have a better idea about the current conditions in Buckskin.

That was correct. The office was very interesting. It looked lonely, remote, and dusty in the middle of the vast Utah desert. The guy there looked like an old weathered wolf. He said that the conditions were great. And that I (mostly I) should let go and stop running stressed and just enjoy the nature. No need to run around on tight schedule doing all that mileage. It seemed that he reached some level of wisdom. DSC_2617 After all that encouragement we went to do the actual hike.

It turned out that the parking lot for The Wave is the same as for Buckskin Gulch. I didn’t know that. Two Chinese girls who probably won the lottery asked me right at the turn from US89 and if not for Sasha’a help I would have sent them very far away.

The parking lot was busy, pretty much fool. Forest service was charging all humans and dogs. Cats or elephants were fine. Some people stayed there in their RVs. Probably not a bad place to camp, especially if you don’t have to carry all the food and water. The weather was nicely cloudy and cool.

We went through the initial very narrow but not deep slot canyon. Then to the large opening, more canyon, some junction, etc. At some point it all started looking a bit the same. At some point we left Rita to enjoy her solitary view of some rock face and continue. It was getting sunny and a bit hot. There were some people in the canyon though obviously they were thinning out the further away from the trailhead we were.

Unlike my old impression the canyon wasn’t really flat all the time. There were boulders, some rock piles, and sand dunes in places. It probably was constantly being changed by the periodic flush floods. DSC_2655 Walking on sand could get quite tedious at times. Only Sasha with his bare feet probably enjoyed it. Even I tried it, but at some point I’ve gotten tired of carefully watching for small rocks.

We reached the car at a reasonable evening time. At least it was still light. This day, I thought, we could have a normal car camping experience with campfire and some sausage frying. We found one reasonable reviewed restaurant in Kanab. It seemed to have been the only interesting place around and thus it was packed. The place was some sort of Italian fare. They even had bison steaks (for nice price of $40). Interestingly, they had some sort of art gallery on the second floor. After all the wait, and then eating we again ended up in our unwisely chosen campground way passed good time.

Monday, May 26

My original plan was to go drive around Arizona, see the Horseshoe Bend and go back. That was the reason I picked the camping site on Jacob Lake in the first place – it was a bit part way to the Horseshoe Bend. But, as always, I’ve missed to check all the details. We started with the regular breakfast thing in the same Jacob Lake Inn. Not sure why. I’ve been quite unhappy about the speed of their service. Sitting at the bar didn’t make much difference. Eventually we rolled out down the highway 89A. It didn’t look like the crew was actually enjoying the ride as much as I did. There were vast views of red rocks and buttes. We stopped at the new bridge over Colorado river for some photos. This was where I found that the highway is closed for construction around Page and that we won’t be able to get to Horseshoe Bend this way. The only possible route was to go back to Kanab and around that way. That was really depressing – not only did this Jakob Lake campground cost us at least an hour each day, it also cost us the visit to Horseshoe Bend. That was extremely disappointing. So that was the end of the trip. We slowly slogged to Las Vegas oven barely making to the flights due to heavy traffic. Then flew back without any events.

Continue reading

Posted in Travel, Trip Reports | Tagged , , | Leave a comment

Modern C++: What you need to know (talk by Herb Sutter)

Interesting presentation by Herb Sutter on the modern C++.

The video won’t play very well on this page, so grab it from here. There are different formats and slides available for download.

Strangely enough he spends considerable amount of time explaining the use of the prefetcher and performance benefits it can provide. It is very useful, but, in my humble opinion, isn’t exactly related to the topic of the presentation.


 

Posted in C++ | Tagged , | Leave a comment

Pine Ridge. Ventana Wilderness. April 2014

Prologue

One more trip to our local wilderness place. I lead a trip there pretty much exactly two years ago. We visited Pine Valley that time. This time I thought of doing something different. Then, as usual, I just pointed a place on the map and decided to got there. It was Pine Ridge camp this time. In retrospect, it was a good idea – Pine Valley is nice when the weather is warm because then it is possible to swim there. It wasn’t warm at all this weekend, so the views from Pine Ridge were just fine. Since the map doesn’t have the mileage I only had some guesstimate, but it looked under 10 miles one way.

I’ve posted this trip for the weekend one week before. But it was going to be raining quite a bit, so I postponed it. Eventually a group of eight people collected.

Saturday, April 5, 2014

I like the Big Sur trips. Mostly because we can start early Saturday morning; not insanely 4AM early, but still at good time. However, we can still get going on the trip at the reasonable time. I also like to stop somewhere on the way to get good breakfast, mostly at some bakery, they are usually open early.

We started at 7AM from Sunnyvale. Three cars total so I had to find a place to meet and regroup. I was a bit tricky but I found an interesting Mexican bakery in Salinas, CA called La Plaza Bakery. It had big assortment of the pastries and Mexican food. It just didn’t have tough meat.

After the good breakfast the group collected together and proceeded to the starting point. I knew where it was – some old abandoned (perhaps) campground called China Camp. I also knew that the road was very beat up. I just forgot how beat up it was – long driving on gravel road in urgent need of repairs. The most surprising art was snow! Really, really snow. Not everywhere, just in some shaded areas. Weird. I did not expect that. Yes, there were some rains and the nights were a bit cold, but I thought it was warm enough during the day to melt everything. Apparently not. We quickly got our gear and started. There were cars on the trailhead, but not that many.

DSC_2198

The ‘before’ picture

The trail proceeded as expected without any events till the lovely lunch spot which is located in this tree shaded saddle at the crossing of different trails. It was possible to see some snow on the far away mountains. I guess this forests didn’t really wake up yet from winter. It seemed like it was just getting ready to bloom. It would probably be very lovely in a couple of weeks.

After lunch the fun part started. Mostly due to the fact that I had no idea how the trail would look. It was fine up to the junction with some unnamed trail, which was leading to Pine Valley. After that the trail was quite overgrown. However, there were new trail signs so some group was working on these trails. Perhaps they just didn’t get to clearing all of them. Well, one step at a time.

DSC_2235

Snow on the trail

There was snow on the trail, in some places. The snow was strange. It wasn’t that packed concrete that fills the Sierras after many freeze-thaw cycles. This snow was slushy like it just recently fell and the weather was warm. Strange.

The trail it this point was visible, in a strange way. It looked like this long thin cut on the body of the ridge. At least it wasn’t going up and down all the time. We did have to bushes or crawl over trees all the time. Why is it so bad? It is a lot more fun than some well maintained trail that feels like a walk in a park. Well, raw bushwhacking isn’t fun either, but there still should be some difficulty.

We reached the junction in another saddle with the Bear Basin. The Pine Ridge campsite was quite close after that. There was a very tiny easy to miss metal sign pointing to it. Then after some more bushwhacking I found it.

The cam site was great. The view of the ocean was obscured a bit, but other than that it was perfect. There was a running spring (coming out of a pipe). Someone left a large metal box there, locked from sides by two sliding padlocks. I’m not sure if anyone still remembers where the keys were. I suspect the box was for the food storage away from the local creators. But now the locks were rusted (and shot at numerous times, someone really tried opening it) so it was just sitting there making a decent table. There was even a toilet, but I found it the next morning.

We made it to the campsite quite early. There was enough time to set up, sleep, even for some wilderness acupuncture.

DSC_2257

Wilderness Acupuncture

However, after the sun went down it became really cold. I mean big time cold. No wonder there was still snow on the ground. It wasn’t freezing cold, but for some reason I felt colder than two weeks before in the snow. Perhaps I was wearing more clothes. The good thing was the campfire. I’m not sure if it was allowed, however, I did make sure I put it out well and we only burned down wood. Fire is always nice when camping. It’s the wilderness TV.

Sunday, April 6, 2014

The night passed without any events. No one was eating my stuff this time. Maybe the rodents were still hibernating. Krishna and his friend wanted to finish early so they were up and all packed by 8AM or something. The rest, including me, were still eating, washing, packing, etc. But we got going eventually by 10AM.

The main Pine Ridge trail looked a bit different going back. Perhaps the light was different. We made it to the same lunch spot by about noon and then to the trailhead by 3PM or so. We just met one couple on the trail going back from Pine Valley. But there were several groups going to Pine Valley area.

After the ending everyone just left quickly. We stopped by on the was at one of the wineries. Either I was dehydrated and empty or their wine was not good at all, but it felt like the worst wine tasting I’ve had so far. Perhaps it isn’t a good idea to enjoy wine right after a trip. That time usually calls for good steak or a bowl of ramen.


Photos.

Pine Ridge trail

Posted in Travel, Trip Reports | Tagged , | Leave a comment

New Attempt at Vegetable Gardens

My old contraption completely disintegrated. I bought these plane simple boxes from Office Max or something. They were inexpensive. However, after a couple of years under the sun the plastic became completely brittle.

Enter EarthBox. I found it while searching for the new planting ideas. It claimed to be made from better UV resistant plastics. It also has a water reservoir under the layer of soil. It should keep the plants more hydrated and thus produce better results. There are many DIY EarthBox-like designs – essentially get two plastic boxes and some PVC pipes and you are done. But I figured that factoring work and the materials needing replacement in a couple of years I won’t save much.

I just planted two boxes – one with green onions and one with beets (seeds we gotten for free at the Gravenstein apple fair). Stay tuned for the results.

Posted in Gardening, Life notes | Tagged | Leave a comment