How to force yum not to update certain packages, such as kernel? I manually compiled a kernel module for a specific kernel version. As long as it works well, I do not want to update it. Another example is that I want a specific version of sbt. How to force yum exclude it from being
Read more
Tag: Tutorial
Git branching tutorial
Posted onGood tutorials on git branching. The “Git Branching” chapter of Pro Git book is the best one that I ever seen: http://git-scm.com/book/en/Git-Branching It deserve the time to study the whole chapter. If you are working with a git server, this chapter is especially useful: http://git-scm.com/book/en/Git-Branching-Remote-Branches
How to Wrap and NOT Wrap Lines in vim
Posted onHow to Wrap and NOT Wrap Lines in vim? Make vim wrap lines: :set wrap For not wrap which will be useful when reading some data result such as logs: :set nowrap It can also be written into the .vimrc config files
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
How to make thunderbird not wrap lines automatically?
Posted onHow to make thunderbird not wrap lines automatically? Check Making Thunderbird Not Wrap Lines Automatically: Setting mail.compose.wrap_to_window_width to true.
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
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
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
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
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
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
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 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.
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 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 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 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 get the git commit tree?
Posted onHow to get a tree-like view of the git commit history? My favorite command line: git log –graph –oneline It will prints a text based graph like (with colors): * b5dc8b9 Merge branch ‘master’ of https://github.com/layerzero/libi0 | | * 7514ef1 revised the README.md a little bit | * 6692428 align size to page for both
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 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