Ruby on Rails on Google App Engine

and the impossible number of problems that one runs into whenever trying to do anything code related.

Testing: Ruby on Rails 5.1.2 application to run on Google App Engine Flexible environment.

I wonder if running Ruby-2.4.1 on laptop vs the Ruby 2.3.3 on GAE will cause a problem….nvm.

Apparently GAE Flex can now run other languages by managing it inside a docker container behind that scenes. Well lo and behold, we would no longer need to set up Compute Engine, Container Engine and the likes. Let’s see how well this could possibly work as the community document is rather scarce, and the official docs are pretty lame by running a sample Rails app within gcloud cloud console instead of deploying a real-life app from desktop.

 

  1. First problem, production env key. Stupid Rails keeps doing this.
  2. GAE requires a /_ah/health check. Why can’t they be more upfront about this instead of failing stupidly in the background
  3. Realised the repeatedly deploying adds more versions into GAE, oh it doesn’t replace each other. I’m such a GAE noob.
  4. GAE version cannot be deleted unless it’s not serving. Oh. Then why make me wait so long to throw an error. Dumb GAE
  5. So many errors upon trying to stop/delete versions. Dumb GAE
  6. Need to add a controller and roots. Dumb me

Oh look it’s running finally

 

and also managed to route the domain too. Okay.

 

Ruby on Rails on Google App Engine

Change in the big world

EDITORIAL | MUSING

I wonder if people look at the world, feel that it’s too big, too problematic, too complicated, too difficult to change, and just decide to turn away / run away from it all.

When you realise that there are 6 billion+ living beings, and counting, and increasing faster than dying, when you realise that there are so many countries, so many ‘races’, so many religions, so many square kilometres, that you can’t even properly visit all the countries once in your lifetime, that you in your lifetime only know, interact and remember so few of them, when you realise how short your life and time is, that is when most people will just drop fancy ideas from their head and instead just grab that burger, take that commute home, watch some TV and settle in for yet another night, yet another weekend, yet another year end, yet another new year.

Indeed our little human lives are all too often so short. 24 Earth hours, 365.25 Earth days, 100 Sol years. And indeed most people do not end up making a huge change in the world during their lives, commonfolk aren’t heroes, generals, leaders, presidents, big bosses (of big companies), celebrities, etc. Heck even these people don’t always get to make significant long term lasting changes.

That’s probably why it’s so easy for us to turn away from it, to be sucked into being a part of the ecosystem, to run away into fantasy and movies and tv shows, and make-belief sports competitions, and self meditation.

But there’s always some people who feel that they could try to change something. Probably they never thought it would get so big, but it did, and it grew and grew. Change happens. Fortuitously, accidentally, decidedly?, endlessly.

The odd thing is that if you look back, you see all these massive changes happening, despite sometimes everything feeling that it might never change at all, being so set in stone and all.

The grand nations, the grand corporations, employing tens of thousands, hundreds of thousands of staff, seem like too big to fail, too old to fail, and to have been around ever all the while in our lives. But they weren’t, and they’ve come, gone, changed, disappeared, so many times within years or decades.

When I get old, perhaps I will look back to the time as having lived through the Age where there was widespread Internet version x, where Apple and Google grew big (might be bigger or smaller in the fuure), where SpaceX and Tesla appeared from nothing, where Netscape Navigator was a thing, where people first learned programming (not really it started before my time), and so forth. It never really felt like anything, but when we look back, it might just be. What did it feel like to live through the rock & roll? When Bob Dylan was alive? When x celebrity was alive? When JFK was President? When Trump was President? And all I could say was it just felt like the one life I was living, no different than any other possible life I was living, which is no other. It was as good as I could have, as bad as I could have.

I think it is good to have people who dare to change, to dream, and be different. Not to try to be different or special, but because they see that some things could be better. It would be a tad sad to just accept everything at face value as the way it will always be.

In a way it’s like a parallel of the chaos theory (which is frankly quite a simple theory but hey it opened people’s minds).

There was an article today about the definition of “Space” – what is space? Yes, mostly the outside of Earth, Space. It made for some interesting thoughts on how weirdly we define that word and how we understand it so counter-intuitively and in a conflicted manner. http://nautil.us/issue/49/the-absurd/what-is-space  The absurdity of it all, really. I’m surprised human brains don’t implode or remark at our own stupidity and narrow view of the universe/physics.

