Should I update eyeOS Joomla plugin?

 
tipps & tricks
Speed Up Linux Software Raid Building And Re-syncing

Creating, assembling and rebuilding small array is fine. But, things started to get nasty when you try to rebuild or resync large size array. You may get frustrated when you see it is going to take 22 hours to rebuild the array. You can always increase RAID resync performance using the following technique

/proc/sys/dev/raid/{speed_limit_max,speed_limit_min}
The /proc/sys/dev/raid/speed_limit_min is config file that reflects the current "goal" rebuild speed for times when non-rebuild activity is current on an array. The speed is in Kibibytes per second, and is a per-device rate, not a per-array rate . The default is 1000.

 

The /proc/sys/dev/raid/speed_limit_max is config file that reflects the current "goal" rebuild speed for times when no non-rebuild activity is current on an array. The default is 100,000.

 

To see current limits, enter:

# sysctl dev.raid.speed_limit_min
# sysctl dev.raid.speed_limit_max

To increase speed, enter:

echo value > /proc/sys/dev/raid/speed_limit_min

or

sysctl -w dev.raid.speed_limit_min=value

In this example, set it to 50000 K/Sec, enter:

# echo 50000 > /proc/sys/dev/raid/speed_limit_min

or

# sysctl -w dev.raid.speed_limit_min=50000

 


 

If you want to override the defaults you could add these two lines to /etc/sysctl.conf:

dev.raid.speed_limit_min = 50000
dev.raid.speed_limit_max = 200000

 

 
Change the network device name
The interface name of a network device increases if the mac address of the physical or virtual network card changes. A common case is if you made a clone of a virtual machine for example via VMware or KVM or replaced a physical network card in a non virtualized server.
If it’s a CentOS 6 machine you need to change 2 files to rename the interface for example from eth1 back to eth0.
One file is the udev rule for network devices which is located here:
/etc/udev/rules.d/70-persistent-net.rules
Copy the new mac address to the line of your eth0 rule and delete the new rule for eth1.
# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:b2:23:e0″, ATTR{type}=="1″, KERNEL=="eth*", NAME="eth0″
Modify the network configuration located under:
  
/etc/sysconfig/network-scripts/ifcfg-eth0
and replace the old ip with the new one and the old mac address with the new mac address.
To be sure everything works fine reboot your machine.

 
How to resize Qemu image

 

From now on, we assume your existing VM disk image is called example.img. How much space would you like to add to it? Write this number down, but do so at the end of this command:
1
qemu-img create -f raw additional.raw <size>
Here, <size> is the amount of space that you want to add. So, 512M for 512 megabytes, 10G for 10 gigabytes and so on. This will create an empty raw image containing as much (empty) space as you'd like to add to the real image.
Now, convert your existing image to raw format as well.
1
qemu-img convert -f qcow2 example.img -O raw example.raw
And append the raw additional space to the end of your raw image:
1
cat additional.raw >> example.raw
Finally, convert the whole thing back to qcow2. I'm going to make a copy here instead of overwriting the original. This wastes a lot of disk space temporarily, but is safer if you've got the space to spare.
1
qemu-img convert -f raw example.raw -O qcow2 example-expanded.img
…and that's it. The example-expanded.img image should contain empty space after the final partition. To resize the partitions, download the GParted LiveCD, and boot it on the VM. You know how to do this; otherwise, you wouldn't be able to install an operating system on your VM.

From now on, we assume your existing VM disk image is called example.img. How much space would you like to add to it? Write this number down, but do so at the end of this command:

(1) qemu-img create -f raw additional.raw <size>
Here, <size> is the amount of space that you want to add. So, 512M for 512 megabytes, 10G for 10 gigabytes and so on. This will create an empty raw image containing as much (empty) space as you'd like to add to the real image.

Now, convert your existing image to raw format as well.

(2) qemu-img convert -f qcow2 example.img -O raw example.raw
And append the raw additional space to the end of your raw image:

(3) cat additional.raw >> example.raw
Finally, convert the whole thing back to qcow2. I'm going to make a copy here instead of overwriting the original. This wastes a lot of disk space temporarily, but is safer if you've got the space to spare.


