Wednesday 16 September 2015

Use Your iPhone in Different Countries

When I tried to use my old iPhone 4 bought from China in other countries for example Canada, it works fine with calling and texting since it is unlocked. But the strange thing is the 3G network is not accessible.

The solution to this problem is to set up the APN profile. There are some apps you could find in the Appstore but some of them are not free and some need a login. But I found the following way which is easy and free.

Just open the link down below in safari and it will let you set your carrier, for example, Canada/Fido.

                          http://www.unlockit.co.nz/

Then it will jump to setting->general->profiles and just press install and you are done! You can now see a app with APN on it. And if you try to open it, it is still a webpage.

But when you change to another carrier company, you must delete the profile from setting->general->profiles (now the APN app icon should be gone) and repeate the process above again.

Hope it helps.

Thursday 10 September 2015

Some useful commands about SSH under Linux

If you are travelling constantly like me, then remote login would be a daily routine. So here are some commands you might find useful when working with SSH.

1. Login
Suppose the username on the server is 'boris', then open a terminal and put:

                 ssh boris@xxx.ee.university.com

That is username@host_domain.

Then a password is required and now you are in!

2. Download files from the Server to the local computer
If your current teminal are connected to the server now, start a new one without ssh connection. To download to the local computer, the working session must be locally. Then put:

       scp boris@xxx.ee.university.com:/home/employees/boris/... /home/myLocalMachine/work/...

That is scp theSameWithLogin:ServerFilePath LocalFilePath

To  be continued......

Wednesday 9 September 2015

Visualize Data Density on 1 Dimension Axis


This source code clip is for visulizing data density on 1 axis like the following:



# reference:
# http://stackoverflow.com/questions/7352220/how-to-plot-1-d-data-at-given-y-value-with-pylab

import numpy as np
import matplotlib.pyplot as pp
import random

val = 0. # this is the value where you want the data to appear on the y-axis.
ar = np.random.random(size=40)
pp.plot(ar, np.zeros_like(ar) + val, '+')
pp.show()

Saturday 5 September 2015

To Start Up

I would like to start blogging today in English.

I used to keep a blog mostly in Chinese on http://blog.csdn.net/boriscoding. For this blog, I will start from translating some popular useful ones into English. And from now on, I will just blog in English on both blogs.

This blog, as my old one on CSDN, is my technique experience about coding and tinkering interesting new things. Sometimes it might look really easy and simple. That is because not everything in use has been learned in school. I must learn new technologies just by doing. And the point of this blog is to remind me that I did this before and the old solution might still be useful now. More importantly, hopefully, the blogs are here to help those who strive searching for the proper answers to the same problems I met.

Thank you in advance for valuable advices!