Blizzardboy

Psymeg & Chooch

Photos, Linux, Travel

Django on Debian Squeeze with Postgres

Here are my notes for getting Django set up on Debian Squeeze with Postgres as the database. System was a new virtual machine running on VMWare Fusion.

Install dependencies for psycop2 and postgres:
sudo apt-get install python-dev libpq-dev postgresql python-django

Download and install psycopg2 (path will change – check – http://initd.org/psycopg/download/)

wget http://initd.org/psycopg/tarballs/PSYCOPG-2-4/psycopg2-2.4.4.tar.gz
tar -xvf psycopg2-2.4.4.tar.gz
cd psycopg2-2.4.4/
sudo python setup.py install

Add a user and database in postgres:

su - postgres
CREATE DATABASE djangotest;
CREATE USER django WITH PASSWORD 'django';
GRANT ALL ON djangotest TO django;

Run django-admin.py startproject mysite as per the tutorial website to get started.

In settings.py I had to specify localhost as the database machine – they comments say this isn’t needed.

So in settings.py the database section will look similar to this (I have changed the password…):


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'djangotest', # Or path to database file if using sqlite3.
'USER': 'django', # Not used with sqlite3.
'PASSWORD': 'django', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.

From there you should be good to go with the tutorial.

Centos show version

To see which version of Centos a machine you are working on is running, at the command line type:

cat /etc/redhat-release

For me it was:

CentOS release 5.5 (Final)

Denphone Digest December Issue

The December issue of the Denphone Digest is up and can be read here: http://www.denphone.com/denphone-digest-december-2009. This issue features an interview with Lookmedia‘s Mark Long, as well as a short write up of our first trade show, and new phone from Polycom.

Lookmedia is an interesting company, offering some “out of the box” advertising solutions in Japan. Here is a picture of some of their walkers.

Lookmedia Walkers

And here is a short extract from the interview:

Simon: One thing I am always curious about when thinking about advertising and marketing, is how to judge the effectiveness of campaigns. Could you tell us about the metrics of your campaigns? How do they work out for the client?

Mark: Metrics are hard, but I can tell you one about a couple of campaigns we did where we saw very satisfying results. We were contracted by Nagoya City to help raise participation in the Nagoya local government election. We had to compete with numerous different companies to get the contract but we won the contract especially because of our mobility.

Over the last 10 years there has been a large decline in voting in Nagoya especially among young people. So we pitched the idea of targeting universities, shopping areas and train stations to directly focus on younger voters. For 10 days leading up to the election we had 8 walkers out from 7am to 9pm at different times of the day at specific locations – for example, the train stations early in the morning, at the universities during lunch time and then at shopping malls in the evenings so that we could best target these younger voters. This campaign was probably the most successful we have taken part in with a significant change in the turnout of voters.

Another job we did in Nagoya also had very positive results. NTT Flets TV do a campaign every March to increase sign ups for their service. We had 26 boards out for 4 days and the campaign doubled the number of sign ups. Now, it was part of a larger campaign, so we can’t say we were solely responsible for that. But we do get repeat customers, and if our campaigns weren’t working we wouldn’t get those repeats. So our customers are satisfied.

Issue 8 of Denphone Digest

Issue 8 of the Denphone Digest is now available online – check it out here: http://www.denphone.com/denphone-digest-november-2009.

This issue features a really promising Japanese start-up – Inferret – who are doing some really interesting work in the field of natural language recognition for both text and spoken language. And we introduce a great little hotel IP phone made by Japanese manufacturer Nakayo (pictured above). While a lot of people still have a negative image of VoIP (due to cheap calling networks) this phone has top-notch sound quality and is a wonderful device. There is also a howto I wrote explaining how to get twitter feeds to display on Polycom phones (although it will also work on Cisco IP phones with a bit of tinkering).

Also, I should mention that we will be exhibiting at our first tradeshow –

Denphone to exhibit at Call Center/CRM Demo & Conference Tokyo

Denphone is proud to announce that they will be exhibiting at this years Call Center/CRM Demo & Conference Tokyo to be held November 12th and 13th at Sunshine City in Ikebukero.

The Call Center/CRM Demo & Conference Tokyo is Japan’s leading tradeshow for Call Center and CRM solutions with vendors exhibiting a wide range of hardware, software and services for the call center and customer center industries.

Denphone will be focusing their SIP and IAX2 trunking solutions, as well as managed voice services. This is a good chance to meet up with a representative from Denphone to find out how telephony related technology is moving forward and what new solutions there are now available to both reduce your company’s expenditure while increasing employee effectiveness.

Denphone will be giving away 2 IP phones to people who visit their booth – so visit us to be in to win!

The event will be held at Sunshine City Ikebukuro: (http://www.sunshinecity.co.jp/ (Japanese language only).)

For more information (Japanese only) please see http://www.callcenter-japan.com/.

Look forward to seeing you there, and I hope you enjoy Denphone’s magazine.

Blogger in Japanese – Changing it back to English

blogger logoSometimes living in a foreign country can be heaps of fun, and sometimes it can be a pain.

This evening, I was trying to leave a comment on another blog, and it was a blogger blog. It seems the options have changed for comments, so I was offered either to use a blogger ID or an Open ID. I prefer to use my own website (ie. www.blizzardboy.net) as my ID, rather than going through some other service, but it would appear that that option has disappeared.

So I got curious – I did start a blogger blog back in 2006 so I wanted to see what happened to that. Actually it is still there at http://psy-ke.blogspot.com/. I wanted to see what would happen if I chose the blogger option. And lo and behold the blog was still there.

But when I went to log in, every thing was in Japanese! I guess no matter where you are from it will display the navigation and everything in the language of the region you are in.

Despite Japan having a foreign population of over a million people, blogger (and other google sites including analytics, adsense, adwords and youtube) as well as a large number of other sites choose to send web pages in the language of the country which your IP address indicates, rather than the language your browser indicates.

This means we get web pages in Japanese when we want them in English. Now, I can work in Japanese, but I prefer not to. From a webmasters perspective this is easy enough to change. But for the end user can be a real nuisance.

Anyway after a little googling I found the solution here and I have copied the pertinent parts for your (and my!) reference here:

From: Mishka OP

You need to make sure you have the language set in all three locations for it to stick and if you delete cookies it will revert and you’ll have to do the settings again.

Here are the instructions that you can use even if you can’t read the language being displayed.

Okay, a few things. First, you need to go into your browser settings and make sure that English is chosen as your preferred language.

Okay, if you are logged into blogger and on your blog’s main page, you can click on the little blogger icon on the left top corner and it will take you to your dashboard. When you are on your dashboard, you should see your blog names below and your profile picture and name to the right. The third bullet down from the picture is the Change Language link. Click on that and select English and save (English should be the top one, and Save is the big orange button).

After you save, it should take you right back to your dashboard. Underneath the title to your blog, there should be a little gear icon on the right side. The second link is the one for the blogs settings, click on that. Formatting is the third link over from the left underneath the settings tab (which should be where you are if you came from the dashboard). The language settings is the 6th down from the top of the page. The save button is bright orange at the bottom of the page.

It is more of a google thing than it is a blogger thing (they think they are helping you out by adjusting the language based on IP address but it is supposed to default to your browser’s language).

This is quite useful advice even if you are just traveling to Japan (or to any other country that uses a different language).

It’s a bird, It’s a plane, no it’s water bottle man

Found this amusing video posted on gizmodo: The Physics Behind the Insanely Dangerous Japanese Water Jetpack. Making pet bottle rockets is a rite of passage that every junior high school student in Japan goes through. And this video certainly takes the whole process to the next level!

Azabu Street View – Google

As upstairsforthinking pointed out, Google’s Street View has hit Japan and now you can navigate around some parts of the Isles of the Rising Sun from the comfort of your own home. It is going to take a lot more work before they cover the whole country, and I imagine if this gets more popular there will be some privacy complaints (privacy law is quite strong in Japan), but this is a very useful tool indeed.

Here is the view of the entrance to our apartment building.


View Larger Map

Now, can you find Tokyo Tower from here?

Bush Cutter George Jr.

bush-cutter-george-jr

Sometimes we see products in Japan or other parts of Asia with strange names that are obviously the product of very bad translation attempts, but here we have the Bush Cutter George Jr. which I think is the product more of a cutting (excuse the pun) sense of humour.

Produced by Japanese Agricultural machinery manufacturer Canycom, the Bush Cutter George Jr. is part of a line-up which also includes the wonderfully named Hillary – a wheelbarrow with tank tracks.

What will they do if Obama wins the presidency?

Back to Ubuntu

Just finished switching back to Ubuntu. I have been using Linux for a long time now it seems, starting out with Redhat back before they went “professional” and turned into Fedora, then I used Mandrake for a while, until they too went “professional” and became Mandriva. I think there is a pattern there.

After that I started using Ubuntu, and then when we moved to China, I bought a Mac and used OS X. I thought it would be easier and more reliable to use in China where I wasn’t sure how good the internet connections would be. As it turned out Linux would have been a better choice as Apple still haven’t made much inroads into the Chinese market (at least not in the province we were in), and the internet connection we ended up getting was faster than Jesse Owens.

After a bit over a year using OS X, I went back to Ubuntu. Using OS X was Ok, never really had a problem with it, but it was a bit like waltzing across the floor with a stylish but slightly forbiding great aunt that one didn’t really want to get ones hands dirty with. So, back to Ubuntu. Used that for a while before feeling adventerous, and missing KDE, I installed KUbuntu. Not a bad operating system, but I had a lot of problems getting Japanese input to work (as others have had), and not finding a solution, went back to Ununtu.

I toyed with giving Fedora 8 a run, but the install DVD I have has a lot of problems and kept crashing at different points during the install. Funny really that even though it has been such a long time since I have looked at that American offspring it really hasn’t changed that much – at least in terms of the installer. Not the prettiest thing out there.

Ubuntu’s installation is pretty easy. One thing though, if you are in Japan and wish to give it a go and you have a fibre optic connection from a provider like Plala through to NTT (like any self-respecting space-cadet) you will need to open up your synaptic package manager and install the pppoe tools which are on the cd, but aren’t installed by default, to get your internet connection working. Running pppoe-config as root from the command line will get things working.

All in all, it is nice to be back. And nice to have Japanese input again. I should catch up on some email now.

Japanese Nationalist Wanted

Having a scan around the job boards for computer related jobs and found this position advertised:

Oracle EBS: We are looking for Japanese nationalist / Bilingual, Project manager/ Team Leader/Team Members of Oracle EBS for Hitachi Kenki KK Permanent Position in Tokyo. Responsible for some PGs and Test Engineers.

I see lots of Japanese nationalists driving around in their trucks on the weekends near here. Maybe one of them would be interested.

           Next >>