(4) qemu-img convert -f raw example.raw -O qcow2 example-expanded.img
…and that's it. The example-expanded.img image should contain empty space after the final partition. To resize the partitions, download the GParted LiveCD, and boot it on the VM.
You know how to do this; otherwise, you wouldn't be able to install an operating system on your VM.

 

 
Mount your box.net (box.com) account in linux
Box.net (box.com actually now) is a service that enables you to have a place to put files that you want to access from anywhere. Some people (ehem) use it to back up their workstations..
Did your box.net mount start failing recently? They've changed a couple things.. use this guide to set it up again.
First, install davfs
Red Hat based:
# yum install davfs2
Debian based:
# apt-get install davfs2
Now, add the mount point:
# mkdir /box
Add this line to your /etc/fstab:

Box.net (box.com actually now) is a service that enables you to have a place to put files that you want to access from anywhere. Some people (ehem) use it to back up their workstations.. 

Did your box.net mount start failing recently? They've changed a couple things.. use this guide to set it up again.


 

First, install davfs

Red Hat based:   # yum install davfs2
Debian based:   # apt-get install davfs2
Now, add the mount point:   # mkdir /mnt/box

 

Add this line to your /etc/fstab:

https://www.box.com/dav /mnt/box davfs rw,user,noauto 0 0

 

Add this line to the bottom of the /etc/davfs2/secrets file (replace with your box email address and password)

https://www.box.com/dav 
 This e-mail address is being protected from spambots. You need JavaScript enabled to view it
  passwd

 

 

Edit the /etc/davfs2/davfs2.conf

Change:

# use_locks 1
to
use_locks 0

 

Now mount it!
# mount /mnt/box

Show that it's there with 'mount' or with 'df'

 

Worked like a charm at my CentOS 5 & 6 machines!

 

 
Convert movie for iPhone/iPod with ffmpeg PDF 

This command convert an avi file into an iPhone/iPod/iPad compatible mp4 format.

I'm using ffmpeg-0.6-0.1.20100425svn with lame-3.98.3-1.fc12.1 on Fedora 12 x86_64

ffmpeg -i in.avi -acodec libmp3lame -ab 128k -vcodec mpeg4 
-b 1200k -mbd 2 -flags +mv4+aic -trellis 1 -cmp 2 -subcmp 2
-s 320x180 -metadata title=X out.mp4

Cause this command is to long, I have cut it into 3 lines!


 
Convert avi to flv on commandline PDF 
Thursday, 03 June 2010 03:53

Well, converting an avi video file into a flv file is pretty the same way, like doing it with an mts video file.

So I just changed the mts2flv file a little bid!


I'm using ffmpeg-0.5-3.el5.rf with lame-3.97-1.el5.rf on my CentOS 5.3.

First, I was using lame-3.98.2-1.el5.rf,
but I always got an "output buffer too small" error, while converting the audio data. So I just installed an earlier version and it worked like a charm.

 

Here is my small script, what convert all .avi files into a .flv file with the same screensize and 44100 mp3 sound:

#####################

#!/bin/sh

## avi2flv - Copyright 2010-6 Maik Heinelt

for f in *.avi
do
outf=${f%.avi}.flv

ffmpeg -i "$f" -y -b 800 -r 25 -f flv -vcodec flv -acodec libmp3lame -ab 128 -ar 44100 "$outf"

done

#####################

 

Just copy this code into a file, make it executable and run it at the folder, where you have placed the avi files!

 

 
Convert mts to flv on commandline PDF 
Thursday, 03 June 2010 03:22

These days, I was looking for an easy and comfortable way to convert my mts files into handy flv format for my web-pages.

and realized, that such really working code is not easy to find. So, I just decided to release my code-snippet, what I have successful used many times.

I'm using ffmpeg-0.5-3.el5.rf with lame-3.97-1.el5.rf on my CentOS 5.3.

First, I was using lame-3.98.2-1.el5.rf,
but I always got an "output buffer too small" error, while converting the audio data. So I just installed an earlier version and it worked like a charm.

 

Here is my small script, what convert all .mts files into a .flv file with the same screensize and 44100 mp3 sound:

#####################

#!/bin/sh

## mts2flv - Copyright 2010-6 Maik Heinelt

for f in *.mts
do
outf=${f%.mts}.flv

ffmpeg -i "$f" -y -b 800 -r 25 -f flv -vcodec flv -acodec libmp3lame -ab 128 -ar 44100 "$outf"

done

#####################

 

Just copy this code into a file, make it executable and run it in the folder, where you placed the mts files!

That's it! Have fun!!!

 



Techace.jp Banner