The question is as follows. harry@debian:~/workshop1/qemu_test/version1/test$ qemu-system-x86_64 -hda qcow2.img -cdrom domU-x86_64-FS.img -boot d -m 1024 VNC server running on `::1:5900′ harry@debian:~/workshop1/qemu_test/version1/test$ vncviewer 127.0.0.1:1 vncviewer: ConnectToTcpAddr: connect: Connection refused Unable to connect to VNC server Solution (add -vnc parameter for qemu-system-x86_64): harry@debian:~/workshop1/qemu_test/version1/test$ qemu-system-x86_64 -hda qcow2.img -cdrom domU-x86_64-FS.img -boot d -m 1024 -vnc 127.0.0.1:2 harry@debian:~/workshop1/qemu_test/version1/test$ vncviewer 127.0.0.1:2
Read more
Tag: System
How to turn a BIOS-based Linux Mint 17 installation to UEFI booting?
Posted onI installed Linux Mint 17 in the traditional BIOS mode. However, Windows 8.1 on my computer can only boot in the UEFI mode. I do not want to reinstall the Windows or erase it. How to turn a BIOS-based Linux Mint 17 installation to UEFI booting? You may refer https://help.ubuntu.com/community/UEFIBooting for some information.
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 install no-ip update client on Linux Mint?
Posted onHow to install no-ip.com update client noip2 on Linux Mint 17? First, install the noip2 client: sudo su – cd /usr/local/src wget http://www.no-ip.com/client/linux/noip-duc-linux.tar.gz tar xzf noip-duc-linux.tar.gz cd no-ip-2.1.9-1 make make install Then, generate the configuration file noip2 -C Last, make noip2 daemon run at reboot crontab -e Add this line to crontab: @reboot /usr/local/bin/noip2 I’ve
Read more
How to change hostname on Linux Mint?
Posted onHow to change the hostname on Linux Mint? The hostname (e.g. mypc or mypc.example.com) can be changed by putting the hostname in one line in the file /etc/hostname on Linux Mint.
How to adjust the system partition (C:) size of Windows?
Posted onThe disk management tools of Windows can adjust it to some level. But there are more space available as far as I can tell. How to further adjust the system partition (C:) size of Windows? You may check these tools: EASEUS Partition Master (free) Includes Partition Manager, Disk & Partition Copy Wizard and Partition Recovery
Read more
How to install multiple versions of sbt on my Linux host?
Posted onHow to install multiple versions of sbt on my Linux host For example, some projects use 0.12.x while some use 0.13.x. Installing neither in the system only is not sufficient enough. You may use the excellent sbt-extras: https://github.com/paulp/sbt-extras Most of the time, it detects the version of sbt needed in the project direoctory automatically: [zma@office
Read more
How to convert between dos and unix file coding in Emacs?
Posted onHow to convert between dos and unix file coding for files in Emacs? From Dos to Unix coding: M-x set-buffer-file-coding-system RET undecided-unix or C-x RET f undecided-unix Then save the file (C-x C-s). From Unix to Dos M-x set-buffer-file-coding-system RET undecided-dos or C-x RET f undecided-dos Then save the file (C-x C-s).
How to find which files are opened by a Linux program?
Posted onHow to find which files are opened by a Linux program? For example, when I run cat ~/.bashrc, how to find out which files are opened by cat? You can achieve this by using strace if the program “open” files using system calls. For example, I run as this: strace -o /tmp/st cat ./.bashrc grep
Read more
How to change default OS for windows dual boot manager in Windows 7?
Posted onHow to change default OS for windows dual boot manager in Windows 7? The c:/boot/ in older Windows does not exist anymore. Open the Control Panel and click on the System icon. In the left pane, click on the Advanced system settings link. Under the Advanced tab, click on the Settings button under Startup and
Read more
How to make Emacs run in command line by default?
Posted onHow 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 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
Convention of error codes on Linux and Windows
Posted onWhat’s the error code conventions on Linux and Windows? Linux and Windows use 0 to indicate that the operation is successful and an integer that is larger than 0 for some errors. Linux System Error Codes On Linux, the system error codes is defined in 2 headers which you can find on your own box:
Read more
How to change the fonts of gnome-shell for gnome3?
Posted onHow to change the fonts of gnome-shell for gnome3? Like the system bar. The fonts of gnome-shell is described in its own theme. For the default gnome-shell, you need to edit the file as root: /usr/share/gnome-shell/theme/gnome-shell.css Right, it is a css file. Find the font-family keyword and change the corresponding fonts. Then you can restart
Read more
Random string password generator in Scala
Posted onManaging our research cluster, I frequently need to generate some string for new users’ password. How to generate them automatically and randomly in Scala? The passwords need characters ‘a’ – ‘z’, ‘A’ – ‘Z’ and ‘0’ – ‘9’ only. This piece of code works very well for me: def randomString(len: Int): String = { val
Read more
How to install Python environment in my own account on Dreamhost?
Posted onHow to install Python environment in my own account on Dreamhost so that my application can use the python that I installed by myself instead of the system-wide one? The post for Bluehost works very well for Dreamhost too: https://my.bluehost.com/cgi/help/python-install In short: mkdir ~/python cd ~/python wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz tar zxfv Python-2.7.2.tgz find ~/python -type d
Read more
Linux timer sources
Posted onLinux supports different timer sources and a machine can have multiple ones. How to find the available Linux timer source and the current one used? Find the current timer source: $ cat /sys/devices/system/clocksource/clocksource0/current_clocksource Find all available timer sources: $ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
How to get the output of a system command in C
Posted onHow to get the output of a system command in C? The system function is handy. But how to get the output? popen is a useful function for this purpose: https://www.systutorials.com/docs/linux/man/3p-popen/ You can use normal file operation functions like fgets to read file content from the file opened by popen.
Mount Ext4 Partitions in Windows in read-only mode
Posted onHow to mount Ext4 partitions from Linux in Windows in read-only mode? Read-only is required to ensure safety. Mounting is required so that traditional programs can use the partition without any changes. Ext2Fsd is a great tool for this. Ext2Fsd is a file system driver which allows accessing (both reading and writing) ext2, ext3 or
Read more
Run cron jobs with environmental variables for an account
Posted onA common error for configuring cron is to use environmental variables for an account in the cron command. However, cron will run the commands without these variables defined. In the crontab -e, adding . $HOME/.profile before the commands play the trick. For example: 0 */8 * * * . $HOME/.profile; ~/bin/my-command Cron is started by
Read more