How to make dd faster on Linux?

Posted on

dd seems slow when I use command like # dd if=/dev/sda2 of=./sda2.bak How to make it faster? You can make dd faster by specifying a good bs like # dd if=/dev/sda2 of=./sda2.bak bs=8192 8192 is a magic number. There are may be other good sizes for bs for different systems. But 8192 works pretty well
Read more

How to un-trust a computer that I have trusted with iOS 7 device?

Posted on

How to un-trust a computer that I have trusted with iOS 7 device, such as iPhone? You can delete the Lockdown folder to reset the trust/un-trust status of iPhones. Apple provides tutorials for Max OS X and Windows at: http://support.apple.com/kb/TS5335 (archived) . If you are using Linux, the Lockdown folder is: /var/lib/lockdown Answered by Lucy.

How to get the git commit tree?

Posted on

How to get a tree-like view of the git commit history? My favorite command line: git log –graph –oneline It will prints a text based graph like (with colors): * b5dc8b9 Merge branch ‘master’ of https://github.com/layerzero/libi0 | | * 7514ef1 revised the README.md a little bit | * 6692428 align size to page for both
Read more

How to use different keys for different git servers?

Posted on

I have access to different git servers. I have several keys for these servers. How to use different keys for different git servers? Use the .ssh/config file to specify different configuration for different SSH servers used by git: For example: Host git.example.org Port 22111 IdentityFile ~/.ssh/id_rsa.git.example.org Host code.example.org Port 22 IdentityFile ~/.ssh/id_rsa.code.example.org which specifies the
Read more

How to use LVM groups with libvirt

Posted on

libvirt uses files for VM images by default under /var/lib/libvirt/images/. LVM is a convenient tool for managing VM images. How to use LVM groups with libvirt? This post discusses the method to add LVM groups as a storage pool for libvirt: http://ailoo.net/2011/02/use-a-lvm-volume-group-with-libvirt/ For a general introduction of the storage management in libvirt, please check: http://libvirt.org/storage.html

How to install sbt for scala on Fedora Linux

Posted on

How to install sbt for scala on Fedora Linux? It is not included in the default Fedora repository although scala is included. The download page of scala-sbt.org provides the RPM package. You can install the sbt rpm package by yum. We only need the URL to the RPM package. Here, let take version 0.13.1 as
Read more

Linux timer sources

Posted on

Linux 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 find out which function causes Exception “Stack_overflow” in OCaml

Posted on

My OCaml program prints: Fetal error: Exception “Stack_overflow” without any further information. How to find out which function causes this “Stack_overflow” exception? First, recompile your OCaml program with -g. Second, rerun your OCaml program with OCAMLRUNPARAM=b and the backtrace will be printed out after the “Stack_overflow” exception.

Import Evolution mail directory to Thunderbird/imap account

Posted on

I have some old emails left in the Evolution local directory (unfortunately not in the mail server’s imap directory). So how to import the Evolution directory which contains some files for the emails to Thunderbird so that I can copy them to the imap directory if needed? You can do this in two steps: First,
Read more

utop key bindings / key shortcuts

Posted on

utop is an improved toplevel for OCaml supporting line edition, history, real-time and context sensitive completion, colors and etc. utop is convenient to use. However, the key bindings are a little bit different from the ones with GNU readline. What are all the key bindings? The #utop_bindings command will print all the key bindings. Here
Read more

How to delete a disk from a LVM group while keeping the data

Posted on

This is the scenario: I want to remove a old hard disk which is a LVM PV and contains data. There is free space available on other PVs in the VG. It should move the data from the disk to be removed to other PVs and then remove the disk. The process to remove sdb
Read more

Xen HVM DomU configuration file

Posted on

An example of Xen HVM DomU configuration file. An example for install the OS from an ISO: name=”10.0.1.235″ vcpus=2 memory=2048 shadow_memory=8 disk=[‘file:/lhome/xen/vm-10.0.1.235/vmdisk0,xvda,w’, ‘file:/lhome/Linux-x86_64-DVD.iso,xvdc:cdrom,r’] vif=[‘bridge=xenbr0′] kernel=’/usr/lib/xen/boot/hvmloader’ builder=’hvm’ device_model=’/usr/lib64/xen/bin/qemu-dm’ extra=” vnc=1 vnclisten=”0.0.0.0″ vncpasswd=’1234567′ # vncdisplay=1 vncconsole=1 on_reboot=’restart’ on_crash=’restart’ An example for run the VM after installation: name=”10.0.1.235″ vcpus=2 memory=2048 shadow_memory=8 disk=[‘file:/lhome/xen/vm-10.0.1.235/vmdisk0,xvda,w’] vif=[‘bridge=xenbr0′] kernel=’/usr/lib/xen/boot/hvmloader’ builder=’hvm’ device_model=’/usr/lib64/xen/bin/qemu-dm’ extra=” vnc=1
Read more

How to attach and mount Xen DomU’s disk to Dom0

Posted on

How to attach and mount Xen DomU’s disk to Dom0 To attach phy:vg_xen/vm-10.1.1.228 to xvda on Domain-0: # xm block-attach Domain-0 phy:vg_xen/vm-10.1.1.228 xvda w Mount the new partition /dev/xvda2 to /mnt/xvda2: # mount /dev/xvda2 /mnt/xvda2 After finishing using the partition, umount it and detach it: # umount /mnt/xvda2/ # xm block-detach Domain-0 xvda