Educating the world

Our blog has over 10,000 readers a month

Which is the latest version of yii-user

December 8th, 2013

The yii-user module was written by Mikhail Mangushev (who has the user name mishamx on various systems). The module is for user registration, login, re-sending passwords, reseting password etc.

The trouble is that there are several copies on the internet in various locations all claiming to be the latest version. Each one is followed by several years worth of comments asking for help as each version is unstable.

I tried contacting Mikhail but he never replied. I publish the email as an open letter incase he wants to comment.

Dear Mikhail,

Please can you tell me which source repository is the latest as there seems to be a lot of confusion.

Searching Google gets you too the yii-user page on the yii site:
http://www.yiiframework.com/extension/yii-user/

Clicking the click for the Home page takes you to:
http://yii-user.2mx.org/

This says the source is at:
http://code.google.com/p/yii-user/source/checkout
report bugs at:
http://code.google.com/p/yii-user/issues/list

However the "send bugfix" page on the yii site says point to the following location
https://github.com/mishamx/yii-user/pull/new/master
then disappears into a comparison page!

And everyone says that there is another set of sources on github.

People, including myself, are uncertain where the project is. Some bugs have been reported with google and others with github.
This confusion has lead to people downloading old versions and forums are full of wasted yii-user effort.

Please can you have a look at sorting out the documentation for where everything is.

But this doesn't help! So here is a list of the current versions and numbers from around the internet so that other people can save themselves literally hours of wasted effort.
I've gathered all the information and versions into his one place to try and sort out the mess.

From page: http://yii-user.2mx.org/
Points to: yii-user-0.3-r107 released on 16 Feb 2011.
Can be found at: https://code.google.com/p/yii-user/downloads/list

From page: http://www.yiiframework.com/extension/yii-user/
Points to yii-user-0.3-61-gfc69518 released on 12 Jun 2012

From page: https://code.google.com/p/yii-user/
Points to mishamx-yii-user-0.3-88-g7d748a0 released on unknown
As of 8 Dec 2013 this is the same as HEAD at https://github.com/mishamx/yii-user

So inspite of the version numbers apparently going backwards from 0.3.61 to 0.3r107. I think that 0.3.88 is the latest.

If anyone can confirm this as the latest, I think we'd all be very pleased to hear from you!

Just some notes that I found useful

  • Change config/console.php to use 127.0.0.1 instead of localhost. While they should be interchangeable there are certain situations like, running migration upgrades on the console, where it doesn't work. And it doesn't work in a not very easy to find way!
  • Unpack file into

    protected/modules/user

  • I found that the migration complained about dates and timezones, so I had to add

    date_default_timezone_set("Europe/London");

    to all the files in modules/user/migrations
  • Sit in document root and type:

    protected/yiic migrate --migrationPath=user.migrations

    to create the user tables.

Nepal Day 10 - Pokhara

October 14th, 2013

While at breakfast, the waiter came to clear our table and from out of nowhere 2 street urchins appeared and started hoovering up all the left overs. By the looks of things this was a regular occurrence. The waiter seemed to have dealt with these boys before and, because he was only going to throw the food away, he showed willing to remove them but actually let them help themselves.

Today was a free day so a lot of the other guests went for a massage conducted by blind people or deaf mutes. Disabled massages seem to be popular over here as a way to employ them. I decided to do a bit of shopping and get some North Face stuff.

Bumped into Mary and Babs who were going to go to the Gurkha museum after they called the bank. That sounded a lot more interesting than shopping so I asked if I could tag along. Natwest kept cancelling Mary’s credit cards in spite of her telling them she was coming to Nepal weeks ago. She spent half an hour on the phone and I spent the time in the internet cafe clearing my inbox and doing a few work tasks. They had a coffee while I finished up and joined them after.

We enquired about the best way to get to the Gurkha museum. Surprisingly, the simplest way is to get a taxi to the museum, get the taxi man to hang around for an hour outside then take us back. After a bit of haggling we agreed a price of 600rs (£6)!!!

The museum was great, I could have easily spent another 3 hours in there but we had agreed the time with the taxi man and didn’t want to pay any more. The museum charted how the Gurkha’s became associated with the British Army from defending the East India Company through to the modern day. There were a large number of citations of acts of valour and accounts of medal wins by Gurkha soldiers. On the 3rd floor there was an impressive collection of photographs and uniforms capturing the growing importance of the Gurkha regiment in the British Army.