Which brings me to the supposed 4D / multi dimensional / multi whatever space of the Culture science fiction novel series by Ian M. Banks. The “Level 8” tech space ships travel and function in realms beyond our description and imagination, not that the book tries to dumb it down but rather knows it cannot explain it at all. As fictional as it is, it could well be an approximation of the truth. All this fancy futuristic stuff. I’m a bit sad I will not get to experience it. Cryo preservation is not ready, nor is it useful. Why in the world spend so much money, energy and resources to preserve someone when it is more useful to grow a new human who can learn new stuff and be more useful. It was worked for eons and might work for millenia to come.

Change in the big world

One weird trip to HK

It was quite an unconventional trip to HK.

nice hotel

Shenzhen

Rainy weather and sick person

Lunch with local friends

But I just can’t avoid good old Mongkok

Didn’t manage to take their iconic mini-buses this time actually

but I love the crowd

and many views from the streets, from above, from below

dang, using the pansonic 20mm f1.7 II does have quite a fascinating color saturation and perspective. cool.

One weird trip to HK

Not HotDog

A most hilarious example of a applied machine learning AI tensorflow app running on Android/iOS. Very well designed concept, and very entertaining element of the Silicon Valley show too. Awesome.

https://medium.com/@timanglade/how-hbos-silicon-valley-built-not-hotdog-with-mobile-tensorflow-keras-react-native-ef03260747f3

Can’t wait for more AI/ML to get into phones.

Year 2017 phones should not be about screensize (dumb), battery size (dumb), fingerprint sensors (dumb), camera quality, number of camera sensors, how much ram, headphone jack, OS version (all dumb), it should be about whether it comes with a built-in AI/ML acceleration chip and how actually smart-phone it is.

Then again, it’s so in its infancy that any AI chip created in 2017 is going to be superseded in 2018, and super-superseded in 2019 in ways we cannot even imagine right now. Still, it gives us something to look forward to in the next generation of phones. Other than better screens, better batteries and better cameras.

Not HotDog

Hong Kong to Shenzhen

After a few trips to HK, it was time to see something new, ie a day trip to neighbouring Shenzhen to visit Huaqiangbei electronics market and Dongmen Pedestrian Street.

How to get from HK to Shenzhen via train

a. From within HK, get to the East Rail Line. it’s the light blue line that runs vertically upwards. From Causeway Bay you can take a bus across the tunnel to Hung Hom Station.

If you’re on the other side, you can take the green line to the interchange at Kowloon Tong. It’s a long journey ~>30mins, so take a seat and enjoy the scenery.

When boarding the train, watch out for the ending station. There are two, either Lo Hu Station or Lok Ma Chau station. Both stations have a border entry, but I went to Lo Hu as it is closer to the places we are heading to. Make sure your Octopus card has sufficient value as this long ride cost more than the usual downtown trips. I think it was probably 30-40 HKD in total.

East Rail Line is a longer and bigger rail train than the usual MTR.

b. HK Customs

Since you are leaving HK, you’ll need to go out of HK customs. Alight from the train at Lo Hu station, follow the escalators and signs and customs is right upstairs.

c. China Customs

You’ll walk like 100m and then it’ll be the China entry customs. If you need a visa, you should be able to apply for one upstairs. I didn’t need one as Singaporeans get visa-waiver for trips less than 15 days.

Customs was a pretty straightforward process.

d. Enter

Right out of China customs.

Once you step out, you’re right at the entrance of the escalators down to Shenzhen subway green line Louhu Station in the basement, and on the right is the Lohu Commercial City mall. Apparently you can start shopping right there but we heard their prices are so good so we didn’t bother and instead took the subway to Dongmen.

Louhu Commercial City on the right
Luohu Subway Station
The one way tickets. Tap using the chips to enter, drop it into the slots to exit the station.
Buying tickets at the machines. There’s also English mode available. You’ll likely need coins or 5 yuan notes.

e. Dongmen

Pedestrian Street. Large McDonalds there is a good landmark to remember.

