12/08/2018, 14:15

Ubuntu: know your tools

Nowadays, Ubuntu is becoming more and more popular and easier to use. It is now the main operating system of not only programmers but also normal users. In this article, I just want to share some trick and tools I often use, hope it help you to work more effectively. 1. Screenshot, screen ...

Nowadays, Ubuntu is becoming more and more popular and easier to use. It is now the main operating system of not only programmers but also normal users. In this article, I just want to share some trick and tools I often use, hope it help you to work more effectively.

1. Screenshot, screen recorder tools

Ubuntu has built-in application called Screenshot help you to capture your screen. You can open the application by searching in Dash or access its functionalities by keyboard shortcuts:

  • Prt Scrn capture full screen
  • Alt + Prt Scrn capture active opening window
  • Shift + Prt Scrn select capture area by mouse

By default, after capturing screen a dialog will open to ask you what to do with captured image, save or copy it. You can use the Ctrl key combined with these keyboard shorcuts to auto copy it to clipboard.

If the default app is not enough for you, you can try following applications:

  • shutter: best screenshot tool for Ubuntu, it provide many additional features such as upload image, built-in edit tool, hightlight,... You can install it in Softwate Center
  • peek is a tool for recored screen to a gif image
  • Other tools like gyazo, imgur-screenshot or gnome-shell-imgur help you auto upload image to Internet and copy link for you to share with others.
  • Screen recorder tools:
    • kazam, recordmydesktop, SimpleScreenRecorder
    • screenkey helps display your keys you are typing on the desktop

2. Messages filtering with Thunderbird

Messages filter can be done in some mail servers such as Gmail. However, if you use custom mail server and it doesn't support for filtering messages, you can do it with Thunderbird mail client. It helps you organize messages better and avoid lacking important mail.

The feature is so easy to use, you just open Message Filters menu and define the rules to filter emails. You may need to create a folder for filtered emails before defining the rules.

For example: the following rule I defined to move emails from Chatwork to Chatwork folder automatically.

df868a21f3db113027ebb3bbaf8b6b46b86f713f.png

3. Google translate in GoldenDict

GoldenDict is an awesome dictionary application. It supports many language, many type of dictionary, such as dictionary file, from website or from other applications. However, most of dictionaries are only support translate single word.

In this article, I will show you a way to get translation from Google translate by writing custom program that work with GoldenDict.

  • Step 1. Add an external program as dictionary in GoldenDict

    Open GoldenDict, then go to menu Edit -> Dictionaries và and add new programm as follow:

    Screenshot from 2016-11-24 17-21-04.png

  • Step 2. Writing translation program: program receives input original text from Goldendict and output translated text.

    • The program using Google translate API: http://translate.googleapis.com/translate_a/single?client=gtx&sl=auto&tl=en&dt=t&ie=UTF-8&oe=UTF-8&q=Xin chào

      • sl: source language, auto or language code
      • tl: target language code
      • q: text to be translated, can input in the above url or input via form data (HTTP POST)
    • Response format

      [[["Hello","Xin chào",,,1]],,"vi",,,,0.67846733,,[["vi"],,[0.67846733],["vi"]]]
      

      Or

      [
          [
              ["We updated the voice blog "Monsters at 3 o'clock AM".
      
      ","ボイスブログ「午前三時の独壇場」を更新しました。
      
      ",,,3],
              ["This week is the 100th entrance","今週は第参百弐拾参場",,,3]
          ],,"ja",,,,0.96649998,,[["ja"],,[0.96649998],["ja"]]
      ]
      
    • Write program that call the service api and parse the response

      There is a example program that written in Bash script here. However, it strip all new lines, and I feel not happy, so I rewrite it in PHP (and of course you need install PHP or write your own program             </div>
            
            <div class=

0