Time was ticking and Babs and Mary had to get back for their massage. Babs knee cap had slipped off while getting off the elephants so I suggested to her that instead of suffering in silence, she get the holiday insurance people involved. When my ex-gf twisted her knee skiing the insurance company sorted out seats on the plane and wheelchairs through the airport. Pabi helped organise a doctor to come to the hotel and check her out. Insurance was called too and now Babs was much happier about the pending journey home. Jon took her place at the massage and I went for a wander with Ali.

Walked up the strip and tried on a few North Fake rain coats. The price seemed to be very changeable between shops but eventually I found one I liked. The shopkeeper told me it was a fake but assured me that it was made from off-cuts and similar materials. I didn’t believe a word of it but the jacket felt comfortable and I like the colour. Did a bit of haggling and I was quite pleased as I got it down from 2000rs to 1700rs.

It was beer o’clock so Ali and I followed the edge of the lake all the way around until we came to the boats crossing over to the island. We enquired about the fare and it was only 300rs for a return trip. It seemed okay, so we asked if we could get a drink when we were there. The ticket man said the only thing on the island was a temple. After an extremely short conversation with my Scottish companion, we decided that we had seen enough temples and beer o’clock was fast approaching.

We carried on following the lakes edge and came upon a river people-carrier. It was a cage on tires that transported 10 people 50 meters over to (another) island with a posh hotel on it. We found out that the 10 people limit actually meant 10 Americans so it wouldn’t cause offence. Americans were out of season so it was taking 20 “normal” people each way. The covered platform was powered by a man in the middle pulling a rope to drag it through the water.

While on the people-carrier, I got talking to a man who ran Guy’s Trust, a charity that was building a school in the local area. He had the help of Action Aid and that day they had been sourcing the bricks. The man said that Guy was his son who died in a par-ascending accident a couple of years ago. Ironically the previous conversation I had just had with Ali before getting on the platform was about how he had broken is back twice in par-ascending accidents and his doctor refused to help him if it happened again.

Ali and I sat in the outdoor hotel bar overlooking the lake. It was really nice apart from the tree above us was shedding its seeds so we had to put napkins over our drinks. Sat there for a bowl of chips and a natter. Over heard one of the ignorant guests saying that rape was just a case of a man scratching an itch. I was going to set him straight but the other members of his party beat me to it.

I was a little worried about being trapped on the island with the first hotel swimming pool we had come across but the waiter assured me it was a 24-hour crossing service. Finished up and meandered back to the hotel.

In the evening we went to a restaurant which had some traditional Indian dancing going on. The downstairs was full so we were seated upstairs were we couldn’t see any of it! Fillet steak was on the menu and it was beef steak not “buff” so we all went for that. Rob described how he wanted the steak cooked and asked for chips as well. Nik was clever and asked what the steak came with and just ordered the steak. We all had what Nik had and described how we wanted it cooked. Over an hour later 4 sizzling steaks came out all cooked exactly the same and Rob had an extra plate of chips which took us a while to figure out where it had come from.

Tired after eating we went for a night cap at the “Amsterdam” bar where we watched a Nepali covers band sing Guns’n'Roses and other assorted rock tunes. They were a bit hit and miss but there heart was in the right place. We tried the local whisky called Signature. Steve had been banging on about it each time we went into a super market. It was a bit rough but drinkable and cheaper than an imported whisky. When the band finished it was time for bed!

Photos on my Facebook page.

Nepal Day 9 - Lumbini, Pokhara

October 7th, 2013

Another early morning with breakfast at 7am. Porridge toast, boiled eggs and a spicy savoury potato dish with coffee.

Group photos on the lawn and then we set off for Pokhara. We stopped after 5 minutes because there was a Maoist demonstration. We wanted to check it wasn’t on any of our roads out. It was, but an inspector came aboard the bus to verify we were all tourists and let us through. So off we set.

The journey to Pokhara took us up 1000m in altitude. Roads were treacherous, narrow and extremely bumpy. I could hear yelps from the other passengers as we were occasionally thrown completely out of our seats. It’s safety first for me so I always wore a seat belt. I figured out they had been fitted to the bus incorrectly so I fixed mine. All this meant was that I wasn’t thrown quite as far up as the others but my bum still left the seat! Oh, and if the coach decided to join any of the hundreds of coaches that had taken bad turns and rolled down the hill, I’d be the only survivor!

