Category: Office

  • Resize Launcher in Unity 2D

    I twittered about the memory usage is fat in Unity 3D. Although my T410 works fine. I still want to try to switch to Unity 2D. After that, the default icon in launcher is too large (48×48) as in Unity 3D. But the rezise bar in Appearance is gone. 

    See the reference post for how to do it.

    Reference: How to resize Launcher in Unity 2D.

  • Markdown in Notepad++ with Perl/Cygwin

    Notepad++ is my primary text editor in Windows and I also have Perl installed in Cygwin.
    To Markdown files under Notepad++ with NppExec plugin, I use following scripts:

    A bash shell script to call Markdown.pl:

    #!/bin/bash
    #c:\cygwin\bin\bash.exe -l "/cygdrive/c/cygwin/home/$USER/Markdown.sh" "$(FULL_CURRENT_PATH)" $(CURRENT_DIRECTORY) $(NAME_PART)
    current_path=<code>cygpath -u $1</code>
    current_dir=<code>cygpath -u $2</code>
    out_file=$current_dir/$3.html
    echo &quot;Markdowning file: &quot;$current_path
    ~/Markdown_1.0.1/Markdown.pl &quot;$current_path&quot; &gt; &quot;$out_file&quot;
    echo &quot;Result file: &quot;$out_file

    The NppExec script:

    c:\cygwin\bin\bash.exe -l &quot;/cygdrive/c/cygwin/home/$(SYS.USERNAME)/Markdown.sh&quot; &quot;$(FULL_CURRENT_PATH)&quot; &quot;$(CURRENT_DIRECTORY)&quot; &quot;$(NAME_PART)&quot;
    NPP_OPEN $(CURRENT_DIRECTORY)\$(NAME_PART).html
    

    The HTML will be opened in Notepad++. I didn’t try to find a way to open it in browser directly yet.

    Reference post: “Markdown in Notepad++

  • Remove unused Linux kernel related packages

    There is a very simple command:

    dpkg -l 'linux-<em>' | sed '/^ii/!d;/'&quot;$(uname -r | sed &quot;s/&#40;.</em>&#41;-&#40;[^0-9]&#43;&#41;/\1/&quot;)&quot;'/d;s/^[^ ]* [^ ]* &#40;[^ ]<em>&#41;.</em>/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

    From “Ubuntu Cleanup: How to Remove All Unused Linux Kernel Headers, Images and Modules

  • Get rid of watchdog error

    When waking from suspend, there are 3 error messages appear about Watchdog:
    [63660.938812] watchdog: only one watchdog can use /dev/watchdog.
    [63660.938816] watchdog: error registering /dev/watchdog (err=-16).
    [63660.938819] mei: unable to register watchdog device.

    The solution is:
    sudo gedit /etc/modprobe.d/blacklist.conf
    add the line:
    blacklist mei
    Save and reboot.

    Reference: Watchdog Error Message?

  • Compact a VM Disk Image

    My Windows 7 desktop complained the disk space usage is near to 90%. After checked my Ubuntu VM, its virtual disk expands to around 200G although it only contains around 100G data.

    So I googled some posts which have instructions:

    After compacted the VDI file, my desktop has more 100G free space now.

    Reboot the Ubuntu VM, and it shows a message:
    mountall: disconnected from Plymouth

    Google again. The swap partition is not mounted correctly. Use following command to check it:

    free -m

    The total of swap is 0.

    Try some commands from “Mountall fails on startup“, then the swap is back and the message is gone.

    Final step, there is a very large hiberfil.sys file and I let my desktop keep awake for a long time. I think I don’t need hibernation, so I disable it by following article, “How to disable and re-enable hibernation on a computer that is running Windows“.