Category: Working

工作工作

  • Got a T420

    Since the T410 is used for nearly four years and there is a chance to get a newer machine, I got a second hand T420 yesterday. It is pretty much like T410. So I decided to switch the HD, the Ubuntu 12.04 is working fine with it.

    The only thing I need to do is change the device MAC address to fit the current machine.

  • PuTTY and VT100 box-drawing character

    Refer to this link: Making 256-color AND Line drawing characters both work in PuTTY

    Add this into your .bashrc:

    export NCURSES_NO_UTF8_ACS=1

    Then re-login.

    If you want to keep this when using sudo, add this into your /etc/sudoers:
    Defaults env_keep += "NCURSES_NO_UTF8_ACS"

    Then restart the sudo service.

  • Take a screen shot under Firefox

    It’s very easy when Firefox provides Developer Toolbar. I’m using Firefox esr 24.3.0.

    Steps:
    Launch it. Firefox > Web Developer > Developer Toolbar
    Input this command to take a full-page screen shot then copy to clipboard:

    >>screenshot --clipboard --fullpage
  • enable NOPASSWD for yourself

    I have some bash scripts which I manually run a lot and they need to run with sudo. I also don’t want to be prompted for any password. Here is the solution.

    1. Edit the /etc/sudoers:
      $ sudo vi /etc/sudoers
    2. Add a new entry at the last (USERNAME is your account name).
      # User privilege specification
      root    ALL=(ALL:ALL) ALL
      
      # Members of the admin group may gain root privileges
      %admin ALL=(ALL) ALL
      
      # Allow members of group sudo to execute any command
      %sudo   ALL=(ALL:ALL) ALL
      USERNAME        ALL=(ALL:ALL)   NOPASSWD:ALL
      
      # See sudoers(5) for more information on "#include" directives:
      
      #includedir /etc/sudoers.d
      
    3. Restart the sudo service.
      $ sudo service sudo restart
    4. Logout then login again. You won’t be prompted for the password anymore.
  • Handle notes:// link in Firefox

    It’s very easy after googling…

    $ cd /usr/share/applications
    $ sudo cp LotusNotes8.5.desktop LotusNotes8.5-url.desktop
    $ sudo vi LotusNotes8.5-url.desktop

    The example:

    [Desktop Entry]
    Encoding=UTF-8
    Name=Lotus Notes 8.5 Url
    Type=Application
    Exec=/opt/ibm/lotus/notes/framework/../notes-wrapper %u
    Icon=/opt/ibm/lotus/notes/framework/shared/eclipse/features/com.ibm.notes.links.feature_8.5.4.20120906-1255/icons/notes.ico
    Terminal=false
    MimeType=x-scheme-handler/notes
    Categories=Application;Office;
    NoDisplay=true

    $ sudo update-desktop-database

    Versions:

    • Ubuntu 12.04.2 LTS x86_64
    • IBM Lotus Notes 8.5.4 x86

    Reference: Comment 2 for bug 788673 – unable to open link with custom url-handlers