Add header footer in directory listing in Apache (httpd)

Posted on

How to add header footer in directory listing in Apache (httpd)? In the web directory’s .htaccess file: Options +Indexes IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8 HeaderName /header.html ReadmeName /footer.html IndexIgnore header.html footer.html .htaccess header.html and footer.html are under the website root directory (not the Linux root).

How to rearrange Alt, Ctrl and Win keys on Linux: Win as Alt and Ctrl/Alt as Ctrl

Posted on

How to rearrange Alt, Ctrl and Win keys on Linux: Win as Alt and Ctrl/Alt as Ctrl? On Linux, the Win key is seldom used. Mapping the Alt keys which are close to my thumb is damn convenient for Emacs users. Hence, the keyboard at the bottom line would look like: ———————————————————— |Ctrl|Alt|Ctrl| Space Bar
Read more

How to turn the space bar to another ctrl key?

Posted on

How to turn the space bar to another ctrl key? It will be dam useful especially for Emacs users and also useful for normal usage like for tab changing in Chrome or Gnome terminal. You may try 2 tools in userspace: Space2Ctrl: https://github.com/r0adrunner/Space2Ctrl xcape: https://github.com/alols/xcape Note that the limitation of these solutions: the space will
Read more

How to detect memory leaks of C programs in Linux?

Posted on

How to detect memory leaks of C programs in Linux? I also have access to the source code of the program. There are many posts related to this: Easy and quick tools on Linux (while not very accurate): http://blog.thewebsitepeople.org/2011/03/linux-memory-leak-detection/ Valgrind: manual and a tutorial. gperftools has the Google Heap Profiler which can checks for memory
Read more

How to make Alt-Tab switch among windows instead of applications in Gnome 3?

Posted on

The default Alt-Tab in Gnome 3 switches among applications and windows are grouped by application. How to make Alt-Tab switch among windows instead of applications in Gnome 3? Check the Alternate Tab Gnome 3 extension and you will love it. Substitute Alt-Tab with a window based switcher that does not group by application. This extension
Read more

How to make Emacs run in command line by default?

Posted on

How to make Emacs run in command line by default? I do not want to open the X window. You have at least 2 choices. First choice: use emacs-nox and make it the default: # yum install emacs-nox # alternatives –config emacs and choose emacs-nox. Second choice: use emacs but with -nw to disable the
Read more

How to quickly find out which rpm package provides a command on Fedora Linux?

Posted on

How to quickly find out which rpm package provides a command on Fedora Linux? As an example, we want to find out which package provides the ping command. You can quickly find it out by rpm: $ rpm -qf `which ping` It will give iputils-20121221-2.fc19.x86_64 Alternatively, you can use yum: $ yum provides `which ping`
Read more

How to debug/check network-related driver information on Linux?

Posted on

How to debug/check network-related driver information on Linux? Several commands/tools that you may find usefull: Messages: dmesg grep NetworkManager /var/log/messages lshw: list hardware lshw -c network lsusb: list USB devices lsusb rfkill: enabling and disabling wireless devices rfkill unblock all rfkill event iwconfig: configure a wireless network interface iwconfig ifconfig: configure a network interface ifconfig

How to upgrade Fedora 19 to Fedora 20 through the network?

Posted on

How to upgrade Fedora 19 to Fedora 20 through the network? The tool for Fedora to upgrade the distribution is FedUp. Check this page for how to upgrade Fedora 19 to Fedora 20: http://fedoraproject.org/wiki/FedUp#How_Can_I_Upgrade_My_System_with_FedUp.3F Be sure to check the bugs in Fedora 20 before the upgrading: http://fedoraproject.org/wiki/Common_F20_bugs#Upgrade_issues Generally, it contains 3 steps: Preparation # yum
Read more

How to get the directory path and file name from a absolute path in C on Linux

Posted on

How to get the directory path and file name from a absolute path in C on Linux? For example, with “/foo/bar/baz.txt”, it will produce: “/foo/bar/” and “baz.txt”. You can use the APIs basename and dirname to parse the file name and directory name. A piece of C code: #include <libgen.h> #include <string.h> char* local_file =
Read more