How to add the social share icons to q2a as shown in this site? This site uses the Question2Answer Share plugin: https://github.com/NoahY/q2a-share After installing the plugin by downloading and copying the directory for the plugin to the qa-plugin directory, you can select the networks to share to in ‘Admin -> Plugins’. I see. Thanks!
Author: Q A
New Mingle Forum Class
Posted onHi , Thank you for your recommendation for removing the canonical link for the forum page only. However, I am am not able to find the following code in the wpf.class.php and was hoping you let us know where we can find this class so that we can modify it accordingly. (Does -1260 refer to
Read more
Statically linking C and C++ programs
Posted onHow to statically compile C and C++ projects? The compiled executable should lead no dynamical library during execution. I use gcc/g++ to compile the projects. Check this post: Statically Linking C and C++ Programs on Linux with gcc.
WordPress: How to use Markdown for writing posts
Posted onI like the Markdown editor whick is widely used (e.g. This site) and very convenient to use. How to add a Markdown editor for WordPress? I tried some plugins and find they have their strengthens and disadvantages. Here are my requirements: Compatible with my existing posts. They should still display well. I can accept minimum
Read more
Q2A: making the main content div appear before the side panel
Posted onAfter checking the Question2Answer pages’ HTML code, I find that the main div comes after the side panel. How to revert the position of the main div and side panel div? Makes the main content come first in the HTML. You can change the displaying order by overwriting the body_content() function in the theme (that
Read more
Q2A: How to enable Sina Weibo and Tencent QQ account log in?
Posted onIn Question2Answer, how to enable Sina Weibo and Tencent QQ account log in? Use the Social Plugin for Sina Weibo and Tencent QQ (in Chinese): http://q2achina.sinaapp.com/blog/archives/22/ The websites to apply for the app: Weibo: http://open.weibo.com/ QQ: http://connect.qq.com/
How to activate or deactivate a Linux host with Gnome remotely?
Posted onI have a Fedora Linux server with Gnome 3. I want to lock / unlock the remote Gnome desktop remotely. How to activate or deactivate it remotely through SSH? Use gnome-screensaver-command. It is not specific to Gnome 3. Turn the screensaver on (blank the screen): $ gnome-screensaver-command -a If the screensaver is active then deactivate
Read more
How to change the audio track for .mkv files in mplayer?
Posted onHow to change the audio track for .mkv files in mplayer? Key shortcut: # (dvd, mpeg, matroska, avi and libavformat only) cycle through the available audio tracks. tab (mpeg-ts and libavformat only) More: https://www.systutorials.com/b/linux/663/mostly-used-mplayer-keyboard-control/
How to set up proxy over SSH on Windows?
Posted onThis tutorial teaches how to set up SSH proxy on Linux. How to set up one proxy over SSH on Windows? A tutorial of using SSH tunnel as the proxy on Windows is introduced here: https://www.systutorials.com/tutorial/4696/software/proxy-using-ssh-tunnel-on-windows/
Chrome reports “Adobe Flash Player was blocked because it is out of date.”
Posted onOn Linux (Fedora 17 x86-64), Chrome keeps reporting “Adobe Flash Player was blocked because it is out of date.” every time I browse a page that contains Flash. How to fix this? I did this and it turned to be working for me: Disable the libpepflashplayer in Chrome by run chrome://plugins/ in the URL bar.
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 manage plugins for Vim?
Posted onThe Vim plugin directory under ~/.vim seems messy—a plugin has different files in different directories and the files from different plugins are put together. This is hard to add/remove plugins. Is there any better method for managing them? I use pathogen and am very happy with it. After installing pathogen, any plugins you want to
Read more
Auto completion in Vim
Posted onHow to enable auto code completion in Vim, like in the IDE? Several plugins I use: snipMate: Plugin for using TextMate-style snippets in Vim omnicppcomplete: Plugin for C/C++ omnicompletion neocomplcache: Ultimate auto completion system for Vim
How to find out those who do not follow me back on twitter
Posted onI want to find out those who I follow but do not follow me back on twitter. Is there a method to find out those who do not follow me back on twitter? A very useful tool: twitNERD can help you find out the ones that you follow but do not follow you. Additionally, you
Read more
3 Ways of Making Case Insensitive Search in Vim/Vi
Posted onBy default, Vim/Vi’s search is case sensitive. However, if I want to search case insensitively, is there any method? For example, I search for dog, instead of matching dog only case sensitively, I also want to find out phases containing Dog, DOg, etc. There are several methods: 1. Setting the search to be case insensitive
Read more
How to install php on Apache on Fedora?
Posted onHow to install php on Apache on Fedora? The basic support (basic PHP support, no caching, etc.) should be enough. First, install Apache2 (httpd): # yum install httpd Then, enable php support: # yum install php Remember to restart httpd after you install php: # service httpd restart
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
How to quickly find out failed disks’ SATA port in Linux? (how to map Linux disk names to SATA ports)
Posted onI find one disk failed on my server which have several ones installed. I know the disk’s name in Linux (e.g. sda, sdb). However, the Linux disk name to SATA port mapping does not follow the same order. Now, I want to find out the failed disks. How to quickly find out them and which
Read more
Make changes to sysctl.conf take effect without rebooting Linux?
Posted onI made some changes to /etc/sysctl.conf. I know it will take effect next time Linux boots. However, how to make the changes to sysctl.conf take effect without rebooting Linux? You can force Linux to reload the new configuration in /etc/sysctl.conf by: execute the following command as root: sysctl -p For more details, check the manual
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