After 2 hours we stopped for a rest break near a large bridge. We walked along down to the river which was a beautiful opaque turquoise colour, probably due to the high mineral content in the area. The sand was light grey but it glinted like diamonds. On closer inspection there were lots of tiny flecks of quartz mixed in with the sand. Butterflies fluttered next to the water’s edge. When they were grounded they were jet black but when they took off they revealed bright cyan colours under their wings.

The other guests on the tour had nicknamed me the Pied Piper because all the children seem to migrate towards me. I think its because I’m the tallest in the group, or they associate better with odd socks or it’s some kind of morbid curiosity; I seem to be the one they hassle first for sweets.

Back in the coach and continued the journey. I sat in the cab of the coach for a few minutes and saw the driver’s eye view. It was extremely frightening, hurtling around blind corners on a mountain pass at 30mph, but after a while you kind of got used to it. It was all about watching what was on the road ahead and remembering it - a bit like driving in the countryside except that if you make a mistake it was a 500 meter drop instead of hitting a bush or tree.

As we travelled through a small village we saw a film crew. It looked quite interesting so after a straw poll we decided to make a stop here and have a nose around. Pabi said she recognised the policeman character but didn’t know the rest. We later found out that the policeman was the lead character in a TV cop show and, by all accounts, was a bit of a heart throb in Nepal. This went a long way to explaining why the stop was sudden and unscheduled and why Pabi was practically drooling while we all watched what was going on. Elsewhere on the set there was a barber complete with posters of dolly girls stuck to the walls of his shack. Nepal is a bit religious, so all the dolly girls were fully clothed and properly presented; no Page 3 here!

Finally made it to Pokhara at about 5pm and checked into the hotel. This was a real hotel with an en suite bathroom. As usual I was sharing with Jon again who had been a bit unwell over the journey and so was the first to try out the facilities. The toilet didn’t flush properly so he had to do some DIY to fix it.

I’d been stuck on the bus all day and was gasping for a pint. Went for a wander to find somewhere to have a drink. Pokhara feels a lot like one of the Greek Islands: a central strip with tourist shops selling tat. Every other shop was a camping shop pushing knock-off North Face gear at rock bottom prices. Most of the people where white or Chinese and I can’t say I liked it as much as the other places we had visited.

Found our way on to a platform which extended out into the lake. Unfortunately there was a haze that spoilt what would have been a wonderful view. After admiring the haze for a bit we continued our search for some amber nectar. Found a nice place with some good trance tunes and plenty of shade. Had a couple of beers with Rob and watched the sun set.

Photos on my Facebook page.

Change Power Plan when application starts

September 30th, 2013

Most of the time my computer runs using the Balanced power plan. This turns the display off after 10 minutes and puts the computer to sleep after 30 minutes. So you can imagine how upset I get when the computer goes to sleep after 30 minutes, before it can complete the 2 hour download or 3 hour video transcode.

In the control panel (Control Panel -> Hardware and Sound -> Power Options) you can select different power plans. You can then set up desktop shortcuts to configure the system to use the different power profiles. Sadly this is something that you have to remember to do before you start the special program and again after the special program has completed.

I looked all over the internet for a program that will alter the power options (or power plan) automatically depending on which applications were running. Needless to say I couldn’t find one! So I’ve had to write it myself using PowerShell.

Version 1 of the program is really simple. The program has 2 power states, one for when a special program is running and one for when no special programs are running.

There are a few things you need to do to get yourself going.

  1. Open a Control Panel -> Hardware and Sound -> Power Options find or create 2 power plans. I changed Balanced to turn off the display after 10 minutes and send the computer to sleep after 30 minutes. I created another power plan called No Sleep which switches the display off after 5 minutes and never puts the computer to sleep.
  2. Open a command prompt and type: powercfg list

    C:\Users\mrn>powercfg list

    Existing Power Schemes (* Active)
    ———————————–
    Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *
    Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
    Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)
    Power Scheme GUID: b1b44a00-a3a0-4cf7-9ef1-a2a1c117dc5f (No Sleep)

  3. Pick the 2 power schemes from the list and update the variables $programs_running_cfg, $programs_running_cfg_guid, $programs_not_running_cfg and $programs_not_running_cfg_guid inside the program.
  4. Next we have to find out the names of the special programs, so we can watch for them. Open a Powershell command line. Type: Get-Process. Load in the special program and type Get-Process again. Compare the outputs of the command to yield the process name.

    PS C:\Users\mrn> Get-Process

    Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
    ——- —— —– —– —– —— – ———–
    152 15 3364 8776 57 1864 Azureus

  5. Do this for each special program you want to add.
  6. Take the ProcessNames and add them as a quoted comma separated list to the variable $special_programs

