How to make thunderbird not wrap lines automatically? Check Making Thunderbird Not Wrap Lines Automatically: Setting mail.compose.wrap_to_window_width to true.
Author: Eric Ma
Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.Formatting code shortcuts in Eclipse
Posted onFormatting code shortcuts in Eclipse. Shortcut: Ctrl + Shift + F No need to select the code.
Add my own window.onload safely without overwriting old ones
Posted onMy webpage has one existing window.onload javascript function defined by a javascript plugin in the <head> section. Now, I defined a new one and add it to the end of the HTML page: <script type=”text/javascript”> window.onload = function () { // great work here } </script> I find the new one overwrites the old one
Read more
Running Chrome over SSH tunnel
Posted onHow to run Chrome on remote host over a SSH tunnel? This way, I can access resource that can only be accessed inside the remote host’s network. Running Chrome over a SSH tunnel is much easier than running Firefox over SSH from a Linux host: First, ssh to the remote host with -X option: ssh
Read more
Emacs highlighting part of lines that go over 80 chars
Posted onHow to make Emacs highlighting part of lines that go over 80 chars? I use the whitespace mode: ;; `lines-tail`, highlight the part that goes beyond the ;; limit of `whitespace-line-column` (require ‘whitespace) (setq whitespace-style ‘(face empty tabs lines-tail trailing)) (global-whitespace-mode t) More: https://github.com/zma/emacs-config/blob/master/.emacs Alternatively, you can run highlight-lines-matching-regexp with the expression .{81}. http://stackoverflow.com/questions/6344474/how-can-i-make-emacs-highlight-lines-that-go-over-80-chars
How to force ibus to restart in Gnome 3?
Posted onHow to force ibus to restart in Gnome 3? There used to be a menu. But it does not provide the restart option anymore. To kill current ibus daemon: pkill -o ibus-daemon To start a new ibus daemon in Gnome 3, run this command in “Enter a command” tool by Alt+F2: /usr/bin/ibus-daemon –replace –xim –panel
Read more
Changing a git commit message after I have pushed it to the server?
Posted onHow to change a wrong git commit message after I have pushed it to the server? If the remote repository is shared with others, it is better to let the wrong git commit message there. If you use the repository by your own and you are sure that no one else has pulled your latest
Read more
Printing a file in hexadecimal format of all content on Linux?
Posted onHow to print a binary file in hexadecimal format of all content? Use xxd: xxd file.txt or xxd -p file.txt
How to install IE under wine on Linux?
Posted onHow to install IE under wine on Linux? Just need it for some testing. Do not want to reboot to Windows. We ever had ies4linux. But it is obsoleted now. linie is the latest effort. But there are issues and you may need to fix some problems by yourself. Installing a Windows VM may be
Read more
Replacing tabs with spaces in Emacs
Posted onHow to replace tabs with spaces in Emacs? You can first select the regions of text for converting/replacing, then run M-x untabify to replace all tabs with appropriate number of spaces. There is also a M-x tabify for replacing sequences of spaces to tabs. There are also commands to convert tabs to spaces or vice
Read more
How to play .swf files on Linux?
Posted onHow to play the flash (.swf) files downloaded from the Web on Linux? The best solution that I find to play .swf files on Linux is run Adobe Flash Player Projector (download from here, a single .EXE file) and run it under wine.
How to convert between dos and unix file coding in Emacs?
Posted onHow to convert between dos and unix file coding for files in Emacs? From Dos to Unix coding: M-x set-buffer-file-coding-system RET undecided-unix or C-x RET f undecided-unix Then save the file (C-x C-s). From Unix to Dos M-x set-buffer-file-coding-system RET undecided-dos or C-x RET f undecided-dos Then save the file (C-x C-s).
How to sort a file by hexadecimal numbers on Linux using sort command?
Posted onThe sort command has a -n option to sort a file by numbers. However, it does not work with hexadecimal numbers. For example, this file: 400000000 __crt0 400000039 __newr0 400001B14 get_my_task_id 400001C14 get_new_task_id 400001582 input_char 40000166E input_q 400001A5D input_q_exit 400002002 main 4000000DB output_char 400001134 output_char_str 40000100C output_id 40000018F output_q 400000614 output_q_digits 400000B7E output_q_hex 400000D3E output_q_hex_j1
Read more
How to print the name of the current file being edited in Emacs?
Posted onIn Emacs, how to print the name of the current file that I am editing? The built-in function buffer-file-name gives the full path of your file. To get the file name: M-: buffer-file-name
How to compress lists of consecutive citation numbers to one range in Latex?
Posted onHow to compress lists of consecutive citation numbers to one number range in Latex? For example, change [14], [15], [16], [17], [19] to [14-17], [19] That will save some space for the paper/document written in latex. The cite package is great from my experience. You just need to add usepackage{cite} in the document’s preamble and
Read more
How to exclude users from GDM login screen?
Posted onHow to exclude users from appearing in the GDM login screen of Gnome 3? There is a long-time bug related to this ( https://bugzilla.redhat.com/show_bug.cgi?id=723708 ) which causes that the /etc/gdm/custom.conf has no effect. The closes workaround I find working on Fedora 20 is to totally disable listing of users (run as root): cat > /etc/dconf/db/gdm.d/01-mysettings
Read more
How to flush a cached redirect by Chrome?
Posted onChrome caches redirects. How to flush a cached redirect by Chrome? Clearing the cache/cookies for the specific domain (sorry, it is the domain level in this solution) as in https://www.systutorials.com/qa/453/how-to-remove-cookies-for-a-certain-site-in-chrome will also flush the redirect caches for this domain.
How to fetch a webpage as a mobile browser with curl on Linux?
Posted onOn Linux, how to download a webpage as a mobile browser? You can change the agent of curl to be a mobile browser’s and the remote webserver may be consider the request from a mobile browser: curl -A “Mozilla/5.0 (iPhone; CPU iPhone OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/28.0.1500.12 Mobile/10B329 Safari/8536.25”
Read more
How to allow pre tag in WordPress comments?
Posted onHow to allow pre tag in WordPress comments? You can add a filter hook for pre_comment_approved: <?php function filter_handler( $approved , $commentdata ) { // inspect $commentdata to determine approval, disapproval, or spam status return $approved; } add_filter( ‘pre_comment_approved’ , ‘filter_handler’ , ’99’, 2 ); ?> Reference: https://codex.wordpress.org/Plugin_API/Filter_Reference/pre_comment_approved
How to disable the email notification by crond?
Posted oncrond sends email notifications automatically. However, these emails are not needed. How to disabled it? If your command does not anything printed to STDOUT or STDERR, there is not emails send. You can redirect 2 and 1 to /dev/null at the end of your command. You can also set the MAILTO variable to empty by
Read more