We know compilers like gcc can do lots smart optimization to make the program run faster. Regarding functions call optimization, gcc can do tail-call elimination to save the cost of allocating a new stack frame, and tail recursion elimination to turn a recursive function to non-recursive iterative one. gcc can even transform some recursive functions
Read more
Tag: Wiki
Handling Sparse Files on Linux
Posted onSparse files are common in Linux/Unix and are also supported by Windows (e.g. NTFS) and macOSes (e.g. HFS+). Sparse files uses storage efficiently when the files have a lot of holes (contiguous ranges of bytes having the value of zero) by storing only metadata for the holes instead of using real disk blocks. They are
Read more
What are the differences between BIOS and UEFI?
Posted onBIOS: Basic Input Output Systems UEFI: Unified Extensible Firmware Interface UEFI is the advanced BIOS, which solves some limitations in BIOS such as 1, 16-bit processor mode; 2, 1 MB addressable space and PC AT hardware. References: https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface
For QEMU/KVM, how to share data between host and guest
Posted onGeneral question for developers to access data between VM and VMM. As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance. Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel. Add following in your
Read more
How to compare date in SQL?
Posted onHow to compare date in SQL? For example, the ‘users’ table has a column ‘loggin’ which is the date and time. How to find out the ‘users’ whose ‘loggin’ date is later than Jan 10, 2017? In SQL, dates can be compared using ‘’, ‘=‘. For the example described, the SQL statement could be: SELECT
Read more
How to set Zimbra web service’s hostname and port?
Posted onIn Zimbra server, how to set Zimbra web service’s hostname and port? Set Zimbra Web service’s host and port (to mail.domain.com:80 as an example) for a mail domain domain.com: zmprov md domain.com zimbraPublicServiceHostname mail.domain.com zmprov md domain.com zimbraPublicServicePort 80 Reference: https://wiki.zimbra.com/wiki/When_using_a_proxy,_the_’change_password’_box_doesn’t_load
Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password?
Posted onFirefox needs an email address and a password to login and sync. Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password? In short, only you with your password can see your data. Others, even Mozilla’s servers, without your password, can not see your decrypted data. In
Read more
How can I recover data from my crashed hard drive?
Posted onMy laptop’s hard drive crashed. I went to someone else and got the hard drive replaced, but they could not recover my data. You may try PhotoRec as for https://www.systutorials.com/qa/1399/how-can-i-recover-deleted-photos-from-samsung . Although its named with “Photo”, PhotoRec can recover many kinds of files as listed in http://www.cgsecurity.org/wiki/File_Formats_Recovered_By_PhotoRec .
How to make CentOS 6.6 power off the console screen automatically?
Posted onOn CentOS 6.6, I find that it can make the screen (console, not X) blank after a while. However, it does not power the screen off. This usually work on Fedora or other releases. I guess this is caused by some configurations specific in CentOS 6.6. How to make CentOS 6.6 power off the console
Read more
How to enable RPM Fusion for CentOS 6.6?
Posted onHow to enable RPM Fusion for CentOS 6.6? Enable RPM fusion on RHEL 6 or compatible like CentOS: su -c ‘yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm’ It will install https://fedoraproject.org/wiki/EPEL. If it fails to install EPEL automatically, you will need to install it manually. Reference: http://rpmfusion.org/Configuration
How to config network in host (wireless network) for QEMU guest os
Posted onThe host os is connected into network by wireless one so how to let its guest os connect network. Take [1] as a reference. I run it successfully with following steps. 1, create /etc/qemu-ifup script and chmod it. 2, start a qemu guest os with command sudo ./qemu/qemu-system-x86_64 -enable-kvm -m 1024 -drive file=marss_dram.qcow2 -vnc 127.0.0.1:0
Read more
How to run programs in different languages from Windows’ language
Posted onHow to run programs in different languages from Windows’ language? For example, some non-unicode programs in Chinese on English version of Windows will display some garbage characters. You can use the AppLocale util provided by Microsoft to run legacy applications without changing language of non-Unicode applications (system locale): https://en.wikipedia.org/wiki/AppLocale You may check this link for
Read more
How to mark a line as deleted in BBCode?
Posted onHow to mark a line as deleted in BBCode? e.g. a line crossing through the text. You can use the [s] tag. The BBCode: [s]strikethrough text[/s] will be converted <s>strikethrough text</s>, <del>strikethrough text</del> or <span style=”text-decoration: line-through;”>strikethrough text</span> Check more at: http://en.wikipedia.org/wiki/BBCode
How to change the mode for simplified Chinese or Traditional Chinese mode in ibus-libpinyin?
Posted onHow to change the mode for simplified Chinese or Traditional Chinese mode in ibus-libpinyin? What is the shortcut like “Ctrl+.” for switching full width or half width punctuation. Use shortcut “Ctrl + Shift + F”. In ibus-pinyin version 1.3.7, this shortcut is added: 2010-05-28 ibus-pinyin 1.3.7 stable release Add Ctrl + Shift + F to
Read more
How to install Fedora 20 on a mbr/ms-dos disk?
Posted onHow to install Fedora 20 on a mbr/ms-dos disk? The nogpt and noefi trick seems do not work. This is a bug in F20 installer that still believes it is in UEFI native mode even if the noefi parameter is passed. Solution: There is an updates image for the installer which fixes this issue available
Read more
How to upgrade Fedora 19 to Fedora 20 through the network?
Posted onHow 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
Shared hosting services with SSH enabled
Posted onWhich shared hosting services have SSH enabled? SSH is a great tool for management and development. Lots shared hosting services support SSH. Here is a non-complete list: Dreamhost SSH on dreamhost: http://wiki.dreamhost.com/Enabling_Shell_Access BlueHost SSH on BlueHost: http://my.bluehost.com/cgi/help/180 GoDaddy SSH on GoDaddy: http://support.godaddy.com/help/article/4942 HostGator SSH on HostGator: http://support.hostgator.com/articles/hosting-guide/lets-get-started/how-do-i-get-and-use-ssh-access HostMonster SSH on HostMonster: http://my.hostmonster.com/cgi/help/180 ServerGrove SSH on
Read more
Sending emails securely
Posted onSending emails securely is needed for certain situations, such as sending my bank account to my wife, giving my account password to my close friend for a while. How to send it? Regarding the recent US PRISM program, it is an important issue. Seeing your solution, a few of my own popped up. Here are
Read more
How to choose the number of mappers and reducers in Hadoop
Posted onHow to choose the number of mappers and reducers in Hadoop to get good job performance? The Hadoop Wiki gives a discussion on this: http://wiki.apache.org/hadoop/HowManyMapsAndReduces Some valuable points: About the number of Maps: The number of maps is usually driven by the number of DFS blocks in the input files. Although that causes people to
Read more
Force Linux to reboot
Posted onHow to force Linux to reboot when the reboot command does not work. Enable the use of the magic SysRq option: # echo 1 > /proc/sys/kernel/sysrq Reboot the machine: # echo b > /proc/sysrq-trigger Even if you could not log on the system but sshd is working, you can force the Linux to reboot by:
Read more