Finally, add the program to your start menu Startup folder. If this is the first time you are using PowerShell you may have to change the execution policy to RemoteSigned to allow it to run.

Obviously the program is really simple so if anyone creates an update or a better version then I’d be happy to update this post to share the changes. So without further a do, here it is:

Code

$special_programs = @('Azureus', 'VirtualBox')
 
# dos> powercfg list
$programs_running_cfg = 'No Sleep'
$programs_running_cfg_guid = 'b1b44a00-a3a0-4cf7-9ef1-a2a1c117dc5f'
 
$programs_not_running_cfg = 'Balanced'
$programs_not_running_cfg_guid = '381b4222-f694-41f0-9685-ff5bb260df2e'
 
$loop_delay = 60
 
while ($True)
{
  $special_programs_running = $False
  for ($i = 0 ; $i -le $special_programs.Length – 1 ; $i++)
  {
    Get-Process -ErrorAction SilentlyContinue -Name $special_programs[$i]
    $running = $?
    if ($running -eq $True)
    {
      $special_programs_running = $True
      # break
    }
  }
  
  $current = powercfg -getactivescheme
  if ($special_programs_running -eq $True)
  {
    write-host "Special programs running"
    if ($current -match $programs_running_cfg_guid -eq $False)
    {
      write-host "Switching to " $programs_running_cfg
      powercfg -setactive $programs_running_cfg_guid
    }
    else
    {
      write-host "Power profile already set to " $programs_running_cfg
    }
  }
  else
  {
    write-host "No special programs running"
    if ($current -match $programs_not_running_cfg_guid -eq $False)
    {
      write-host "Switching to " $programs_not_running_cfg
      powercfg -setactive $programs_not_running_cfg_guid
    }
    else
    {
      write-host "Power profile already set to " $programs_not_running_cfg
    }
 
  }
  
  write-host "Sleeping..."    
  sleep $loop_delay
}

Nepal Day 8 - Chitwan, Lumbini

September 6th, 2013

Woke up before the alarm at 6.20, cold shower (no hot water) then down to breakfast.

Mary and Rob had been bitten to death by mosquitoes so gave them some of my Piriton (antihistamine). We left Chitwan at 8am bound for Lumbini, home place of the Buddha.

Stopped at a little village about 10 minutes away. The village had been there for 1200 years. The villagers survived the malaria epidemic by smoking the cannabis which grows locally all around the village, well that was their excuse! The houses or huts were made from mud and clay.

On arriving at the village 2 boys came to say hello and then they said “Candy". What a cheek! Had a rummage around my bag and found a chocolate bar from the last road trip that I hadn’t eaten yet, and gave it to the boys. I gestured that they had to share it. They scampered off a couple of meters and after struggling to get into the packet, the eldest split it into two and they started happily munching away.

At the back of the village there was an animal pen and a vegetable patch. A little girl came to watch us watching the pigs. After two minutes she said sheepishly “Candy". I had another look in the bag to see how much lunch I had left. Found a bag of sweet croissants and in the time it took to get up the girl had been joined by six other children including the two from earlier. I split them so they could share the food equally amongst themselves. Rob made a joke that if we came back in a year, they would have got rid of their village statue of Shiva and replaced it with a statue of me handing out chocolate and cakes to the children!

Back in the coach for 2 hours. After we had a rest stop there was a quiz. Steve is by far in a way the worst quiz master ever. It’s so bad it’s good! Yet again the quiz was full of ambiguous multi-choice questions which we all had a laugh about.

Stopped for lunch at a school about an hour from Lumbini. There was a shaded area outside the classrooms so we sheltered under there while eating our pack lunches. Quite a crowd of women and children started watching us from doorways and other shaded areas. Various people in our group had left overs, so walked over to the onlookers and distributed them.

