Category Archives: unix-linux

Dropbox icon is not working Xubuntu 16.04 LTS

After upgrading to Xubuntu 16.04, I found that the dropbox icon stopped working. The icon is black with a red slashed zero. I cannot click on it to bring up the dropbox menu.

The reason is that Dropbox starts to use “indicator area” for their tray icon instead of “notification area”. The problem can be fixed by running

$ dropbox stop && DBUS_SESSION_BUS_ADDRESS="" dropbox start

or

$ dropbox stop && dbus-launch dropbox start

How to convert sourcecode to HTML, RTF, SVG, etc.

I am working on my paper which needs a piece of XML to syntax highlighted. I’ve found Sublime with “Copy as RTF” plugins is useful, but as a programmer I prefer something that being done via commend line, and more importantly being easily customizable.

So I did a some searches and came across highlight. To install it on Ubuntu is quite simple

sudo apt-get install highlight

Then I can use highlight to convert the XML file to RTF and copy it to the paper I am working on. read more

How to view differences of branches with meld?

git-meld is a git command that allows you to compare and edit treeishs between revisions using meld or any other diff tool that supports directory comparison. git meld is a frontend to git diff and accepts the same options and arguments.

It is essentially an extended git-difftool for tools that support comparing directories rather than having git call the external tool for every file that has changed. read more

Correct/Repeat the last command under Bash

If you often type the wrong command (or repeat the simmilar commends) under bash shell (like me), you may need to read this post:

cp file1.txt /path/to/dst
cp file1.a1 /path/to/dst
cp file1.a2 /path/to/dst

Substitute the first occurrence

How do I replace .txt with a1 and a2 and repeat the last command? The syntax is as follows for quick substitution and repeat the last command, replacing WORD1 with WORD2: read more

Proxy Firefox through a SSH tunnel

Have you ever wanted to visit sites during the day from a location that denied access to those sites? What you need is the ability to create a secure and encrypted ssh connection to tunnel your browser traffic through. If you have access to a remote machine by way of ssh, you can set up Firefox to visit these sites.

The following method is only tested on Windows XP, with cygwin installed.

LOCAL_PORT: localhost port for ssh tunnel
SERVER_NAME: remote machine

  1. set up firefox proxy
    • preferences –> advanced –> network –> settings
    • choose SOCKS v5
    • manual proxy configurations: SOCKS
      • Host: 127.0.0.1:LOCAL_PORT
      • No Proxy for: localhost, 127.0.0.1
      • leave the rest of entries BLANK
  2. set up firefox DNS
    • open “about:config” page in Firefox
    • search “network.proxy.socks_remote_dns”, set the value to “true”
  3. establish ssh tunnel

ssh -C2qTnN -D LOCAL_PORT username@SERVER_NAME read more

dpkg: error processing tex-common

Got the problem while installing latex-cjk-chinese

fmtutil-sys failed. Output has been stored in
/tmp/fmtutil.t6EnBlWW
Please include this file if you report a bug.

dpkg: error processing tex-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tex-common
E: Sub-process /usr/bin/dpkg returned an error code (1)

After checking the file fmtutil.t6EnBlWW, I find the problem is

! I can’t find file `loadhyph-zh-latn.tex’. This is due to the inconsistence between texlive 2011 and tex2012. In tex2012, the file is renamed to `loadhyph-zh-latn-pinyin.tex’. Therefore, the solution is

  • go to /etc/texmf/hyphen.d
  • change loadhyph-zh-latn.tex to loadhyph-zh-latn-pinyin.tex
  • reinstall tex-common
  • read more

    How to fix Gedit LaTex Plugin error while saving BibTex

    Gedit (3.4.1) gives the error below while saving a BibTex file (Ubuntu 12.04). The saving works fine, apart from the error popping up.

    'bibtex-error'
    
      Traceback (most recent call last):
      File "/usr/lib/gedit/plugins/latex/util.py", line 116, in decorated_function
      return function(*args, **kw)
      File "/usr/lib/gedit/plugins/latex/bibtex/editor.py", line 141, in __parse
      self.remove_markers("bibtex-error")
      File "/usr/lib/gedit/plugins/latex/editor.py", line 493, in remove_markers
      type_record = self._marker_types[marker_type]
      KeyError: 'bibtex-error'
    

    How to fix it?