Category: Office

  • 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

  • Two python versions in system

    We have some python scripts for scheduled jobs. They are moved from a old machine and work very well automatically and manually. When we moved them to another machine, manually run them works fine. But they don’t work when we put them in corn.

    After some search, there are two python versions in system. One is in /usr/bin and another one is in /usr/local/bin. Hmmm… That’s $PATH problem!

    In bash shell, when we run the scripts manually, they are run by /usr/local/bin/python.

    In cron, they are run by /usr/bin/python. Unfortunately, this version is too old to be compatible with our scripts.

  • Install Eclipse on Ubuntu

    Eclipse Kepler (4.3) is released on June 16, 2013. I want to try it on my Ubuntu 12.04 LTS. Follow these steps for the installation:

    1. Download Eclipse from eclipse.org
    2. Extract the eclipse-xxx-xxx-xxx-linux-gtk-x86_64.tar.gz using
      tar -zxvf eclipse-xxx-xxx-xxx-linux-gtk-x86_64.tar.gz
      
    3. Switch to root
      sudo -i
      
    4. Copy extracted folder to /opt and rename to eclipse_kepler
      cp -r eclipse /opt/eclipse_kepler
      
    5. Create a desktop file and install it.
      gedit eclipse_kepler.desktop
      

      The content of eclipse_kepler.desktop:

      [Desktop Entry]
      Name=Eclipse 
      Type=Application
      Exec=/opt/eclipse_kepler/eclipse
      Terminal=false
      Icon=/opt/eclipse_kepler/icon.xpm
      Comment=Integrated Development Environment
      NoDisplay=false
      Categories=Development;IDE
      Name[en]=Eclipse Kepler
      

      Execute the following command to install it in the unity:

      desktop-file-install eclipse_kepler.desktop
    6. Create a symlink in /usr/local/bin using
      cd /usr/local/bin
      ln -s /opt/eclipse_kepler/eclipse
      
    7. Integrate the Eclipse menu in Unity top panel using
      cd /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/menuproxies && sudo sed -i 's/Eclipse/Xclipse/' libappmenu.so
      
    8. Launch Eclipse
      /opt/eclipse_kepler/eclipse -clean &
      
    9. Lock Eclipse to the launcher bar by clicking right button on Lock to Launcher

    Reference:

  • Hide Users on Welcome Screen in Windows

    If you create some local user accounts in Windows for providing some services, but don’t want to let them show in Welcome Screen. You can add some settings in Windows Registry.

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList]
    "cyg_server"=dword:00000000
    
    

    I have tried this in Windows 7 and Windows 2008 R2. It works.
    Google reference: “Hide Users on Welcome Screen in Windows”.