The area was very rural and I think foreigners were a bit unusual. In spite of being a very poor area all the school kids had a school uniform. Most of the uniforms were western in style: shirt, tie, trousers (or skirt) and in some cases a jumper, blazer or both - yes a jumper in 32°C! but they didn’t seem to mind. Back in the coach for the final leg to Lumbini.

We stayed in the Buddhist pilgrim monastery on the edge of town. Tourists are usually not allowed but Losan knew some people in monk-world and so was able to get us in. After arrival we unpacked and relaxed for a bit before meeting in the lobby.

Today was a cycle tour of Lumbini: Development Trust. It was a 1.5km by 6km square block of land which was devoted to Buddha. Bab’s had popped her knee getting down from her bathing elephant so Mary and her were met by a Rickshaw outside the monastery and the rest of us had to walk down to the cycle hire shop. My bike had a dodgie seat and only one break but it seemed to work ok. It was nice to see I could still cycle with no hands when the road (or path) was flat enough.

Losan (our friendly neighbourhood monk) and Steve guided us to the centre where Buddha’s birth place was. The actual spot was enclosed in a white castle building. We had to take our shoes off, so I was getting smiles from everyone because I wear odd socks and they were more obvious now. There was a pool at the back called “The Puskarini, The Holy Pond“. Steps led down to the murky light jade coloured water. Visibility was only a few centimetres and after seeing a turtle we starred in contemplation wondering how deep it actually was. At that point an absolutely monster fish appeared from no where and then was gone. I think the pond was an up-side-down pyramid and the steps to it were just the first steps of many to the bottom.

The whole park was very relaxing and we sat in a semi-circle surrounding Losan while he talked about Buddhism. He explained how to sit and hold your hands. Then we started to meditate. After listening to Losan talking us through meditation for about 30 minutes I realised that I actually meditate quite regularly at home and in my normal life, I just never referred to it as meditation. The were various members of the group who were very spiritual and bought into the whole ethos of relaxing and sitting around doing nothing, but I’m sorry it’s not for me! I use it for sensory exercise - “use it or lose it” (I’ll probably get another blog article out of that when I’ve finished my trip articles.)

During Losan’s meditation under the trees in Buddha’s garden a lot of people came and sat in our semi-circle. I think they thought “our” monk was a general monk for everyone which was okay at the beginning but the numbers soon grew to include hordes of Indian children who were fighting and disrupting what we were doing so we called it a day. We had the rest of the afternoon to ourselves on the proviso that we had the bikes back by 6.

The park has a long channel of water (or canal) that connected Buddha’s birth site in the Sacred Garden to the World Peace Pagoda about 3 km away. Along the canal were the various headquarters of Buddhist factions from around the world. At the end is a World Peace monument with an inscription along the lines of “…Buddha freeing us from the shackles of Gods…". It reminds us that fighting and killing each other over made-up space fairies was no way to behave and we should all just concentrate on keeping ourselves happy by being nice to each other. I had a lot of exposure to Buddhism when I was travelling around Japan and if I had to choose a religion to follow this would be it.

Back on the bikes and the scenic route back to the hire shop. I had caught the sun so I risked an ice lolly! before heading back to the monastery for a shower and dinner.

Drinking and smoking were forbidden at the monastery so a small contingent of people decided to venture out to find somewhere for a post-dinner pre-bed drink. By a strange coincidence the only people who stayed out were from science related professions (engineering, I.T. and analysis). All the nurses, environmental health officers and accountants stayed in. Just had one bottle of Gurka beer (650ml) for 180rs (£1.65).

There was a huge Hindu festival on in the park. A man’s voice came over the public address system when we dropped off the bikes. The voice sounded like it was announcing something but then the drums came and the announcing changed into manic Indian ranting, almost like he was trying to whip the audience into a frenzy. Tractors with trailers full of revellers had been driving up to the festival site and back all evening and at 10pm when we wanted to go to bed it was showing no sign of stopping, even manic Indian man was still ranting down the P.A. only now he was banging drums too.

Jon and I had checked the room for mosquitoes before hitting the lights but it was still really hot. The extra noise wasn’t helping me sleep. After about an hour the manic Indian shouting and drumming was replaced by 2 voices monastically chanting. This was much easier on the ears and I soon fell asleep.

Photos on my Facebook page.