I begin to use vim for programming. I like the tools that focus on one function. I used to use emacs. But I think I like vim more. For debugging, I use gdb. But I use the front end cgdb. I can see the codes with the cursor when debugging. I can use F8 for
Read more
Tag: Linux
How to Generate Mixed Source and Assembly List from Source Code using GCC
Posted onWhen debugging and optimizing programs, developers sometimes need to generate and investigate into the assembly generated by the compiler. Generating a mixed source and assembly list will help a lot for debugging and optimization. gcc can achieve this by working with the assembler. Generate assembly list mixed with the source code Just add these gcc
Read more
4 Ways of Converting String to Int in C++
Posted onIt is common to convert a string (std::string) to integer (int) in C++ programs. Because of the long history of C++ which has several versions with extended libraries and supports almost all C standard library functions, there are many ways to convert a string to int in C++. This post introduces how to convert a
Read more
An Online JPG to EPS Converter
Posted onConverting the JPG images to EPS is frequently need especially when write documents in LaTeX. I introduced how to Convert JPG Images to EPS on Linux. However, not everyone have a Linux box available at any time. We set up an Online JPG to EPS Converter to help people convert JPG to EPS. Convert JPG
Read more
Google PageRank Update 2011
Posted onUpdate 3: Fclose.com sees minor PageRank updates on November 8, 2011. For example, some tooles and some posts get PageRank of 3 from 0. Update: Confirmed that Google updates the PageRank in toolbar on November 8 2011. Update 2: Google updates the PageRank in toolbar on August 05 2011. Update 1: Google updates the PageRank
Read more
Emacs Tips and Howtos
Posted onWith Emacs, I feel happy. I love the rich functions of Emacs, such as compiling, quickly jumping to the lines with compilation error and debugging with gdb, and more. I ever wrote small tips posts about Emacs before. But it is a good idea to put them together and keep adding new ones. Here comes
Read more
How to install Scala on Linux
Posted onHow to install Scala on Fedora Linux How to install Scala on Fedora Linux: This tutorial introduces how to install Scala 2.9.2 on 64-bit Fedora Linux 17. There are some changes needed to make scala work on Fedora Linux 17. Please check it out in the answer. Continue reading: How to install Scala on Fedora
Read more
How to Generate and Apply Patches using diff and patch on Linux
Posted on`diff` and `patch` are tools to create patches and apply patches to source code, which is widely used in the open-source world, such as Linux kernel and application. patch: applying patches To apply a patch to a single file: $ patch < foo.patch If the foo.patch does not identify the file the patch should be
Read more
Viewing XPS Files in Linux
Posted onXPS files is a format from MS on Windows. Evince can view some XPS files, but fails to view some. To view XPS files generated on Windows on a Linux system, we can use mupdf. It works very well. I like it much especially in the situation that Evince fails to open the XPS file.
Read more
Installing Fedora 17 PV Domain-U on Xen with PXE Booting
Posted onAn introduction to the general method of installing Domain-U on Xen is introduced here: Setting Up Stable Xen DomU with Fedora: Unmodified Fedora 12 on top of Xenified Fedora 12 Dom0 with Xen (this is a general introduction, some details are changed, such as ‘xl’ replacing ‘xm’, LVM backing the disk for higher performance. But
Read more
How to Flush iptables on Fedora Linux
Posted oniptables is a mechanism in Linux kernel for port forwarding, NAT, firewalls etc. In Linux distros, such as Fedora, the iptables is configured to be as a “strict” firewall that opens a limited know ports, such as 22 for SSH. However, in some network environment, such as a private cluster, the nodes are trusted and
Read more
How to Change Systemd Runlevel on Fedora Linux – The Manual Way
Posted onFedora Linux starts to use systemd to manage system service. The /etc/inittab is no longer used by systemd. The old method of editing /etc/inittab to change system runlevel does not work anymore. This post introduces a “manual” way to change the boot levels. For the general method, please check https://www.systutorials.com/change-systemd-boot-target-linux/. systemd uses ‘targets’ instead of
Read more
Setting MATE as Default Desktop Environment for startx on Fedora
Posted onI ever discussed Starting KDE from Command Line by startx for KDE and GNOME. Recently, I installed MATE desktop on Fedora 17 and am very happy with it—dear, Gnome 2 is back. However, I checked the /etc/X11/xinit/Xclients script which is called by ‘startx’ and it only includes ‘startkde’ and ‘gnome-session’ without support to MATE. But
Read more
Changing MTU to Make WiFi Faster on Linux
Posted onI experienced very slow WiFi network on Linux, while my iPhone seems surf the Internet quit fast. I pinged a site and the RTT is more than 1000ms! There must be something wrong with my Linux configuration. I tried to change the MTU from “Automatic” to “1400” on my Linux box. Surprisingly, it fix the
Read more
Quickly Copying Text to a File
Posted onCopying some text to a new file is a common operation on Linux. I usually do this by opening the file with ‘vim’, pasting the text in ‘vim’, and then saving the file. I learned a more efficient and quicker way from my advisor during one discussion with him when I show him some results.
Read more
How to Install Xen on Fedora as Domain-0 (Fedora 17)
Posted onThe new development of Xen and Linux kernel make it easy to install Xen on Fedora as the Domain-0 now. This post uses Fedora 17 as an example platform to introduce how to set up Domain-0 on Fedora Linux. Compared to our old method (https://www.systutorials.com/setting-up-stable-xen-dom0-with-fedora-xen-3-4-3-with-xenified-linux-kernel-2-6-32-13-in-fedora-12/) which requires manually compiled Xen and patched kernel, the current
Read more
How to Set Default Entry in Grub2 and Grub
Posted onLinux booting is usually controlled by Grub or the new Grub2. Setting the default booting entry is a frequent operations. Here, we introduce how to set the default entry in Grub2 and Grub. Setting the default booting entry in grub2 Note1: With some version of grub2, the grub2-set-default method and the script below may not
Read more
How to Disable IPv6 on Linux
Posted onIPv6 is enabled by default on most Linux distros. However, IPv6 is not used for some situations for most of time and it may cause troubles and requires effort to protect the network and ensure the security. This post introduces how to disable IPv6 support on Linux (newer modern Kernel versions). First, add these lines
Read more
How to Flush Linux File System Caches
Posted onWe may drop the file system caches on Linux to free up memory for applications. Kernels 2.6.16 and newer provide a mechanism via the /proc/ to make the kernel drop the page cache and/or inode and dentry caches on command. We can use this mechanism to free up the memory. However, this is a non-destructive
Read more
Finding the Number of Files (inodes) in a Directory on Linux
Posted onOn Linux, to find the number of files (inodes) in a directory: $ find ./ | wc -l to find the number of files (not directories) in a directory: $ find ./ -type f | wc -l to find the number of directories in a directory: $ find ./ -type d | wc -l