Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Sunday, February 17, 2008

Config Idle Timeout for openSSH Fedora

With some ssh servers, you can config the time out in /etc/ssh/sshd_config like

IdleTimeOut=10m

However, the openssh shipped with Fedora doesn't support this option.
Two workarounds are:
  • Apply openssh watchdog patch
http://www.sc.isc.tohoku.ac.jp/~hgot/sources/openssh-watchdog.html
  • use TMOUT for shell
In /etc/profile
#set the idle timeout for ssh to 10minutes
TMOUT=600

readonly TMOUT

export TMOUT


Notice here, need to set the TMOUT to readonly, otherwise users can override it.

Thursday, January 31, 2008

On The Road -- Google Map Mashup

Just Created a google map mashup page to show those places i have visited.
The page is hosted on google http://multiroute.googlepages.com/ajaxGoogleMapsMashup.html

The draft version only show the list of places in the right side, and show marker and zoom in once you click the location.

Plan to add more stuff when have time:
  • polish the site
  • show to pictures for each trip (Already in Picasa Web Albums)
  • Monday, December 10, 2007

    Google doc has everything except macro

    I have created a spreadsheet for my wife's portfolio today.
    The spreadsheet has three sections:
    1. US Stock
    It is dynamic table, since i can use googlefinance() cell function to retrieve real time quote for us stocks

    2. Mainland Fund
    Keep tracking the fund investment in china.
    However, the googlefinance function doesn't support get stock/fund price for hongkong or china market yet.

    3. Bank Investment.
    Bank money market account.

    I feel that google doc is really handy. It allows me to finish this complicated document for less than an hour. What is the most wanted feature for me then?
    Macro! Macro! Macro!



    Sunday, December 2, 2007

    PHP tempalte + CSS = new website in one day

    Just created a new website last night. How can i do that in one day? Here is the answer:


    • CSS:Separate the presentation with content by using CSS stylesheet

    • PHP template:Define website structure using PHP template --all the headers, footer, main menu, sidebar...etc are added by php include

    • Contents:the contents dir will only keep clean page content without any presentation, and site structure.

    Tuesday, August 14, 2007

    Setup Outlook Mobile for Gmail account

    Just got a smart phone with windows mobile 5 installed.
    It comes with Intel 520MHz cpu and 640*480 VGA.

    Here are the steps to setup Outlook Mobile for my Gmail account on windows mobile.
    1. Select to create new Outlook E-mail
    2. E-mail Setup (1/4)
    Enter e-mail address: you@gmail.com
    3. E-mail Setup (2/4)
    User Infomration
    Your name: Johnson
    User name:you@gmail.com
    password: you_gmail_password
    4. E-mail Setup(3/4)
    Account Type: select Pop3
    5. E-mail Setup(4/4)
    Server Information
    Incoming mail:pop.gmail.com:995
    Outgoing mail:smtp.gmail.com:465
    Click 'Options' button
    6. Options (1/3)
    Use default
    7. Options (2/3)
    Check 'Require SSL connection'
    Check 'Outgoing mail requires authentication' (Since gmail needs auth for sending email)
    8. Options (3/3)
    Use default

    Until here, you are read to send and receive emails using Gmail
    Actually, i did not have a lot of time to play with it yet. will post more experience about this baby later.

    Saturday, August 11, 2007

    Building auto-translator based on google translate API (2)

    Got the draft version of the eclipse resource auto-translator works.
    For a input resource file in English below:

    action1=File
    action2=Open
    action3=Save
    action4=Johnson


    The output resource file in Simplified Chinese looks really stupid.



    Need to find a way to let google translate to use IT dictionary!

    [Updated 08/12]
    Here are more info after digging into this problem.
    From Google Translate FAQ:

    "
    Most state-of-the-art, commercial machine-translation systems in use today have been developed using a rules-based approach, and require a lot of work by linguists to define vocabularies and grammars.

    Our system takes a different approach: we feed the computer billions of words of text, both monolingual text in the target language, and aligned text consisting of examples of human translations between the languages. We then apply statistical learning techniques to build a translation model. We've achieved very good results in research evaluations"

    However, it can't be used to translate single word. since the algorithm needs context words to match for result.

    In our application, for example, menu labels are single word. such as "File", "Open"...etc.
    For workaround, I need to use an online dictionary for single word translation.
    One good candidate is worldlingo
    It is handy. allow you to select from list of dictionary, including computer/IT.

    Wednesday, August 8, 2007

    Building auto-translator based on google translate API (1)

    I am writing an auto-translator plug-in. which will do the i18n for eclipse plugins and application automatically. After evaluate several online translating engine, i think google translate is more accurate. Although google does no provide an official API for their translate yet.

    Here is the translation mode definition class. It lists all translation directions supported by google so far.


    public final class TranslateMode {
    public static final TranslateMode ARABIC2ENGLISH= new TranslateMode("ar|en");
    public static final TranslateMode CHINESE2ENGLISH = new TranslateMode("zh|en");
    public static final TranslateMode CHINESECN2CHINESETW = new TranslateMode("zh-CN|zh-TW");
    public static final TranslateMode CHINESETW2CHINESECN = new TranslateMode("zh-TW|zh-CN");
    public static final TranslateMode ENGLISH2ARABIC = new TranslateMode("en|ar");
    public static final TranslateMode ENGLISH2CHINESECN = new TranslateMode("en|zh-CN");
    public static final TranslateMode ENGLISH2CHINESETW = new TranslateMode("en|zh-TW");
    public static final TranslateMode ENGLSISH2FRENCH = new TranslateMode("en|fr");
    public static final TranslateMode ENGLISH2GERMAN= new TranslateMode("en|de");
    public static final TranslateMode ENGLISH2ITALIAN= new TranslateMode("en|it");
    public static final TranslateMode ENGLISH2JAPANESE= new TranslateMode("en|ja");
    public static final TranslateMode ENGLISH2KOREAN= new TranslateMode("en|ko");
    public static final TranslateMode ENGLISH2PORTUGUESE= new TranslateMode("en|pt");
    public static final TranslateMode ENGLISH2RUSSIAN = new TranslateMode("en|ru");
    public static final TranslateMode ENGLISH2SPANISH = new TranslateMode("en|es");
    public static final TranslateMode FRANCH2ENGLISH = new TranslateMode("fr|en");
    public static final TranslateMode FRENCH2GERMAN = new TranslateMode("fr|de");
    public static final TranslateMode GERMAN2ENGLISH = new TranslateMode("de|en");
    public static final TranslateMode GERMAN2FRANCH = new TranslateMode("de|fr");
    public static final TranslateMode ITALIAN2ENGLISH = new TranslateMode("it|en");
    public static final TranslateMode JAPANESE2ENGLISH= new TranslateMode("ja|en");
    public static final TranslateMode KOREAN2ENGLISH = new TranslateMode("ko|en");
    public static final TranslateMode PORTUGUESE2ENGLISH = new TranslateMode("pt|en");
    public static final TranslateMode RUSSIAN2ENGLISH = new TranslateMode("ru|en");
    public static final TranslateMode SPANISH2ENGLISH = new TranslateMode("es|en");

    public String toString() {
    return langpair;
    }

    private final String langpair;

    private TranslateMode(String mode) {
    langpair = mode;
    }
    }


    Tuesday, July 3, 2007

    Production GIS map system all based on open source components

    During the past weeks, I was designing a GIS map system similar to Google map for a company.
    On the server side, they want a spatial database, which support ESRI format Sharp files. Also needs a map server, which handle client request, query the database...etc.

    On the client side, they want a standalone client instead of AJAX based web app.

    I have some experience on the GIS stuff five years ago. We used a open source map server at that time, but it was quite slow.

    When looking into open source area for GIS system again after five years, i found that we can build PRODUCTION GIS system by integrating all the latest and best from open source community.

    Here is the solution in the end:
    Server side: Postgis + GeoServer + squid cache.
    No development work is needed .

    Client side:
    • Web-based client, can be built on top of OpenLayers
    • standalone client, can be built by extending from udig. udig is an eclipse RCP application!

    Tuesday, March 27, 2007

    my blog can't access again from china

    Since i am maintain this blog from china. looks like blogger has been blocked in china.

    I know google will be blocked some time, and it will last for one or two days in the worst case.
    But the blogger is down for a week.

    The temp solution is:
    add '72.14.219.190 johnsonsoultions.blogspot.com' to
    c:\windows\system32\drivers\etc\hosts file

    More detail about that:
    if you do nslookup for johnsonsolutins.blogspot.com,
    you will get the ipaddress from dns as
    72.14.207.191

    But if you tracert for that ip, you will find it has been locked at chinese operator before going to the outside world.

    We can't do anything here, just wait......

    Tuesday, March 20, 2007

    McAfee VirusScan Enterprise block irc by default

    Was trying to add eclipse irc today. got error when try to connect to serverr.
    Finally found out that the McAfee VirusScan is blocking IRC protocol by default.

    Enable it, then reconnect, everything works fine now.

    What is the point to block IRC?
    It is sound quite safe to me, need to check the risk later on.

    Wednesday, February 28, 2007

    Goolgle site itself is not robot friendly

    Just checked
    google site search engine setting

    It is 1st search engine in the world, but it only allow other agent to read from news.
    Really Funny!!!

    User-agent: *
    Allow: /searchhistory/
    Disallow: /news?output=xhtml&
    Allow: /news?output=xhtml
    Disallow: /search
    Disallow: /groups
    Disallow: /images
    Disallow: /catalogs
    Disallow: /catalogues
    Disallow: /news
    Disallow: /nwshp

    ...

    Tuesday, February 27, 2007

    Add Google Analytics to your Blogger

    Since the blogspot doesn't provide traffic monitor by default. need to install some counters by youself.

    I found the easy way is to use Google Analytics.
    But the problem is, you need to register on google analytics first,
    then login to blogger to update the template manually.

    Need to check if the process can be done automatically from script.
    Since they share same google id anyway.
    Can you modify blog template using GData API?

    Need to check it out this week!

    Disable Flash plugin on Firefox

    I don't like most flash from internet.
    Since the took at least 50% CPU from my computer.
    So i installed the flashblocker, that will not download
    flash content by default at all. You can click the empty picture to
    enable the flash when needed.

    FlashBlocker

    There is also a similar one called AdsBlock. one guy said it is event better than flashblocker

    Wednesday, February 7, 2007

    msnim in HTML code

    Here are some new Hyperlink Command Codes for MSN IM

    1. msnim:add - Allow your visitors to add you to their MSN contacts immediately. Example: Add me to your MSN Messenger contact list
    2. msnim:chat - Clicking this link will open a conversation with email@address.com and allows instant chatting. Example: Click here to chat
    3. msnim:voice - Allow your visitors to start Voice chatting with you in just one click. Example: Start a Voice chat with me
    4. msnim:video - Launches a Video conversation straight from a web page. Example: Start a Video chat with me.

    Friday, January 5, 2007

    Google Desktop Hack -- add two clocks for two different timezones


    Just hacked the Google Desktop to start two clocks for two different time zooms.
    I need this feature really hard, since some of my co-workers are located in Dublin office (8 hours from my time).
    Do not need to calculate the time difference by myself anymore!

    I will become an idiot one day since i am more and more depending on computers to do all stuff.
    Anyway, check out my current desktop screen shot.