When I create the vm instance using libvirt, it will create a TUN device named vnetX. I wonder whether the libvirt don't create the vnet device, and I use other method to create it.
lundi 1 décembre 2014
Event not found in sed
I tried the code as given on delete text between curly brackets
however I am facing this different error regarding event in sed.
file contains:
This is {
{the multiline
text} file }
that wants
{ to {be
changed}
} anyway.
sed ':again;$!N;$!b again; s/{[^}]*}//g' file
what is supposively going wrong in the workout?
Mounting synology disks in ubuntu
I have some files on synology disk that I would like to recover with extundelete. I have mounted the raid1 setup. So on the disk is two raid storages (md2 and md3) and they are connected to one with lvm. I try to get the lvm going. I think it doesn't like the md2p1. I tried to mount md2p1, but it doesn't mount, so I thnik it's some garbage. How could I make that work that LVM would find the other device?
sudo lsblk -o name,uuid,mountpoint
NAME UUID MOUNTPOINT
sda
├─sda1 bb4b1f59-9349-4e59-cced-5de7ca715931
├─sda2 291dec99-01d5-7031-cced-5de7ca715931
├─sda5 46288321-39d3-353d-7014-c3a9333d1c33
│ └─md2 8s9LfU-Egt2-sbtJ-1zkH-ewqb-LjRT-xZ2RC2
│ └─md2p1 8da77aa4-43ff-4cd1-81f0-f311284e0b04
└─sda6 a7ff03a3-29c2-a100-ecdd-c31c151ca783
└─md3 Eu0fsK-Cu1W-3PCw-ZEV6-80fL-05rf-H0qlcE
sdb
├─sdb1 e29faa0c-a7b4-4851-a17d-75c20238edc2 /
├─sdb2 ce06f4bb-5f73-423b-9794-b94a1e47d4f8
└─sdb3 6089A7F658D702D4
sdc
└─sdc1 09d3c590-3a6a-4436-8718-7c14ab0e282b
sudo lvs
Couldn't find device with uuid 8s9LfU-Egt2-sbtJ-1zkH-ewqb-LjRT-xZ2RC2.
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
lv vg1000 -wi-----p 2,72t
Route specificity vs metric
I understand that Linux chooses the most specific route to the destination when it does routing selection. But what about a route's metric? Does it have a higher priority than route's specificity?
A reference to the details of the routing selection algorithm would also be appreciated.
How to copy a whole directory structure with a certain file size limit?
For some reasons, I need to do a data clone.
In which I need to copy the whole structure of a huge directory, but I'd like to only copy those files which are smaller than 1MB(with their hierarchy unchanged), because there are many giant temp files I want to avoid clone with.
Which utilities or commands I should use to achieve that goal?
Does zip command can realize this goal directly?
Remove tar compress spool from cron email
I have a crontab job that call a simple script to backup a website:
15 0 1,10,20 * * /home/username/bin/backup_whatever
This is the script:
#!/bin/bash
TODAY=$(date +"%Y%m%d")
FILE_TO_PUT="filename.$TODAY.tar.gz"
rm -rf /home/username/filename.tar.gz
tar -zcvf /home/username/filename.tar.gz -C / var/www/website/
s3cmd put /home/username/filename.tar.gz s3://s3bucket/backups/$FILE_TO_PUT
As the tar command compress lots of files, the email I got when this is executed is really huge. How can I do to just display a message like compression successfully instead the full output of tar command?
Will be ok, if I do something like this? Can't find out the tar return codes.
EXITCODE=$(tar -zcvf /home/username/filename.tar.gz -C / var/www/website/)
if [ $EXITCODE -eq 0]
then
echo "compression successfully"
else
echo "compression unsuccessfully"
fi
Run itext script as cups filter
I have an itext script to apply some customisations to pdf files. These need to be done on-the-fly.
I can easily do it this way :
java -cp ".:itext5.jar" pdflayout input.pdf | lpr -P CP800/print
But would rather set up some shareable cups queue that would run the script, so that our graphics people can print to it directly.
Can anyone point me in the right direction?
O/S is Debian Sqeeze.