Sunday, October 21, 2012

Linux dd do everything

http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/How_To_Do_Eveything_With_DD

Rescue an unreadable floppy.

ddrescue if=/dev/fd0 of=/home/sam/rescue.image bs=1440k conv=notrunc,noerror

with a new floppy in the drive

dd if=/home/sam/rescue.image of=/dev/fd0 bs=512 skip=2 seek=2 conv=notrunc,noerror

Now the new floppy should be readable

This method works similarly well with damaged CD's and DVD's. However, you must mount the resulting .iso image as a loop device and copy all the data that way.

ddrescue if=/dev/sr0 of=/home/sam/rescue.iso bs=2048 conv=notrunc,noerror

Make the following line in /etc/fstab.

/home/sam/rescue.iso /mnt/rescue iso9660 rw,user,noauto 0 0

Execute the following command.

mkdir /mnt/rescue

This makes the mount point you put in /etc/fstab.

Execute the following command.

mount -o loop /mnt/rescue

now all the salvagable data will be in the directory

/mnt/rescue

You can copy it to a new cd.

Echoes "I love Avril" vertically.

echo -n "I love Avril" | dd cbs=1 conv=unblock 2> /dev/null


Cloning an entire hard disk:

dd if=/dev/sda of=/dev/sdb conv=notrunc,noerror

Sunday, October 14, 2012

Unlimited openvz setup

source: http://blog.eukhost.com/webhosting/how-to-remove-openvz-limits-on-a-vps/


These are the commands useful for quick removal of limits on a VPS. These is valuable while making OpenVZ ready and available in a load balanced or busy environment.
Note:”save” will save them in the configuration file for when you restart it. The settings will be lost if you do not supply the argument when the VPS is rebooted.
Use the below stated syntax if you see something that is near the limit use
clear; cat /proc/user_beancounters
vzctl set 101 –tcpsndbuf 999999999:999999999 –save
vzctl set 101 –tcprcvbuf 999999999:999999999 –save
vzctl set 101 –numtcpsock 999999999:999999999 –save
vzctl set 101 –numflock 999999999:999999999 –save
vzctl set 101 –othersockbuf 999999999:999999999 –save
vzctl set 101 –numothersock 999999999:999999999 –save
vzctl set 101 –numfile 999999999:999999999 –save
vzctl restart 101
These are the errors you migh receive without limits being raised
[crit] (105)No buffer space available: alloc_listener: failed to get a socket for 127.0.0.1

Thursday, October 11, 2012

optimizing xen network speed

http://wiki.xen.org/wiki/Network_Throughput_and_Performance_Guide#Usage

check speed:

Linux
Make sure the following packages are installed on your system: gccg++make, and subversion.
Iperf can be installed from Iperf's SVN repository:
svn co https://iperf.svn.sourceforge.net/svnroot/iperf iperf
cd iperf/trunk
./configure
make
make install
cd
iperf --version # should mentioned pthreads
You might also be able to install it via a package manager, e.g.:
apt-get install iperf
When using the yum package manager, you can install it via RPMForge.
Windows

Here are the simplest commands to execute on the receiver, and then the sender:
# on receiver
iperf -s -f m     # add "-w 256K -l 256K" when sender or receiver is a Windows VM

# on sender
iperf -c  -f m -t 20    # add "-w 256K -l 256K" when sender or receiver is a Windows VM
Related Posts Plugin for WordPress, Blogger...