How to efficiently print a webpage? E.g. I want to only print the text for some pages but with figures for some other pages. I tried to copy the webpage to a document, but the format turns to be just terrible. One good tool that I use is PrinterFriendly which can convert a webpage to
Read more
Tag: Git
Tutorials and howtos on git configuration and usage.
Single sign-in for social accounts for question2answer?
Posted onHow to enable single sign-in for social accounts for question2answer? These servers are required: Google, Facebook, Twitter, OpenID. This site moved from Loginza to Question2Answer Open Login which works like a charm. I use the Loginza and it works very well. For Q2A, SLonoed wrote a nice plugin for loginza. How to use it: Download
Read more
How to merge a commit from another branch to my current branch in git?
Posted onI have 2 branches: dev and master. I have commits in dev like this: c0–>c1–>c2–>c3–>c4 Commits in master like this: c0–>c5–>c6 c2 and c3 fix a bug. Now, I want to merge commit c2 and c3 that fix the bug to the master branch, but I do not want to merge all the commits (e.g.
Read more
How to revert a merge in Git
Posted onI merge a branch, say b1, from another branch, say b2. Both b1 and b2 have some commits. Say, b1: c1 —> c2 —> c3 b2: c1 —> c4 —> c5 Now, if I merge b2 to b1 and there is no conflicts, b1’s history includes b2’s commits (c4, c5). How to revert this merge
Read more
svn: how to clean up my repository directory?
Posted onI have a local svn repository. I work in the repository, e.g. compiling latex documents and building software packages, and there are many useless temporary files there. How can I clean it up by automatically clean these temporary files like the git clean -f in git? svn seems has no built-in function for this. But
Read more
Git: setting a local branch’s upstream tracking branch
Posted onHow to set a local branch’s upstream tracking branch in git? For example, I want to track remote repository ‘origin’ ‘s branch ‘demo’ with the local ‘demo’ branch. You can set tracking information for the current branch (say cur_branch) of upstream branch (say also cur_branch) in remote repository origin with: git branch –set-upstream cur_branch origin/cur_branch
Disable WordPress Built-in Canonical URL link tag in HTML head
Posted onThe built-in canonical URL function since WordPress 2.9 is great. But under some situation, it is not needed. For example, all the Mingle Forum threads’ canonical URL is set to the URL of the page that contains the [mingleforum] shortcode, which, of course, is wrong. How to diabled it? We can disabled WordPress’s Built-in Canonical
Read more
Synchronizing home directories
Posted onAny good tools to synchronize home directories on Linux boxes? Many have several PC/laptops and consequently many home directories. There is home directory synchronizing problem. unison is a good tool to do this: http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#rshmeth http://www.watzmann.net/blog/2009/02/my-homedirs-in-unison.html http://www.cis.upenn.edu/~bcpierce/papers/index.shtml#File%20Synchronization Useful script: $ unison -batch -ui text ./ /mnt/homebak/zma/ In text user interface, synchronizing two directories in batch mode
Read more
Git: changing global user name and user email
Posted onHow to set the global user name and user email for git? We may be asked to set our global user name and user email if it is the first time that we use git on a machine: Your name and email address were configured automatically based on your username and hostname. Please check that
Read more
SEEK_HOLE and SEEK_DATA: efficiently archive/copy large sparse files
Posted onHow to efficiently archive a very large sparse file, say 1TB? The sparse file may contains a small amount of data, say 32MB. SEEK_HOLE and SEEK_DATA The SEEK_HOLE/SEEK_DATA functionalities play the trick and makes `tar` and `cp` handle the large sparse file very efficiently. `lseek` with `SEEK_HOLE` returns the offset of the start of the
Read more
I/O Microscopy: Tasks’ Disk I/O Information with High Accuracy
Posted onAbstract Most popular task monitor systems (such as top, iotop, proc, etc) can only get tasks’ disk I/O information like tasks’ I/O utilization percentage every seconds due to kernel timer/tick frequency and high time cost of system interfaces. This article presents I/O Microscopy, a new way to get tasks’ disk I/O information with high accuracy.
Read more
How to Disable and Enable Laptop Keyboard for X.org Server in Linux
Posted onAttaching a USB keyboard to a laptop is common when using a laptop because a normal keyboard may provide a more convenient typing experience. The laptop keyboard is not used in these situations. However, the laptop keyboard may still be touched by accident. In this post, we will discuss how to disable and enable the
Read more
How to Configure the Latest Version of Flash on Firefox for Linux: by the Fresh Player Plugin
Posted onAs you may know, Adobe stopped supporting the NPAPI version of Flash on Linux and the latest NPAPI version of Flash player at version 11.2 released back in 2012 will only receive security fixes. Even the security fixes to the 11.2 version of the Flash Plugin your Firefox is using will end on May 4,
Read more
Git Merging FAQs
Posted ongit merge is frequently used during development of projects managed by git. There are many common questions about git merge and I find most are solved and discussed on StackOverflow. Here, I summarize useful ones so that others who want to learn git merge need to do the search again. Merge, rebase, fast forward and
Read more
Cheatsheet: Git Branching with a Git Server
Posted onIt is common to set up git servers to host git repositories. Branching is lightweight in git and a very friendly mechanism to manage code. Here, I summarize a cheatsheet of common git branching commands for working on repositories from a git server. This post assumes that you have basic knowledge with git. If you
Read more
Useful Git Submodule Commands
Posted ongit submodule is a very useful tools in git to include other git repositories in one repository to handle cases such as library dependencies. In this post, I summarize some commonly used commands that I find useful for working with git submodule. For the list of full commands, check the git submodule manual. Add a
Read more
Git through SSH Tunnel as Proxy
Posted ongit is a great tool and it is common to have a git server over SSH possibly managed by gitolite. However, there are situations that we can not directly connect to the git server but be able to SSH to another node that can connect to the git server. The git server may allow only
Read more
Vim Howtos and Tips
Posted onVim is a fast and handy editor on *nix systems. Like Emacs, Vim has a steep learning curve as you get constantly get new things. However, the effort deserves it as you efficiency is highly improved. Here, I summarize the tips and howtos I learned using Vim. Some previous posts on vim are tagged with
Read more
How to Set Up Git Commit Email Notifications
Posted onA method to send email notification to a list of email addresses by the remote git server after every push from the client will be introduced in this post. An example notification email after a commit is shown in the figure below. The subject contains a prefix, the repository name, the branch name and the
Read more
How to Set Up A Gitolite Git Server – A Ten-Minute Tutorial
Posted onI ever introduced seting up git server using SSH or gitosis. However, gitolite is the way to go for managing git servers if you want an lightweight authentication layer. gitolite provides many very usefull features which can control each user’s right on each branch. I set up one gitolite git server and am very happy
Read more