Dongmen Pedestrian Street is two stops away. Buy your subway ticket indicating start at Louhu and end at Laojie Station. Cost = 2 yuan for one way ticket.

Once you exit from Laojie Station, you’ll be right at the shops. I suggest you get out to the ground level to get some bearings on where you are. There are many many exits for the station but most exits are fine. Use Exit F if you need to choose one.

It’s a very large area with tens of buildings so enjoy walking around.

f. Huaqiangbei

I went to Huaqiangbei as well. Same, use the green subway line 1 for another 5 stops or so. Cost is still another 2 yuan.

You can go into the all the buildings left and right of the pedestrian street, between the stations Huaqiang Road and Huaqiangbei.

Electronics all over.

Good luck looking for what you want.

 

Overall:

Ease of travel: Good. It was convenient, just follow the subway lines and signs, no complicated routing or taxi necessary. Cheap journey as well. Both subway have languages and announcements in multiple languages including English.

Safety: Generally we felt pretty safe. Minimal beggars / touts. Overall service was pretty decent and good. Just be a normal level of mindfulness as per usual travel and you’ll be ok.

Note that Google Maps in China is either restricted or lacking in info. You might want to arm yourself with Baidu Maps before getting in. Baidu has more precise location and information, but it’s all in Chinese.

Currency: You’ll need to use local Renminbi. We didn’t try with HKD. Even if you succeed, you won’t get as good a bargain. There’s plenty to shop – clothes, bags and shoes.

Pretty bustling at night when the crowds come out.

 

 

There are also tours etc that can bring you into Shenzhen, if that’s your thing. But a one-day solo trip is definitely doable.

Hong Kong to Shenzhen

Lightly

“It’s dark because you are trying too hard.
Lightly child, lightly. Learn to do everything lightly.
Yes, feel lightly even though you’re feeling deeply.
Just lightly let things happen and lightly cope with them.

I was so preposterously serious in those days, such a humorless little prig.
Lightly, lightly – it’s the best advice ever given me.

So throw away your baggage and go forward.
There are quicksands all about you, sucking at your feet,
trying to suck you down into fear and self-pity and despair.
That’s why you must walk so lightly.
Lightly my darling,
on tiptoes and no luggage,
not even a sponge bag,
completely unencumbered.”

– Island, Aldous Huxley

Lightly

Random Perth

the city from King’s Park
beaufort street
The lovely Satchmo cafe
the great australian breakfasts and cofffees
Like Perth. Still, simple, clean.

 

 

At Kali’s

I love love love love The Moon cafe. Best place in Perth for me.
oh I have no words for the vibe. it was perfect for me. a blend of midnight retro diner-bar-lounge, with an ultra laid back hippie atmosphere.
the booths, the bar, the arcade machine, the lights, the board games, the of it all.
because Koalas

How’s Perth? like a retirement town. Ok maybe ‘city’.

Random Perth

Inside Llewyn Davis

Oh my g
osh, a utterly bizarre, haunting,
distressing movie. It’s definitely set in a scene out of my time.

  1. Something about 1961 New York
  2. Folk song movement

  3. Bob Dylan’s upcoming

  4. Based on or inspired by a story of a singer around that time who never made it famous but crossed paths with Bob Dylan.

  5. That was a lot of acting by Oscar Isaac. Not bad.

  6. Carey Mulligan is very good, in a unique way. Very very fascinating woman. Discovered that she acted in more shows that I like, than I knew about.
  7. Woah Adam Driver was in this movie? (he’s the new kid who killed Han Solo)
  8. That cat. seriously.

 

If I had wings like Noah’s dove
I’d fly up the river to the one I love
Fare thee well my honey fare thee well

Well I had a man who was long and tall
Who moved his body like a cannon ball
Fare thee well my honey fare thee well

I remember one evening in the pouring rain
In my heart was an aching pain
Fare thee well my honey fare thee well

Bloody river was muddy and wild
Can’t give a bloody for my unborn child
Fare thee well my honey fare thee well

Sure as a bird flying high above
Life ain’t worth living without the one you love
Fare thee well my honey fare thee well

Fare thee well my honey fare thee well

Inside Llewyn Davis