User Tools

Site Tools


LyX on Mac error converting to loadable format

When installing LyX on Mac, one might experience the error “error converting to loadable format” when including pdf files. This is likely because of missing of ImageMagick. To fix the problem, you will need to install ImageMagick. To do it, the following steps need to follow.

  1. Install Xcode from App store.
  2. Once you have Xcode installed, open a terminal, run xcode-select –install, and click the Install button to install the required command line developer tools.
  3. Install ImageMagick using sudo port install ImageMagick in terminal
2016/03/29 13:18 · johnny · 0 Comments · 0 Linkbacks

Delete large number of files

I had to delete thousands of files. The command “rm” simply took forever. Then I learned you can use rsync to do the job.

First, create an empty directory such as

mkdir empty

Then, rsync it with the folder you want to delete using

rsync -av --delete empty/    todelete/

This is super fast comparing to rm.

Using perl

perl -e 'for(<*>){((stat)[9]<(unlink))}'
2016/02/03 10:39 · johnny · 0 Comments · 0 Linkbacks

Record desktop videos using VLC media player

To record mouse, add the following options instead

:screen-follow-mouse :screen-mouse-image=file:///C:/Users/Pictures/Mouse.png
2015/09/11 13:52 · johnny · 0 Comments · 0 Linkbacks

Integrate Mathjax with Gitlab

A quick (not the best way, though) way to integrate Mathjax with Gitlab. Tested on Gitlab 7.9.4 and Gitlab shell 2.6.0.

Create the file /home/git/gitlab/app/views/layouts/_mathjax.html.haml, e.g.,

sudo -u git nano /home/git/gitlab/app/views/layouts/_mathjax.html.haml

with the following content

  (function() {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;
    ga.src = ('');
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

Then edit the file _head.html.haml

sudo -u git nano /home/git/gitlab/app/views/layouts/_head.html.haml

and change to the following (the first line already existed and the second line was newly added:

= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
= render 'layouts/mathjax'

Note one can control the use of mathjax just like the use of piwik.

Then restart gitlab using

sudo service gitlab restart
2015/04/07 21:29 · johnny · 0 Comments · 0 Linkbacks

<< Newer entries | Older entries >>

Blog History

Note. Everything on this blog only reflects my personal view which may or may not be true and is not related to any organization or institute.

Page Tools