First you need pv, Pipe Viewer
[bash]$ apt-get install pv [bash]$ SIZE=`du -sk some-folder | cut -f 1` [bash]$ tar cvf - some-folder | pv -p -s ${SIZE}k | gzip -c > folder.tar.bz2
Marc has spent the past few years putting oil on the fire of a hyper growth ad tech company. At Smartly.io he was in charge of scaling the support and its culture. At Eficode he is now leading an engineering team and running operations. He leads by example and puts a lot of emphasis on diversity and inclusion, constantly working to create a safe environment. A warm leader with a passion for memorable experiences and innovation.
Find Marc on Linkedin
First you need pv, Pipe Viewer
[bash]$ apt-get install pv [bash]$ SIZE=`du -sk some-folder | cut -f 1` [bash]$ tar cvf - some-folder | pv -p -s ${SIZE}k | gzip -c > folder.tar.bz2
You can simply use the following syntax:
[root@blub ~]# tar tzvf mytar.tar.gz
[root@blub ~]# tar tzvf mytar.tar.gz myfile.txt
-rw-rw-r-- scm/scm 373093723 2010-09-17 17:58:21 myfile.txt
Finally you can extract that single file.
Many ways
1. Use the following command:
So I took a backup of a disk using G4L.
Let’s import it into a virtual machine on a RedHat running Xen.
virt-install --import --file <myfile> --prompt
answer the few questions.
Choose "Fully Virtualized".
Turn the SELinux into permissive mode in order to configure the network. This is a known bug and it looks like it’s not corrected yet.
setenforce Permissive
Once the import is done your virtual machine should pop and boot properly.
ssh server "gzip -c remote_file " |gunzip > local_file
There are numbers of tutorials on the net on how to configure access from one machine to another without typing a password.
Here is the real way to do it.
First generate a pair of keys:
ssh-keygen -t rsa
It’s important to choose a passphrase. Don’t leave it blank.
Then you need to copy the public key to the other server
ssh-copy-id -i .ssh/id_rsa.pub>
Make sure that ssh-agent is running.
Add a key using ssh-add
ssh-add
Try connecting
Should be working.
xterm -C
opens an xterm with console messages
Sometimes it can be hard to resolve a dependency with rpms.
rpm -qpl *
will show the list of all the files installed with a list of rpm in the running directory.
rpm -qpl * | grep libcc
will show me the files that resolve a specific dependency.
Finding more information with man pages
man -a intro (and press q)
shows the list of man books:
1 – introduction to user commands
2 – system calls
3 – library functions
4 – special files
5 – file formats
6 – games
7 – overview, conventions, and miscellany section
8 – administration and privileged commands
Xen is the virtualization tool for Redhat.
3 packages are needed: kernel-xen, xen, virt-manager
in order to create a new virtual machine:
virt-install
in order to start, create, destroy, stop, list virtual machines:
virtsh or xm
graphical user interface:
virt-manager