How to host a domain name registered in another account in one Dreamhost account. Simply trying to add the new domain, it reports: Error! You can’t add that domain: already in our system You need to delete the domain from your hosting (DNS) from the account first. Don’t worry, the domain name is still there
Read more
Tag: Tutorial
How to save PuTTY profiles/sessions?
Posted onPuTTY is a great SSH client on Windows. However, how to save it’s profiles/sessions that I saved so that I can migrate my settings from one machine to another? PuTTY saves its settings in the registry of Windows. You can find it in the registry editor by run regedit under: HKEY_CURRENT_USERSoftwareSimonTatham You can save your
Read more
How to set up MySQL replication
Posted onHow to set up MySQL replication. And for debugging purpose, it will be great if I can run multiple MySQL instances on a single host. To set up MySQL replication, check these tutorials: MySQL Replication MySQL replication setup You can Setup multiple MySQL instances on single server.
How to change an attachment’s parent post in WordPress
Posted onHow to change an attachment’s parent post in WordPress? The in WordPress posts depends on the child-parent relationship. It will be good to change the parent posts for attachments. The Change Media Parent WordPress plugin works great for me. After installing and activating it, a link to change the parent appears in the media control
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
Add the jane street opam repository
Posted onHow to add the jane street opam repository is introduced here. Here, we assume the branch to add is core-branch. You may need to replace the core-branch with the branch you need. $ git clone -b core-branch https://github.com/janestreet/opam-repository.git $ opam repo add js opam-repository Or, directly add the remote branch as an opam repository. $
Read more
How to import OCaml libraries
Posted onHow to import 3rd party libraries (e.g. not standard libraries) in OCaml? An answer by Gabriel Scherer on how to import Batteries is just great and answers this question with much information. Although it is for Batteries, the method is general. The OCaml compiler (or toplevel, etc.) will find with no additional information only the
Read more
Find out the number of CPU cores on Linux
Posted onHow to find out the number of CPU cores on a Linux host. Use the command nproc. $ nproc nproc – print the number of processing units available: man page of nproc.
How to find out and change the storage engine of tables in MySQL
Posted onHow to find out and change the storage engine of tables in MySQL databases? Find out the storage engine of a table in a database: SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = ‘database’ AND TABLE_NAME = ‘table’ Change the storage engine of a table: ALTER TABLE table ENGINE = type type can be innodb or
Read more
How to change the maximum execution time and memory size allowed for PHP
Posted onI see this message in the error log of httpd: PHP Fatal error: Maximum execution time of 30 seconds exceeded in and PHP Fatal error: Allowed memory size of 268435456 bytes exhausted How to change them to a longer and larger value? To change the allowed maximum memory usage of PHP: Set memory_limit = 256M
Read more
How to change strings in MySQL tables
Posted onHow to change strings in MySQL tables? e.g. I want to change domain.com to www.domain.com. Use the REPLACE functions of MySQL: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace One example is like this: UPDATE table SET field = REPLACE(field, ‘domain.com’, ‘www.domain.com’) WHERE field LIKE ‘%domain.com%’ The WHERE clause is not needed but can make execution faster.
HP Printer with Fedora Linux 19
Posted onHow to use HP Printer connected with USB on Fedora Linux 19. Install these packages and it may ask you to download and install other plugins. Without these packages, my printer does work. # yum install hplip hplip-gui hpijs May also need to run: # hp-plugin to install plugins for the HP printer. This plays
Read more
How to install WordPress on Fedora 19
Posted onHow to install the latest WordPress on a newly installed Fedora 19? Thanks! First, install the LAMP (you already have ‘L’) stack: # yum install httpd php php-mysql mysql-server php-gd and start these services: # systemctl start mysqld.service httpd.service Then, install WordPress on the LAMP stack following the tutorials on the Web. Two good ones
Read more
How to repair tables database by backup
Posted onHow to repair tables database by backup Is this possible? Please explain how to repair. and thanks This post may help: https://www.systutorials.com/qa/300/how-to-repair-a-mysql-table thanks dear Zhiqiang Ma
Trap Ctrl-C in a Bash script
Posted onHow to trap Ctrl-C in a Bash script? The piece of code: # trap ctrl-c and call ctrl_c() trap ctrl_c INT function ctrl_c() { echo echo “Ctrl-C by user” # do the jobs exit }
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
Specifying –no-print-directory within the Makefile
Posted onThe –no-print-directory option of make tells make not to print the message about entering and leaving the working directory. However, how to specify the –no-print-directory inside the Makefile itself? Add this line to the Makefile: MAKEFLAGS += –no-print-directory You can also set MAKEFLAGS in a makefile, to specify additional flags that should also be in
Read more
How to spawn a background process in a bash script
Posted onFor example, I want to spawn many ssh background processes in one bash script: for i in `cat ./all-hosts` do ssh $i “ifconfig | grep Link” done Simply adding a & to the ssh commands does not work. Here is the script that works: for i in `cat ./all-hosts` do ssh $i “ifconfig | grep
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
How to force Chrome on iPhone refresh pages and invalidate the caches
Posted onI find Chrome on my iPhone caches pages/css/js files. That makes browsing faster. However, under some situation, I’d like to force it refresh the pages/css/js and give me the latest one. How to force Chrome on iPhone refresh pages and invalidate the caches? The only method as far as I can find is to clear
Read more