<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35083915</id><updated>2024-09-02T04:39:35.148-03:00</updated><category term="freebsd"/><category term="linux"/><category term="shell"/><category term="firewall"/><category term="offtopic"/><category term="apache"/><category term="ldap"/><category term="mysql"/><category term="redes"/><category term="programação"/><category term="rede"/><category term="squid"/><category term="ad"/><category term="basic"/><category term="desktop"/><category term="gnome"/><category term="ssh"/><category term="centos"/><category term="gentoo"/><category term="html"/><category term="iptables"/><category term="kernel"/><category term="php"/><category term="windows"/><category term="benchmarks"/><category term="debian"/><category term="email"/><category term="javascript"/><category term="nagios"/><category term="printserver"/><category term="roteadores"/><category term="samba"/><category term="video"/><category term="vim"/><category term="xorg"/><category term="RAID"/><category term="bacula"/><category term="cisco"/><category term="cups"/><category term="cyrus"/><category term="dc"/><category term="dns"/><category term="excel"/><category term="exchange"/><category term="gcc"/><category term="gdb"/><category term="gentoo portage"/><category term="gtalk"/><category term="hylafax"/><category term="keyboard"/><category term="lvm"/><category term="ntlm"/><category term="openfire"/><category term="postifx"/><category term="powershell"/><category term="scripts"/><category term="vbscripts"/><title type='text'>MAL - Memória Auxiliar do Lutieri</title><subtitle type='html'>Não posso confiar muito na minha memória. Ela já me deixou na mão várias vezes.&#xa;&#xa;&#xa;Portanto faço uso dos recursos de uma era tecnológica para não perder informações.&#xa;Provavelmente haverá, aqui, conteúdo sobre  redes, linux, programação, solaris e BSD :)&#xa;&#xa;&#xa;Uma vez que Einstein já dizia: “Nunca me preocupo em aprender algo que sei que posso consultar.” &#xa;&#xa;Eis que surge esse blog.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default?start-index=26&amp;max-results=25'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>173</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35083915.post-955299235701995079</id><published>2012-01-03T21:34:00.058-02:00</published><updated>2012-02-23T22:14:42.404-02:00</updated><title type='text'>Studying for RHSCA and RHCE</title><content type='html'>My recent posts were about things that I was playing around and are related to topics that are covered in RHSCA and RHCE exams. &lt;br /&gt;
&lt;br /&gt;
I&#39;m preparing myself to take this exams in february/2012 and I need some place to store my notes. Here you will find small tips, tricks, common switches, commands, etc. This is all stuff that I need to know in order to succeed the exams. And it&#39;s also stuff that I know I have to play with and write down to help memory retain the information.&lt;br /&gt;
&lt;br /&gt;
let the show begin....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Querying RPMs&lt;/li&gt;
&lt;/ul&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;rpm -qi xxx -&amp;gt; query info. same as yum info xxx&lt;br /&gt;
rpm -q --scripts xxx -&amp;gt; query scripts&lt;br /&gt;
rpm -ql xxx -&amp;gt; list of files inside the rpm.&lt;br /&gt;
&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;any of the above can also have the -p switch. this will consider the xxx as a local rpm file. not an installed package&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;rom -qf /sbin/service -&amp;gt; will show which packege contains the /sbin/service file &lt;br /&gt;
rpm -qa -&amp;gt; query all installed packages&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Extract files from rpm:&lt;/li&gt;
&lt;/ul&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;rpm2cpio xxx | cpio -idmv&amp;nbsp;&lt;/blockquote&gt;&lt;br /&gt;
if you run rpm -qlp xxx and see the one file that you want you can extract it running the following:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;rpm2cpio xxx | cpio -idmv&amp;nbsp;./etc/apt/sources.list.d/rpmforge-extras.list&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Please don&#39;t forget the dot in front of the filename. otherwise no files will be extracted.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Querying installed packages&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
If you want to know if a package is installed use:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;yum list &quot;*http*&quot;&lt;/blockquote&gt;&lt;br /&gt;
It will list the Installed Packages and also the Available Packages. Yum list only search for the packages name. Yum search searches also in the description of the package.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Installing RPMs&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;b&gt;yum localinstall xxx.rpm&lt;/b&gt; works just like&lt;b&gt; rpm -ivh xxx.rpm&lt;/b&gt; but will also solve the dependencies if necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Creating RPMs&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;yum install rpm-build make -y&lt;br /&gt;
mkdir -p /usr/src/lutieri/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}&lt;br /&gt;
cd /usr/src/lutieri/&lt;br /&gt;
mkdir sample&lt;br /&gt;
cd sample/&lt;br /&gt;
touch first_file second_file keys config_file&lt;br /&gt;
cd ..&lt;br /&gt;
tar -cf sample.tar.gz sample/&lt;br /&gt;
mv sample.tar.gz SOURCES/&lt;br /&gt;
&lt;br /&gt;
create a spec file in SPECS: run &lt;b&gt;vim foo.spec&lt;/b&gt; -&amp;gt; vim will load a template for you :-D&lt;br /&gt;
&lt;br /&gt;
rpmbuild  -v -bb SPECS/sample.spec&lt;/blockquote&gt;OR&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;rpmbuild -v -bb --sign SPECS/sample.spec&lt;/blockquote&gt;&lt;br /&gt;
the former example works if you have the rpmmacros set correctly. then the package will be built and signed.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Instead of creating all those directories, create the .spec file and run with rpmbuild. it will create all the directory structure in ~/rpmbuild/. then move the .spec to ~/rpmbuild/SPECS and the tar to ~/rpmbuild/SOURCES and run rpmbuild again against the .spec.&lt;br /&gt;
&lt;br /&gt;
OR &lt;br /&gt;
&lt;br /&gt;
Install rpmdevtools and run rpmdev-setuptree. This will also create the folder structure in the home directory&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
in the SPEC file , under the sessino %files you should specify every file that this package is responsible for.&lt;br /&gt;
&lt;blockquote&gt;%files&lt;br /&gt;
%defattr(-,root,root,-)&lt;br /&gt;
%dir /root/package&lt;br /&gt;
%attr(755,root,root) /root/package/script.sh&lt;/blockquote&gt;&lt;br /&gt;
Instead of use cp to copy files to a specific location, use install -D&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Signing a package&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;gpg-agent --daemon&lt;br /&gt;
gpg2 --gen-keys&lt;br /&gt;
gpg2 --list-keys&lt;br /&gt;
gpg2 --export -a lutieri2 &amp;gt; RPM-GPG-KEY-lutieri2&lt;br /&gt;
su -&lt;br /&gt;
rpm --import /home/lutieri/RPM-GPG-KEY-lutieri2&lt;br /&gt;
exit&lt;br /&gt;
vim ~/.rpmmacros&lt;br /&gt;
%_signature gpg&lt;br /&gt;
%_gpg_name lutieri2&lt;br /&gt;
rpm --addsign rpmbuild/RPMS/i386/lutieri-1.1-0.i386.rpm&lt;br /&gt;
rpm --resign rpmbuild/RPMS/i386/lutieri-1.1-0.i386.rpm&lt;br /&gt;
rpm --checksig rpmbuild/RPMS/i386/lutieri-1.1-0.i386.rpm&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Run man rpm and search for macro.. this will show you what goes inside the .rpmmacros files.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
all the keys imported into RPM DB are considered packages. take a look:&lt;br /&gt;
&lt;pre&gt;rpm -q gpg-pubkey --qf &quot;%{name} - %{version} - %{release} -&amp;gt; %{summary}\n&quot;
gpg-pubkey - c105b9de - 4e0fd3a3 -&amp;gt; gpg(CentOS-6 Key (CentOS 6 Official Signing Key) &lt;centos-6-key@centos.org&gt;)
gpg-pubkey - 8cee003f - 4f03b71a -&amp;gt; gpg(lutieri &lt;asdf@asdf&gt;)
gpg-pubkey - cf7fe955 - 4f03bacf -&amp;gt; gpg(lutieri2 &lt;asdf@asdf&gt;)

rpm -qa gpg-pub*
gpg-pubkey-cf7fe955-4f03bacf
gpg-pubkey-8cee003f-4f03b71a
gpg-pubkey-c105b9de-4e0fd3a3&lt;/asdf@asdf&gt;&lt;/asdf@asdf&gt;&lt;/centos-6-key@centos.org&gt;&lt;/pre&gt;&lt;br /&gt;
thus, to remove lutieri2 key. issue:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;rpm -e gpg-pubkey-cf7fe955-4f03bacf&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Create a repository:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;yum install -y createrepo&lt;br /&gt;
mkdir /opt/myrepo&lt;br /&gt;
mv *.rpm /opt/myrepo&lt;br /&gt;
createrepo /opt/myrepo&lt;br /&gt;
vim /etc/yum.repos.d/lutieri.repo&lt;br /&gt;
[lutieri]&lt;br /&gt;
Baseurl=file:///opt/myrepo&lt;br /&gt;
name=lutierirepo&lt;br /&gt;
enabled=1&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;man&lt;u&gt; yum.conf&lt;/u&gt; shows you the options that goes in the .repo files.&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;If later on you add new RPMs to the directory run the following to update de metadata:&lt;/div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;createrepo -update /opt/myrepo&amp;nbsp;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;--------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Network&lt;br /&gt;
&lt;br /&gt;
on ifcfg-* files, the option NM_CONTROLLED=&quot;NO&quot; will not allow network manager to manage this interface &lt;br /&gt;
&lt;br /&gt;
Bonding:&lt;br /&gt;
&lt;pre&gt;vim&amp;nbsp;/etc/modprobe.d/bonding.conf
alias bond0 bonding
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;To find out what options are necessary in the master interface do the follwing&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;find /usr/share/doc/kernel-doc* -iname &quot;bond*&quot;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
less&amp;nbsp;/usr/share/doc/kernel-doc-2.6.32/Documentation/networking/bonding.txt&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: orange;&quot;&gt;&lt;b&gt;miimon is required as well as mode. Mode 1=rr, 2=active/passive 3=broadcast&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Master:&lt;br /&gt;
&lt;pre&gt;vim /etc/sysconfig/network-scripts/ifcfg-bond0

TYPE=Ethernet
DEVICE=bond0
BOOTPROTO=none
IPADDR=1.1.1.1
NETMASK=255.255.255.0
USERCTL=yes
IPV6INIT=no
ONBOOT=yes
BONDING_OPTS=&quot;miimon=100 mode=0&quot;
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Slaves:&lt;br /&gt;
&lt;pre&gt;vim /etc/sysconfig/network-scripts/ifcfg-eth0

TYPE=Ethernet
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you wanna see if the options in BONDING_OPTS were applied, take a look in&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# cat /sys/class/net/bond0/bonding/miimon
100
[root@zeus ~]# cat /sys/class/net/bond0/bonding/mode
balance-rr 0
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------&lt;br /&gt;
File Systems&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;palimpsest &lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;it&#39;s a graphic utility to manage disks. &lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
TIP:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;fdisk -cul /dev/?d?&lt;/blockquote&gt;&lt;br /&gt;
it lists all disk devices.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
LUKS -&amp;nbsp;Linux Unified Key Setup&lt;br /&gt;
make sure you have the partition unmount&lt;br /&gt;
&lt;br /&gt;
Format the partition to be encrypted:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;cryptsetup luksFormat /dev/sdb1&lt;/blockquote&gt;&lt;br /&gt;
Open the FS and give it a name:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;cryptsetup luksOpen /dev/sdb1 hiddenData&lt;/blockquote&gt;&lt;br /&gt;
Format it to use:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;mkfs.ext4 /dev/mapper/hiddenData&lt;/blockquote&gt;&lt;br /&gt;
Use it:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;mkdir /mnt/hiddenData&lt;br /&gt;
mount /dev/mapper/hiddenData /mnt/hiddenData&lt;br /&gt;
touch /mnt/hiddenData/file1&lt;/blockquote&gt;&lt;br /&gt;
Lock it after use:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;umount /mnt/hiddenData&lt;br /&gt;
cryptsetup luksClose /dev/mapper/hiddenData&lt;/blockquote&gt;&lt;br /&gt;
Make it the mounting persistent after reboot:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;vim /etc/crypttab&lt;br /&gt;
hiddenData &amp;nbsp; &amp;nbsp; /dev/sda2&amp;nbsp; none&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;none means you will have to type the password during boot. any other value is interpreted as a file that contains the password for the FS&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;vim /etc/fstab&lt;br /&gt;
/dev/mapper/hiddenData /mnt/hiddenData &amp;nbsp;ext4 defaults 0 0&amp;nbsp;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
To avoid being prompted for a password you can create a key, save it in a file and use this key to open the device:&lt;br /&gt;
&lt;br /&gt;
vim /etc/key&lt;br /&gt;
type anything in there&lt;br /&gt;
&lt;br /&gt;
chmod 400 /etc/key &lt;br /&gt;
cryptsetup luksAddKey /dev/vda5 /etc/key &lt;br /&gt;
cryptsetup luksDump /dev/vda5&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;vim /etc/crypttab&lt;br /&gt;
hiddenData &amp;nbsp; &amp;nbsp; &amp;nbsp;/dev/sda2 /etc/key&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
------------------&lt;br /&gt;
&lt;br /&gt;
iSCSI&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
doc under: /usr/share/doc/iscsi*/README&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;# yum install -y&amp;nbsp;iscsi-initiator-utils&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;# iscsiadm -m discovery -t st -p 192.168.56.101&lt;br /&gt;
192.168.56.101:3260,1 iqn.2006-01.com.openfiler:tsn.cc35969be1c0&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Login in the target&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;# iscsiadm -m node -T &amp;nbsp;iqn.2006-01.com.openfiler:tsn.cc35969be1c0 &amp;nbsp;-p 192.168.56.101 -l&lt;br /&gt;
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.cc35969be1c0, portal: 192.168.56.101,3260] (multiple)&lt;br /&gt;
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.cc35969be1c0, portal: 192.168.56.101,3260] successful.&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
take a look in /var/log/messages and see what block devices appear OR run&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;# find /sys/devices/platform/host* -name &quot;block*&quot;&lt;br /&gt;
/sys/devices/platform/host4/session1/target4:0:0/4:0:0:0/block&lt;br /&gt;
# ls /sys/devices/platform/host4/session1/target4\:0\:0/4\:0\:0\:0/block/&lt;br /&gt;
&lt;b&gt;sdc&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;br /&gt;
service iscsi status &lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;will also show you, in the very bottom line, what devices iscsi is attached to.&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Make it persistent after reboots:&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;vim /etc/fstab&lt;br /&gt;
/dev/sdc1 &amp;nbsp; &amp;nbsp;/mnt/openfiler &amp;nbsp; ext4 _netdev 0 0&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Cleaning the DBs:&lt;br /&gt;
&lt;br /&gt;
Removing known portals:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# iscsiadm -m discoverydb
192.168.56.102:3260 via sendtargets
192.168.56.101:3260 via sendtargets
[root@zeus ~]# iscsiadm -m discovery -o delete -p 192.168.56.102
[root@zeus ~]# iscsiadm -m discovery -o delete -p 192.168.56.101
[root@zeus ~]# iscsiadm -m discovery
[root@zeus ~]#
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After managing partitions you should reload the partition table partprobe used to be a good choice but seems to be deprecated right now. partx ou kpartx seems to be the new options.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;partx -a /dev/sda&lt;/blockquote&gt;&amp;nbsp;will add new partitions to the system. double check running cat /proc/partitions&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;partx -d /dev/sda &lt;/blockquote&gt;will remove all inactive partitions from the system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please use&lt;b&gt; fdisk -cu&lt;/b&gt;.. these switches will disable DOS-compatible mode and show sectors instead of cylinders&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
LVM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Creating PVs&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# fdisk -l /dev/sdc
Disk /dev/sdc: 1073 MB, 1073741824 bytes
34 heads, 61 sectors/track, 1011 cylinders
Units = cylinders of 2074 * 512 = 1061888 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000dfdc
&amp;nbsp; &amp;nbsp;Device Boot &amp;nbsp; &amp;nbsp; &amp;nbsp;Start &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End &amp;nbsp; &amp;nbsp; &amp;nbsp;Blocks &amp;nbsp; Id &amp;nbsp;System
/dev/sdc1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;95 &amp;nbsp; &amp;nbsp; &amp;nbsp; 98484+ &amp;nbsp;8e &amp;nbsp;Linux LVM
/dev/sdc2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;96 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 426 &amp;nbsp; &amp;nbsp; &amp;nbsp;343247 &amp;nbsp; 83 &amp;nbsp;Linux
[root@zeus ~]# pvcreate /dev/sdc1
&amp;nbsp; Physical volume &quot;/dev/sdc1&quot; successfully created
[root@zeus ~]# pvcreate /dev/sdc2
&amp;nbsp; Physical volume &quot;/dev/sdc2&quot; successfully created
[root@zeus ~]#&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div&gt;The man page for pvcreate says a partition should be type 8e but it does not complain about /dev/sdc2 though. let&#39;s move on..&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Creating a VG&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# vgcreate mp3 /dev/sdc1
&amp;nbsp; Volume group &quot;mp3&quot; successfully created
[root@zeus ~]# vgdisplay -v mp3
    Using volume group(s) on command line
    Finding volume group &quot;mp3&quot;
  --- Volume group ---
  VG Name               mp3
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               92.00 MiB
  PE Size               4.00 MiB
  Total PE              23
  Alloc PE / Size       0 / 0
  Free  PE / Size       23 / 92.00 MiB
  VG UUID               tc1JKq-TBBw-zYax-51ET-2A5t-hK0t-wsWXTO

  --- Physical volumes ---
  PV Name               /dev/sdc1
  PV UUID               XUKAwo-eZRI-Gq12-7oUb-4w8w-25rN-t64cBI
  PV Status             allocatable
  Total PE / Free PE    23 / 23
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;Note that -v switch brings up the PV that are part of the VG.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Creating LVs&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# lvcreate -L 50M mp3 -n rock_and_roll
&amp;nbsp; Rounding up size to full physical extent 52.00 MiB
&amp;nbsp; Logical volume &quot;rock_and_roll&quot; created
[root@zeus ~]# lvcreate -L 10M mp3 -n soul
&amp;nbsp; Rounding up size to full physical extent 12.00 MiB
&amp;nbsp; Logical volume &quot;soul&quot; created
[root@zeus ~]# lvs
&amp;nbsp; LV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VG &amp;nbsp; &amp;nbsp; &amp;nbsp;Attr &amp;nbsp; LSize &amp;nbsp;Origin Snap% &amp;nbsp;Move Log Copy% &amp;nbsp;Convert
&amp;nbsp; rock_and_roll mp3 &amp;nbsp; &amp;nbsp; -wi-a- 52.00m
&amp;nbsp; soul &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mp3 &amp;nbsp; &amp;nbsp; -wi-a- 12.00m
&lt;div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Observing the VG&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# vgdisplay -v mp3
&amp;nbsp; &amp;nbsp; Using volume group(s) on command line
&amp;nbsp; &amp;nbsp; Finding volume group &quot;mp3&quot;
&amp;nbsp; --- Volume group ---
&amp;nbsp; VG Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mp3
&amp;nbsp; System ID
&amp;nbsp; Format &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lvm2
&amp;nbsp; Metadata Areas &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1
&amp;nbsp; Metadata Sequence No &amp;nbsp;3
&amp;nbsp; VG Access &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; read/write
&amp;nbsp; VG Status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; resizable
&amp;nbsp; MAX LV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0
&amp;nbsp; Cur LV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2
&amp;nbsp; Open LV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0
&amp;nbsp; Max PV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0
&amp;nbsp; Cur PV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1
&amp;nbsp; Act PV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1
&amp;nbsp; VG Size &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 92.00 MiB
&amp;nbsp; PE Size &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4.00 MiB
&amp;nbsp; Total PE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23
&amp;nbsp; Alloc PE / Size &amp;nbsp; &amp;nbsp; &amp;nbsp; 16 / 64.00 MiB
&amp;nbsp; Free &amp;nbsp;PE / Size &amp;nbsp; &amp;nbsp; &amp;nbsp; 7 / 28.00 MiB
&amp;nbsp; VG UUID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; tc1JKq-TBBw-zYax-51ET-2A5t-hK0t-wsWXTO

&amp;nbsp; --- Logical volume ---
&amp;nbsp; LV Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/dev/mp3/rock_and_roll
&amp;nbsp; VG Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mp3
&amp;nbsp; LV UUID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EQ73g4-TFPw-6WTg-ufWp-RAXq-MVVU-fHSh9T
&amp;nbsp; LV Write Access &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;read/write
&amp;nbsp; LV Status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;available
&amp;nbsp; # open &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0
&amp;nbsp; LV Size &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;52.00 MiB
&amp;nbsp; Current LE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 13
&amp;nbsp; Segments &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1
&amp;nbsp; Allocation &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inherit
&amp;nbsp; Read ahead sectors &amp;nbsp; &amp;nbsp; auto
&amp;nbsp; - currently set to &amp;nbsp; &amp;nbsp; 256
&amp;nbsp; Block device &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 253:2

&amp;nbsp; --- Logical volume ---
&amp;nbsp; LV Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/dev/mp3/soul
&amp;nbsp; VG Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mp3
&amp;nbsp; LV UUID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;nchsYN-2eSX-Z3Bw-WV5w-2xxV-5oQM-8Vh8xj
&amp;nbsp; LV Write Access &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;read/write
&amp;nbsp; LV Status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;available
&amp;nbsp; # open &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0
&amp;nbsp; LV Size &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12.00 MiB
&amp;nbsp; Current LE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3
&amp;nbsp; Segments &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1
&amp;nbsp; Allocation &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; inherit
&amp;nbsp; Read ahead sectors &amp;nbsp; &amp;nbsp; auto
&amp;nbsp; - currently set to &amp;nbsp; &amp;nbsp; 256
&amp;nbsp; Block device &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 253:3

&amp;nbsp; --- Physical volumes ---
&amp;nbsp; PV Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /dev/sdc1
&amp;nbsp; PV UUID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XUKAwo-eZRI-Gq12-7oUb-4w8w-25rN-t64cBI
&amp;nbsp; PV Status &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; allocatable
&amp;nbsp; Total PE / Free PE &amp;nbsp; &amp;nbsp;23 / 7&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Rename a LV:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;&lt;div&gt;&lt;div&gt;[root@zeus ~]# lvcreate -L 10M mp3
&lt;/div&gt;&lt;div&gt;&amp;nbsp; Rounding up size to full physical extent 12.00 MiB&lt;/div&gt;&lt;div&gt;&amp;nbsp; Logical volume &quot;lvol0&quot; created&lt;/div&gt;&lt;div&gt;[root@zeus ~]# lvs&lt;/div&gt;&lt;div&gt;&amp;nbsp; LV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VG &amp;nbsp; &amp;nbsp; &amp;nbsp;Attr &amp;nbsp; LSize &amp;nbsp;Origin Snap% &amp;nbsp;Move Log Copy% &amp;nbsp;Convert&lt;/div&gt;&lt;div&gt;&amp;nbsp; lvol0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mp3 &amp;nbsp; &amp;nbsp; -wi-a- 12.00m&lt;/div&gt;&lt;div&gt;&amp;nbsp; rock_and_roll mp3 &amp;nbsp; &amp;nbsp; -wi-a- 52.00m&lt;/div&gt;&lt;div&gt;&amp;nbsp; soul &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mp3 &amp;nbsp; &amp;nbsp; -wi-a- 12.00m&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;[root@zeus ~]# lvrename /dev/mp3/lvol0 /dev/mp3/celtic&lt;/div&gt;&lt;div&gt;&amp;nbsp; Renamed &quot;lvol0&quot; to &quot;celtic&quot; in volume group &quot;mp3&quot;&lt;/div&gt;&lt;div&gt;[root@zeus ~]# lvs&lt;/div&gt;&lt;div&gt;&amp;nbsp; LV &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VG &amp;nbsp; &amp;nbsp; &amp;nbsp;Attr &amp;nbsp; LSize &amp;nbsp;Origin Snap% &amp;nbsp;Move Log Copy% &amp;nbsp;Convert&lt;/div&gt;&lt;div&gt;&amp;nbsp; celtic &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mp3 &amp;nbsp; &amp;nbsp; -wi-a- 12.00m&lt;/div&gt;&lt;div&gt;&amp;nbsp; rock_and_roll mp3 &amp;nbsp; &amp;nbsp; -wi-a- 52.00m&lt;/div&gt;&lt;div&gt;&amp;nbsp; soul &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;mp3 &amp;nbsp; &amp;nbsp; -wi-a- 12.00m&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Resizing LVs&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# lvresize -L 15M /dev/mp3/celtic
4 &amp;nbsp;Rounding up size to full physical extent 16.00 MiB
&amp;nbsp; Extending logical volume celtic to 16.00 MiB
&amp;nbsp; Logical volume celtic successfully resized
[root@zeus ~]# lvresize -L 12M /dev/mp3/celtic
&amp;nbsp; WARNING: Reducing active logical volume to 12.00 MiB
&amp;nbsp; THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce celtic? [y/n]: y
&amp;nbsp; Reducing logical volume celtic to 12.00 MiB
&amp;nbsp; Logical volume celtic successfully resized
&lt;/pre&gt;&lt;br /&gt;
Extending/Reducing VGs&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# vgs
&amp;nbsp; VG &amp;nbsp; &amp;nbsp; &amp;nbsp;#PV #LV #SN Attr &amp;nbsp; VSize &amp;nbsp;VFree
&amp;nbsp; mp3 &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; 3 &amp;nbsp; 0 wz--n- 92.00m 16.00m
&amp;nbsp; vg_zeus &amp;nbsp; 1 &amp;nbsp; 2 &amp;nbsp; 0 wz--n- &amp;nbsp;7.51g &amp;nbsp; &amp;nbsp; 0
[root@zeus ~]# vgextend mp3 /dev/sdc2
&amp;nbsp; Volume group &quot;mp3&quot; successfully extended
[root@zeus ~]# vgs
&amp;nbsp; VG &amp;nbsp; &amp;nbsp; &amp;nbsp;#PV #LV #SN Attr &amp;nbsp; VSize &amp;nbsp; VFree
&amp;nbsp; mp3 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; 3 &amp;nbsp; 0 wz--n- 424.00m 348.00m
&lt;/pre&gt;&lt;pre&gt;[root@zeus ~]# vgreduce mp3 /dev/sdc2
&amp;nbsp; Removed &quot;/dev/sdc2&quot; from volume group &quot;mp3&quot;
[root@zeus ~]#
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;Moving extents from one disk to another&lt;br /&gt;
&lt;br /&gt;
Make sure you VG has more than one disk. In this case I have sdc1 and sdc2 and will move the extents from sdc1 to sdc2&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# pvmove /dev/sdc1 /dev/sdc2
&amp;nbsp; /dev/sdc1: Moved: 0.0%
&amp;nbsp; /dev/sdc1: Moved: 21.1%
&amp;nbsp; /dev/sdc1: Moved: 31.6%
&amp;nbsp; /dev/sdc1: Moved: 47.4%
&amp;nbsp; /dev/sdc1: Moved: 57.9%
&amp;nbsp; /dev/sdc1: Moved: 68.4%
&amp;nbsp; /dev/sdc1: Moved: 78.9%
&amp;nbsp; /dev/sdc1: Moved: 84.2%
&amp;nbsp; /dev/sdc1: Moved: 100.0%
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;If now you take a look at sdc1 no extents are found in this partition (disc)&lt;/div&gt;&lt;pre&gt;&lt;div&gt;[root@zeus ~]# pvdisplay -v /dev/sdc1&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; Using physical volume(s) on command line&lt;/div&gt;&lt;div&gt;&amp;nbsp; --- Physical volume ---&lt;/div&gt;&lt;div&gt;&amp;nbsp; PV Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /dev/sdc1&lt;/div&gt;&lt;div&gt;&amp;nbsp; VG Name &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mp3&lt;/div&gt;&lt;div&gt;&amp;nbsp; PV Size &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 96.18 MiB / not usable 4.18 MiB&lt;/div&gt;&lt;div&gt;&amp;nbsp; Allocatable &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yes&lt;/div&gt;&lt;div&gt;&amp;nbsp; PE Size &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4.00 MiB&lt;/div&gt;&lt;div&gt;&amp;nbsp; Total PE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;23&lt;/div&gt;&lt;div&gt;&amp;nbsp; Free PE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 23&lt;/div&gt;&lt;div&gt;&amp;nbsp; Allocated PE &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&lt;/div&gt;&lt;div&gt;&amp;nbsp; PV UUID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XUKAwo-eZRI-Gq12-7oUb-4w8w-25rN-t64cBI&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Taking Snapshots&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;lvcreate -s -L50M -n rock_snapshot /dev/mp3/rock_and_roll&lt;br /&gt;
mount the snapshot, copy the frozen data and delete it.&lt;br /&gt;
lvremove /dev/mp3/rock_snapshot&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
FileSystems&lt;br /&gt;
&lt;br /&gt;
ACLs:&lt;br /&gt;
&lt;br /&gt;
dumpe2fs /dev/xxx | grep Defaults will show which are the default mouting options. acl, user_xattr must be listed to have acl support in first place.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;tune2fs -o acl,user_xattr /dev/xxx&lt;/blockquote&gt;can be issued to set the defaults mounting options.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;tune2fs&amp;nbsp;-o ^acl,^user_xattr /dev/xxx&lt;/blockquote&gt;can be issued to clear the defaults mounting options.&lt;br /&gt;
&lt;br /&gt;
These options are overwritten by /etc/fstab or options in the mount command line.&lt;br /&gt;
BTW, if you set the defaults mount options and mount the volume you won&#39;t be able to see the acl option listed in the output of mount. This can cause some confusion but acl will be enabled anyway.&lt;br /&gt;
&lt;br /&gt;
----------------&lt;br /&gt;
&lt;br /&gt;
Authentication&lt;br /&gt;
&lt;br /&gt;
To enable LDAP authentication run&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;authconfig-tui&lt;/blockquote&gt;&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;vi /etc/openldap/ldap.conf OR vi /etc/ldap.conf&lt;br /&gt;
URI ldap://127.0.0.1/&lt;br /&gt;
BASE dc=lutierigabriel&lt;br /&gt;
vim /etc/nsswitch.conf&lt;br /&gt;
add ldap to group, shadow, passwd&lt;/blockquote&gt;or&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;system-config-authentication&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
kickstart&lt;br /&gt;
&lt;br /&gt;
some options:&lt;br /&gt;
&lt;br /&gt;
zerombr&lt;br /&gt;
clearpart --all &lt;br /&gt;
&lt;br /&gt;
always use /root/anaconda-ks.cfg as a template. &lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
NFS&lt;br /&gt;
&lt;br /&gt;
Firewall&lt;br /&gt;
&lt;br /&gt;
TCP/2049&lt;br /&gt;
UDP/111,32769&lt;br /&gt;
TCP/32803,892&lt;br /&gt;
&amp;nbsp;All ports but 111 and 2049 has to be specified in /etc/sysconfig/nfs &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;yum install -y nfs-utils&amp;nbsp;&amp;nbsp;nfs4-acl-tools&lt;br /&gt;
chkconfig nfs on; chkconfig nfslock on; chkconfig rpcbind on&lt;br /&gt;
vim /etc/exports&lt;br /&gt;
/mnt &amp;nbsp; &amp;nbsp;*(ro,sync)&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;exportfs -avr -&amp;gt; reexport all directories&lt;/blockquote&gt;&lt;br /&gt;
Adjusting SELinux ( this will allow directories to be exported as RO and RW:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;getsebool -a | grep nfs&lt;br /&gt;
setsebool -P nfs_export_all_ro=1 nfs_export_all_rw=1&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;mounting a NFS share:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;mount localhost:/mnt /nfs&lt;/blockquote&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Verifying the exported directories on the server side:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;# cat /var/lib/nfs/etab
/mnt &amp;nbsp; &amp;nbsp;*(ro,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,no_subtree_check,secure_locks,acl,anonuid=65534,anongid=65534)
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Verifying the mount NFS share on the cliente side:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;nfsstat -m&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Persistent NFS mounts:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
rhel01:/opt/company_data &amp;nbsp; &amp;nbsp; /opt/company_data &amp;nbsp; &amp;nbsp; nfs4 &amp;nbsp; rw,sync &amp;nbsp;0 0&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Client side mounting option &lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
soft -&amp;gt; means that if a timeout occurs the process will give up and try again later. the device will become unavailable meanwhile&lt;br /&gt;
hard -&amp;gt; in the same situation as state above, the process will never give up on mounting/accessing the device. it will hang there &#39;til it gets mounted.&lt;br /&gt;
intr -&amp;gt; usually used along the hard option. means the besides hard it can be interrupted. usually better have hard, intr than soft.&lt;br /&gt;
&lt;br /&gt;
-------------------------------&lt;br /&gt;
&lt;br /&gt;
automount&lt;br /&gt;
&lt;br /&gt;
how to automount home directories:&lt;br /&gt;
&lt;br /&gt;
/etc/auto.master&lt;br /&gt;
/home/guests &amp;nbsp; &amp;nbsp; /etc/auto.guests&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/etec/auto.guests&lt;br /&gt;
* &amp;nbsp; -rw,soft,intr &amp;nbsp; instructor.example.com:/home/guests/&amp;amp;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
service autofs reload&lt;br /&gt;
&lt;br /&gt;
ls /home/guests/user1 -&amp;gt; will mount the user1 folder from the instructor box &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;-----------&lt;br /&gt;
&lt;br /&gt;
SetUID and SetGID&lt;br /&gt;
&lt;br /&gt;
setuid allows users to execute a file with privileges of the file&#39;s owner&lt;br /&gt;
&lt;br /&gt;
chmod u+s file&lt;br /&gt;
chmod 4755 file&lt;br /&gt;
find / -perm -4000&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
SetGID&lt;br /&gt;
chmod&amp;nbsp;g+s file&lt;br /&gt;
chmod 2755 file&lt;br /&gt;
find / -perm -2000&lt;br /&gt;
&lt;br /&gt;
Sticky bit (set on directories, only owner and root can delete contentes in the dir)&lt;br /&gt;
chmod +t sticky/&lt;br /&gt;
chmod 1755 sticky/&lt;br /&gt;
find / -perm -1000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------&lt;br /&gt;
&lt;br /&gt;
Virtualization (only available in 64 bits OS)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
yum install qemu-kvm qemu-img&lt;br /&gt;
&lt;br /&gt;
virsh list&lt;br /&gt;
virshlist --all&lt;br /&gt;
&lt;br /&gt;
virsh shutdown X&lt;br /&gt;
virsh start NAME&lt;br /&gt;
virt-viewer X&lt;br /&gt;
&lt;br /&gt;
virsh autostart --disable X&lt;br /&gt;
&amp;nbsp;virsh autostart X&lt;br /&gt;
&lt;br /&gt;
virt-viewer X&lt;br /&gt;
&lt;br /&gt;
Create a guess VM:&lt;br /&gt;
&lt;br /&gt;
virt-install –-name Client03 –-ram 512 –-disk path=/var/lib/libvirt/images/client03.img,size=8 –-network network=default –-cdrom /dev/cdrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
it&#39;s recommended to use /var/lib/libvirt/images to hold the virtual disks. to use other directory you should configure SELinux to allow it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Can also create via GUI with &lt;b&gt;virt-manager&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Useful commands&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;virsh connect localhost&lt;br /&gt;
virsh start guest1-rhel6-64&lt;br /&gt;
virsh stop guest1-rhel6-64&lt;br /&gt;
virsh list -all&lt;br /&gt;
virsh console&lt;br /&gt;
virsh autostart&amp;nbsp; X&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;virsh net-list&lt;br /&gt;
virsh net-start X&lt;/blockquote&gt;------------------&lt;br /&gt;
&lt;br /&gt;
SELinux&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;Make sure you have setroubleshoot-server so you will get nicer SELinux messages.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check how SELinux is running:&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;[root@zeus ~]# sestatus SELinux status:                 enabled SELinuxfs mount:                /selinux Current mode:                   enforcing Mode from config file:          enforcing Policy version:                 24 Policy from config file:        targeted [root@zeus ~]# getenforce Enforcing [root@zeus ~]# setenforce permissive [root@zeus ~]# sestatus SELinux status:                 enabled SELinuxfs mount:                /selinux Current mode:                   permissive Mode from config file:          enforcing Policy version:                 24 Policy from config file:        targeted [root@zeus ~]# setenforce enforcing [root@zeus ~]# getenforce Enforcing&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;div&gt;you can also edit /etc/selinux/config. Regardless of the method you should reboot the system. When you change the mode the files must be relabed (their contexts will change) this is done on the boot process.&lt;br /&gt;
&lt;br /&gt;
It is possible to disable enforcing mode, will only audit:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;setenforcing 0&lt;/blockquote&gt;&lt;br /&gt;
Check the boolean values or&lt;b&gt;&amp;nbsp;getsebool -a | grep http&lt;/b&gt;:&lt;br /&gt;
&lt;pre&gt;&amp;nbsp;sestatus -b | grep http
allow_httpd_anon_write &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;off
allow_httpd_mod_auth_ntlm_winbind &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
allow_httpd_mod_auth_pam &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;off
allow_httpd_sys_script_anon_write &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
httpd_builtin_scripting &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; on
httpd_can_check_spam &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;off
httpd_can_network_connect &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
httpd_can_network_connect_cobbler &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
httpd_can_network_connect_db &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;off
httpd_can_network_memcache &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;off
httpd_can_network_relay &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
httpd_can_sendmail &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;off
httpd_dbus_avahi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on
httpd_enable_cgi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;on
httpd_enable_ftp_server &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
httpd_enable_homedirs &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; off
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
While I was reading about SELinux I found something very useful that I didn&#39;t know until now. Well, during the reading the author says to issue a commando called semanage that will explain each of the boolean options. However, I don&#39;t have semanage on my system and don&#39;t know which package provides it. So, the following command told me what package I should install to have semanage.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;yum whatprovides *bin/semanage&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;
Here we go, from the output it&#39;s clear to me that&amp;nbsp;policycoreutils-python-2.0.83-19.1.el6.i686 has the binary that I was looking for.&lt;br /&gt;
&lt;br /&gt;
Ok. moving on... so, to see what each boolean value does, issue:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# semanage boolean -l | grep http
httpd_can_network_relay &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;gt; off &amp;nbsp; Allow httpd to act as a relay
httpd_can_network_connect_db &amp;nbsp; -&amp;gt; off &amp;nbsp; Allow HTTPD scripts and modules to connect to databases over the network.
httpd_use_gpg &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;-&amp;gt; off &amp;nbsp; Allow httpd to run gpg in gpg-web domain
httpd_enable_cgi &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; on &amp;nbsp; &amp;nbsp;Allow httpd cgi support
allow_httpd_mod_auth_pam &amp;nbsp; &amp;nbsp; &amp;nbsp; -&amp;gt; off &amp;nbsp; Allow Apache to use mod_auth_pam
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Changing boolean values:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;setsebool -P httpd_enable_homedirs=1&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Context is formed of:&lt;br /&gt;
&lt;i&gt;&lt;b&gt;User : &amp;nbsp;role &amp;nbsp;: &amp;nbsp;domain&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Users are usually one of these:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
unconfined_u: Unprotected user&lt;br /&gt;
system_u: System user&lt;br /&gt;
user_u: Normal user&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Roles are usually one of these:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;object_r: File&amp;nbsp;&lt;/div&gt;&lt;div&gt;system_r: Users and processes&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Domains (AKA type) are usually one of these:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;unconfined_r: Unprotected file or process&amp;nbsp;&lt;/div&gt;&lt;br /&gt;
httpd_t: used for httpd process.&lt;br /&gt;
....&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Roles do NOT have influence under files so object_r is used as a generic role for any file.&lt;br /&gt;
&lt;br /&gt;
Checking files&#39; context:&lt;br /&gt;
&lt;pre&gt;# ls -Z
-rw-------. root &amp;nbsp;root system_u:object_r:admin_home_t:s0 anaconda-ks.cfg
-rwxr-xr-x. root &amp;nbsp;root unconfined_u:object_r:admin_home_t:s0 a.out
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Checking processes&#39; context:&lt;/div&gt;&lt;pre&gt;&amp;nbsp;ps -eZ | &amp;nbsp;grep httpd
unconfined_u:system_r:httpd_t:s0 14784 ? &amp;nbsp; &amp;nbsp; &amp;nbsp; 00:00:00 httpd
unconfined_u:system_r:httpd_t:s0 14786 ? &amp;nbsp; &amp;nbsp; &amp;nbsp; 00:00:00 httpd
unconfined_u:system_r:httpd_t:s0 14787 ? &amp;nbsp; &amp;nbsp; &amp;nbsp; 00:00:00 httpd
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;Changing contexts (domains) &lt;a href=&quot;http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-Targeted_policy-Unconfined_processes.html&quot;&gt;http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-Targeted_policy-Unconfined_processes.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# touch myfile
[root@zeus ~]# ls -Z myfile
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 myfile
[root@zeus ~]# chcon -vu system_u myfile
changing security context of `myfile&#39;
[root@zeus ~]# ls -Z myfile
-rw-r--r--. root root system_u:object_r:admin_home_t:s0 myfile
[root@zeus ~]# chcon -vt etc_t myfile
changing security context of `myfile&#39;
[root@zeus ~]# ls -Z myfile
-rw-r--r--. root root system_u:object_r:etc_t:s0 &amp;nbsp; &amp;nbsp; &amp;nbsp; myfile
[root@zeus ~]# chcon -vr system_r myfile
changing security context of `myfile&#39;
[root@zeus ~]# ls -Z myfile
-rw-r--r--. root root system_u:system_r:etc_t:s0 &amp;nbsp; &amp;nbsp; &amp;nbsp; myfile&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;[root@zeus ~]# touch myfile2
[root@zeus ~]# ls -Z myfile2
-rw-r--r--. root root unconfined_u:object_r:admin_home_t:s0 myfile2
[root@zeus ~]# chcon --reference myfile myfile2
[root@zeus ~]# ls -Z myfile2
-rw-r--r--. root root system_u:system_r:etc_t:s0       myfile2

[root@zeus ~]# restorecon myfile
[root@zeus ~]# ls -Z myfile
-rw-r--r--. root root system_u:object_r:admin_home_t:s0 myfile
&lt;/pre&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
Changing ports for services:&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# semanage port -l | grep http
http_port_t &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tcp &amp;nbsp; &amp;nbsp; &amp;nbsp;80, 443, 488, 8008, 8009, 8443

[root@zeus ~]# semanage port -a -t http_port_t -p tcp 81

[root@zeus ~]# semanage port -l | grep http
http_port_t &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tcp &amp;nbsp; &amp;nbsp; &amp;nbsp;81, 80, 443, 488, 8008, 8009, 8443
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Every time you change a context it will be restored in the next file system relabel (next reboot).&lt;br /&gt;
To make changes permanentely run:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;semanage fcontext -a -t httpd_sys_content_t file1&lt;/blockquote&gt;&lt;br /&gt;
TIP:&lt;br /&gt;
some daemons have man pages talking about the contexts and booleans used by them. take a look:&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;pre&gt;[root@zeus ~]# apropos _selinux
ftpd_selinux         (8)  - Security-Enhanced Linux policy for ftp daemons
httpd_selinux        (8)  - Security Enhanced Linux Policy for the httpd daemon
init_selinuxmnt      (3)  - initialize the global variable selinux_mnt
is_selinux_enabled   (3)  - check whether SELinux is enabled
kerberos_selinux     (8)  - Security Enhanced Linux Policy for Kerberos
named_selinux        (8)  - Security Enhanced Linux Policy for the Internet Name server (named) daemon
nfs_selinux          (8)  - Security Enhanced Linux Policy for NFS
pam_selinux          (8)  - PAM module to set the default security context
rsync_selinux        (8)  - Security Enhanced Linux Policy for the rsync daemon
samba_selinux        (8)  - Security Enhanced Linux Policy for Samba
ypbind_selinux       (8)  - Security Enhanced Linux Policy for NIS
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;semanage fcontext -a -t httpd_sys_content_t &quot;/newweb(/.*)?&quot;&lt;br /&gt;
restorecon -R -v /newweb&lt;/blockquote&gt;&lt;br /&gt;
-------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Firewall&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&amp;nbsp;iptables -p icmp -h&lt;/blockquote&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;show all the possible icmp types :-)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
POSTROUTING -&amp;gt; SNAT --to-source x.x.x.x OR MASQUERADE&lt;br /&gt;
&lt;br /&gt;
----------&lt;br /&gt;
Rsyslog&lt;br /&gt;
&lt;br /&gt;
/etc/rsyslog.conf&lt;br /&gt;
&lt;br /&gt;
forwarding message to other host:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;nbsp;Remote machine
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;There are three ways to forward message: the traditional UDP transport, which is extremely lossy but standard, the plain TCP based trans-
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;port which loses messages only during certain situations but is widely available and the RELP transport which does not lose messages &amp;nbsp;but
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;is currently available only as part of rsyslogd 3.15.0 and above.

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;To &amp;nbsp;forward &amp;nbsp;messages &amp;nbsp;to another host via UDP, prepend the hostname with the at sign (&quot;@&quot;). &amp;nbsp;To forward it via plain tcp, prepend two at
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;signs (&quot;@@&quot;). To forward via RELP, prepend the string &quot;:omrelp:&quot; in front of the hostname.

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Example:
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; *.* @192.168.0.1
&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;------&lt;br /&gt;
&lt;br /&gt;
Apache&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Test/Parse the config file:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;service httpd configteste&lt;/blockquote&gt;&lt;b&gt;VirtualHost&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;NameVirtualHost 192.168.56.200:80


&amp;lt;VirtualHost 192.168.56.200:80&amp;gt;
serverName site1.asdf.com
DocumentRoot &quot;/var/www/site1&quot;
&amp;lt;/VirtualHost&amp;gt;


&amp;lt;VirtualHost 192.168.56.200:80&amp;gt;
Servername site2.asdf.com
DocumentRoot &quot;/var/www/site2&quot;
&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Password protected&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;pre&gt;&amp;lt;Directory &quot;/var/www/html/protected&quot;&amp;gt;
        AuthType        basic
        AuthName &quot;You are out&quot;
        AuthUserFile    &quot;/var/www/html/protected/.users&quot;
        Require user lutieri
        Options Indexes

        Order deny,allow
&amp;lt;/Directory&amp;gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CGI Scripts&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;ScriptAlias /bin &quot;/var/www/site1/bin&quot;
&lt;/pre&gt;&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&amp;lt;Directory &quot;/var/www/site1/bin/&quot;&amp;gt;
options ExecCGI Indexes
&amp;lt;/Directory&amp;gt;

Addhandler cgi-script .lgb
&lt;/pre&gt;&lt;br /&gt;
The script will need to produce HTML output. Usually means that the first line in your script needs to print out which mime type the script will produce. I.E:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;#!/bin/bash

echo &quot;Content-type: text/html\n\n&quot;;
echo &quot;Hello, World.&quot;;
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Except that I found out that printing a blank line instead of content-type... also works great.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Postfix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;alternatives --config mta&lt;/blockquote&gt;&lt;br /&gt;
-----------&lt;br /&gt;
&lt;br /&gt;
Bind&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# cat /var/named/dynamic/asdf.com
$TTL 1D
@       IN SOA  @ rname.invalid. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        NS      @
        A       127.0.0.1
site1   A       192.168.56.201
site2   A       192.168.56.202
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Master zone&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# cat /etc/named.conf
---SNIP---

zone &quot;asdf.com&quot;  IN {
        type master;
        file &quot;dynamic/asdf.com&quot;;
};
---SNIP---
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Forward zone:&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
the directive Forwarders can also be used in the global context.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;zone &quot;asdf.com&quot;  IN {
        type forward;
        forwarders {  66.33.206.206; };
};&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
--------------&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Samba&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If you create a directory and would like to share it, run:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&amp;nbsp;chcon -t samba_share_t /path&lt;/blockquote&gt;Allowing home directories to be shared:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[root@zeus ~]# &lt;b&gt;setsebool -P samba_enable_home_dirs on&lt;/b&gt;
[root@zeus ~]# getsebool samba_enable_home_dirs
samba_enable_home_dirs --&amp;gt; on
[root@zeus ~]# semanage boolean -l | grep  samba_enable_home_dirs
samba_enable_home_dirs         -&amp;gt; on    Allow samba to share users home directories.&lt;/pre&gt;&lt;br /&gt;
-P make the change to the boolean persistent across reboots.&lt;br /&gt;
&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;&amp;nbsp;semanage boolean -m --on &amp;nbsp;samba_enable_home_dirs&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
-----------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Vsftpd&lt;br /&gt;
&lt;br /&gt;
Allow anonymoys upload&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;setsebool&amp;nbsp;ftp_home_dir 1&lt;br /&gt;
chcon &amp;nbsp;-t public_content_rw_t /var/ftp/pub&lt;br /&gt;
setsebool  allow_ftpd_anon_write 1&lt;br /&gt;
chgrp -R ftp: /var/ftp/dropbox&lt;br /&gt;
chmod g=wx /var/ftp/dropbox&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
cat /etc/vsftpd/vstfpd.conf&lt;br /&gt;
&lt;pre&gt;anonymous_enable=YES
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd&#39;s)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
anon_upload_enable=YES
&lt;/pre&gt;&lt;br /&gt;
asdf&lt;br /&gt;
&lt;br /&gt;
VNC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
server side:&lt;br /&gt;
/etc/sysconfig/vncservers&lt;br /&gt;
&lt;br /&gt;
client side:&lt;br /&gt;
vncviewer -via server9 localhost:2&lt;br /&gt;
&lt;br /&gt;
this will make a ssh tunnel to server9 and tunnel the vnc connection.&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/955299235701995079/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/955299235701995079?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/955299235701995079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/955299235701995079'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2012/01/studying-for-rhsca-and-rhce.html' title='Studying for RHSCA and RHCE'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-8325779443009487539</id><published>2011-10-02T19:29:00.001-03:00</published><updated>2011-10-02T19:30:57.087-03:00</updated><title type='text'>Playing with ACLs on File Systems</title><content type='html'>&lt;b&gt;Enabling ACLs:&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;# mount -oremount,acl /&lt;/blockquote&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Before:&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# ll&lt;br /&gt;
total 20&lt;br /&gt;
-rw-------. 1 root root 1134 Oct  2 14:13 anaconda-ks.cfg&lt;br /&gt;
-rw-r--r--. 1 root root 8408 Oct  2 14:13 install.log&lt;br /&gt;
-rw-r--r--. 1 root root 3164 Oct  2 14:12 install.log.syslog&lt;br /&gt;
[root@zeus ~]# getfacl install.log&lt;br /&gt;
# file: install.log&lt;br /&gt;
# owner: root&lt;br /&gt;
# group: root&lt;br /&gt;
user::rw-&lt;br /&gt;
group::r--&lt;br /&gt;
other::r--&lt;/blockquote&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Giving user01 rwx permissions on install.log&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# setfacl -m u:user01:rwx install.log&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;After:&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# ll&lt;br /&gt;
total 24&lt;br /&gt;
-rw-------. 1 root root 1134 Oct  2 14:13 anaconda-ks.cfg&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: yellow;&quot;&gt;-rw-rwxr--+ 1 root root 8408 Oct  2 14:13 install.log&lt;/span&gt;&lt;br /&gt;
-rw-r--r--. 1 root root 3164 Oct  2 14:12 install.log.syslog&lt;br /&gt;
[root@zeus ~]# getfacl install.log&lt;br /&gt;
# file: install.log&lt;br /&gt;
# owner: root&lt;br /&gt;
# group: root&lt;br /&gt;
user::rw-&lt;br /&gt;
user:user01:rwx&lt;br /&gt;
group::r--&lt;br /&gt;
mask::rwx&lt;br /&gt;
other::r--&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;Removing the previous gaven permission:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# setfacl -x u:user01 install.log&lt;br /&gt;
[root@zeus ~]# getfacl install.log&lt;br /&gt;
# file: install.log&lt;br /&gt;
# owner: root&lt;br /&gt;
# group: root&lt;br /&gt;
user::rw-&lt;br /&gt;
group::r--&lt;br /&gt;
mask::r--&lt;br /&gt;
other::r--&lt;/blockquote&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Assigning and removing multiple entries:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;[user01@zeus ~]$ setfacl -m u:root:rw-,u:games:r-- a&lt;br /&gt;
[user01@zeus ~]$ getfacl a&lt;br /&gt;
# file: a&lt;br /&gt;
# owner: user01&lt;br /&gt;
# group: user01&lt;br /&gt;
user::rw-&lt;br /&gt;
user:root:rw-&lt;br /&gt;
user:games:r--&lt;br /&gt;
group::rw-&lt;br /&gt;
mask::rw-&lt;br /&gt;
other::r--&lt;br /&gt;
[user01@zeus ~]$ setfacl &amp;nbsp;-b a&lt;br /&gt;
[user01@zeus ~]$ getfacl a&lt;br /&gt;
# file: a&lt;br /&gt;
# owner: user01&lt;br /&gt;
# group: user01&lt;br /&gt;
user::rw-&lt;br /&gt;
group::rw-&lt;br /&gt;
other::r--&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/8325779443009487539/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/8325779443009487539?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/8325779443009487539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/8325779443009487539'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2011/10/playing-with-acls-on-file-systems.html' title='Playing with ACLs on File Systems'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-1321041570585849838</id><published>2011-10-02T14:47:00.002-03:00</published><updated>2011-10-02T14:58:05.853-03:00</updated><title type='text'>Managing File Systems</title><content type='html'>&lt;b&gt;Volumes metadata:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;# blkid&lt;br /&gt;
/dev/sda1: LABEL=&quot;Bootinho&quot; UUID=&quot;7aa20f0f-49f4-4601-bd30-9067519bb6c5&quot; TYPE=&quot;ext4&quot;&lt;br /&gt;
/dev/sda2: UUID=&quot;sWPlWO-lcYm-SLk2-E5Ho-0a6T-kdBt-YZG79V&quot; TYPE=&quot;LVM2_member&quot;&lt;br /&gt;
/dev/mapper/vg_zeus-lv_root: UUID=&quot;0b494d0c-b2c2-4dbc-a73f-392bd4860ed4&quot; TYPE=&quot;ext4&quot;&lt;br /&gt;
/dev/mapper/vg_zeus-lv_swap: UUID=&quot;e6602180-14f2-4f22-811a-f9fedc7d0387&quot; TYPE=&quot;swap&quot;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Labeling a volume:&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# e2label /dev/sda1 Bootinho&lt;/blockquote&gt;OR&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# tune2fs -L booootinho /dev/sda1&lt;br /&gt;
tune2fs 1.41.12 (17-May-2010)&lt;br /&gt;
[root@zeus ~]# e2label /dev/sda1&lt;br /&gt;
booootinho&lt;br /&gt;
[root@zeus ~]#&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Querying a volume&#39;s label&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# e2label /dev/sda1&lt;br /&gt;
Bootinho&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;Finding volumes with a specific name&lt;/b&gt;&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# findfs LABEL=Bootinho&lt;br /&gt;
/dev/sda1&lt;/blockquote&gt;&lt;br /&gt;
&lt;b&gt;Mount using volume&#39;s label&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# mount LABEL=Bootinho /boot/&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reparing an ext2/ext3/ext4 file system&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;[root@zeus ~]# umount /boot/&lt;br /&gt;
[root@zeus ~]# e2fsck -f /dev/sda1&lt;br /&gt;
e2fsck 1.41.12 (17-May-2010)&lt;br /&gt;
Pass 1: Checking inodes, blocks, and sizes&lt;br /&gt;
Pass 2: Checking directory structure&lt;br /&gt;
Pass 3: Checking directory connectivity&lt;br /&gt;
Pass 4: Checking reference counts&lt;br /&gt;
Pass 5: Checking group summary information&lt;br /&gt;
booootinho: 38/128016 files (2.6% non-contiguous), 43796/512000 blocks&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;Resizing an ext2/ext3/ext4 file system&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;[root@zeus ~]# resize2fs -p /dev/sda1&lt;br /&gt;
resize2fs 1.41.12 (17-May-2010)&lt;br /&gt;
The filesystem is already 512000 blocks long. &amp;nbsp;Nothing to do!&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/1321041570585849838/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/1321041570585849838?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/1321041570585849838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/1321041570585849838'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2011/10/managing-file-systems.html' title='Managing File Systems'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-2188717970688630348</id><published>2011-09-19T16:14:00.003-03:00</published><updated>2011-10-02T14:37:00.422-03:00</updated><title type='text'>LUN Scanning on linux</title><content type='html'>COPIED FROM&lt;br /&gt;
&lt;a href=&quot;http://support.dell.com/support/edocs/stor-sys/124t/en/124tvs16/install.html#enabling_lun_linux&quot;&gt;http://support.dell.com/support/edocs/stor-sys/124t/en/124tvs16/install.html#enabling_lun_linux&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
&lt;a href=&quot;http://tldp.org/HOWTO/SCSI-2.4-HOWTO/mlproc.html&quot;&gt;http://tldp.org/HOWTO/SCSI-2.4-HOWTO/mlproc.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To verify the detection of a tape drive, administrators should check  for its entry in /proc/scsi/scsi. Current versions of Linux may not scan  the logical storage unit (LUN) ID of every device. This can result in  some PowerVault devices not being identified or listed in the &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;/proc/scsi/scsi&lt;/span&gt; output.  Administrators can follow these steps to enable support for such  devices.&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;     Type &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;cat/proc/scsi/scsi&lt;/span&gt;.         The output will look similar to the following:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;Attached devices:&lt;br /&gt;
Host: scsi3 Channel: 00 Id: 00 Lun: 00&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Vendor:&amp;nbsp;&amp;nbsp;&amp;nbsp;Quantum Model: DLT VS160&amp;nbsp;&amp;nbsp;&amp;nbsp;Rev:      3100&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Type:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Sequential-Access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ANSI      SCSI revision: 03&lt;/span&gt;        &lt;/li&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=35083915&amp;amp;postID=2188717970688630348&quot; name=&quot;step2&quot;&gt;&lt;/a&gt;
&lt;li&gt;Identify the host adapter, channel number, target ID number, and  LUN number      for the first LUN of the device to be configured. In this example,  the Certance      Ultrium 2 (a drive in the PowerVault 124T) is shown at the address,  or nexus,      3 0 0 0 — which means host adapter 3, channel number 0, ID 0, and  LUN 0.      The PowerVault 124T always has the tape drive at LUN 0 and the robot  at LUN      1.        &lt;/li&gt;
&lt;li&gt;For each LUN that needs to be discovered by Linux, issue the  following command:          &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;echo  &quot;scsi add-single-device        &lt;i&gt;H C I L&lt;/i&gt;&quot;&amp;gt;/proc/scsi/scsi&lt;/span&gt;&lt;br /&gt;
H C I L refers to the nexus described in &lt;a href=&quot;http://support.dell.com/support/edocs/stor-sys/124t/en/124tvs16/install.html#step2&quot;&gt;step  2&lt;/a&gt;. So,        with the PowerVault 124T robot configured at LUN 1, type:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;echo &quot;scsi add-single-device  3 0      0 1&quot;&amp;gt;/proc/scsi/scsi&lt;/span&gt;          The echo command will force a scan of each device at the given  nexus.&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;     Type &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;cat /proc/scsi/scsi&lt;/span&gt;         again to verify that all devices are now listed. The output will  look similar        to the following:&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, mono;&quot;&gt;Attached devices:&lt;br /&gt;
Host: scsi3 Channel: 00 Id: 00 Lun: 00&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Vendor:&amp;nbsp;&amp;nbsp;&amp;nbsp;Quantum Model: DLT VS160&amp;nbsp;&amp;nbsp;&amp;nbsp;Rev:      3100&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Type:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Sequential-Access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ANSI      SCSI revision: 03          Attached devices:&lt;br /&gt;
Host: scsi3 Channel: 00 Id: 00 Lun: 01&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Vendor:&amp;nbsp;&amp;nbsp;&amp;nbsp;DELL Model: PV-124T&amp;nbsp;&amp;nbsp;&amp;nbsp;Rev:        V31&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Type:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Sequential-Access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ANSI        SCSI revision: 03&lt;br /&gt;
&lt;/span&gt;      Administrators should add the echo command to the Linux boot  scripts because        the device information is not persistent and must be created each  time the        system boots up. One example file that can be used for storing the  commands        is /etc/rc.local. Note that configuring additional devices on a  server or        a storage area network (SAN) can cause the devices to be  reordered, which        requires administrators to modify the commands. If the Fibre  Channel adapter        supports Persistent Bindings or an equivalent function, it can be  enabled        to reduce the chance of devices being reordered upon discovery.&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;2&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;     &lt;td valign=&quot;top&quot; width=&quot;3&quot;&gt;&lt;img src=&quot;http://support.dell.com/support/edocs/stor-sys/124t/en/124tvs16/note.gif&quot; /&gt;&lt;/td&gt;     &lt;td valign=&quot;top&quot; width=&quot;870&quot;&gt;&lt;b&gt;NOTE:&lt;/b&gt; This procedure must be run  each time the server is booted. Also, if backup application services  are running (for example, they automatically start when the OS loads),  they must be disabled and re-enabled after the above procedure.&lt;/td&gt;   &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;The other way to enable LUN support is to recompile the kernel and  enable LUN scanning in the Adaptec driver, but it requires advanced  knowledge of Linux and will not be covered here. However, it will allow  the server to always boot and see the device without any manual  procedures.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This procedure also applies when a new Volume (LUN) is created in a storage system and is correctly mapped to the host. In this case is necessary to ReScan the target to update the LUNs in the OS.&lt;br /&gt;
&lt;br /&gt;
In the former case &lt;b&gt;partprobe &lt;/b&gt;can be issued to update the partition table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;keywords: medium changer, linux, 124, TL2000, TL4000, tape device&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/2188717970688630348/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/2188717970688630348?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2188717970688630348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2188717970688630348'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2011/09/lun-scanning-on-linux.html' title='LUN Scanning on linux'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-873324344922819284</id><published>2011-09-11T16:38:00.002-03:00</published><updated>2011-09-11T18:21:30.012-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="RAID"/><title type='text'>mounting RAID devices on boot</title><content type='html'>if you already have a software RAID configured with mdadm it won&#39;t reassemble automatically on each boot. in order to have it reassembling do the following:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm --detail --scan &amp;gt; /etc/mdadm.conf&amp;nbsp;&lt;/blockquote&gt;&lt;br /&gt;
That&#39;s pretty much it!&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Other useful commands:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Creating a RAID:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm -Cv /dev/md1 -level=1 -n2 /dev/sdb1 /dev/sdc1&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
watching the building/rebuild status&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;cat /proc/mdstat&lt;/blockquote&gt;&lt;br /&gt;
Check the RAID state:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm -D /dev/md1&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Simulates a failed drive:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm /dev/md1 -f /dev/sdc1&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
Add a new drive (partition) to replaced the failed one:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm --manage /dev/md1 -a /dev/sdb2&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
To reuse the failed drive one have to remove it and add it again to the array:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm --manage /dev/md1 -r /dev/sdc1&lt;br /&gt;
mdadm --manage /dev/dm1 -a /dev/sdc1&lt;/blockquote&gt;&lt;br /&gt;
Stopping a RAID:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm -S /dev/md1&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To &quot;remount&quot; a stopped or un-assembled RAID:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm --assemble /dev/md1 /dev/sdb1 /dev/sdc1&lt;/blockquote&gt;&lt;br /&gt;
OR&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;mdadm --assemble --scan&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
one more time the gentoo wiki has thousands of good info regarding software-based RAID:&lt;br /&gt;
&lt;a href=&quot;http://en.gentoo-wiki.com/wiki/RAID/Software&quot;&gt;http://en.gentoo-wiki.com/wiki/RAID/Software&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/873324344922819284/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/873324344922819284?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/873324344922819284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/873324344922819284'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2011/09/mounting-raid-devices-on-boot.html' title='mounting RAID devices on boot'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-7531303272995319757</id><published>2011-04-07T10:20:00.000-03:00</published><updated>2011-04-07T10:20:37.202-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel"/><title type='text'>Add horizontal/vertical line to a char in Excel</title><content type='html'>There are two methos:&lt;br /&gt;
&lt;br /&gt;
Using dummy series or using dummy error bars.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://peltiertech.com/Excel/Charts/AddLineHorzSeries.html&quot;&gt;http://peltiertech.com/Excel/Charts/AddLineHorzSeries.html&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/7531303272995319757/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/7531303272995319757?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/7531303272995319757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/7531303272995319757'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2011/04/add-horizontalvertical-line-to-char-in.html' title='Add horizontal/vertical line to a char in Excel'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-1180306280130806801</id><published>2011-03-27T19:30:00.001-03:00</published><updated>2011-03-27T19:31:08.614-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="benchmarks"/><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="redes"/><title type='text'>Tools for network analysis/traffic simulation for Linux</title><content type='html'>&lt;div style=&quot;color: black;&quot;&gt;I always forget the name of these guys: &lt;/div&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Well known:&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;iptraf&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;darkstat&lt;/li&gt;
&lt;li&gt;iperf&lt;/li&gt;
&lt;li&gt;tcpstat&lt;/li&gt;
&lt;li&gt;ntop &lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;I never used before:&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;ul&gt;&lt;ul&gt;&lt;li&gt; tcpflow&lt;/li&gt;
&lt;li&gt;tcpslice&lt;/li&gt;
&lt;li&gt;tcptrace&lt;/li&gt;
&lt;li&gt;ngrep&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/1180306280130806801/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/1180306280130806801?isPopup=true' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/1180306280130806801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/1180306280130806801'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2011/03/tools-for-network-analysistraffic.html' title='Tools for network analysis/traffic simulation for Linux'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-5580681376331379402</id><published>2010-10-15T11:39:00.004-03:00</published><updated>2011-03-28T10:51:56.690-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="exchange"/><category scheme="http://www.blogger.com/atom/ns#" term="powershell"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Exchange 2k10: Installation Requirements</title><content type='html'>Instead of ticking dozens of checkboxes heres is a few commands that would help installing all(almost?) the req. for Exchange 2k10.&lt;br /&gt;
&lt;br /&gt;
Open Powershell with elevated rights using &quot;Run As Administrator&quot;, and run below cmdlets to install prerequisites...&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;Import-Module ServerManager&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote&gt;Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy -Restart&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote&gt;Set-Service NetTcpPortSharing -StartupType Automatic&lt;/blockquote&gt;&lt;br /&gt;
This will install all the features and reboot the machine.&lt;br /&gt;
&lt;br /&gt;
Here there is a table with each set of requirements and commands necessary for the role you plan to install:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.messagingtalk.org/exchange-2010-rc-quick-installation-guide&quot;&gt;http://www.messagingtalk.org/exchange-2010-rc-quick-installation-guide&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;hr /&gt;&lt;br /&gt;
Even better, there are a couple of XML file containing all the requirements for different installations:&lt;br /&gt;
&lt;br /&gt;
Look at DVD:\Scripts and you will find these files:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;exchange-all.xml – all server roles&lt;/li&gt;
&lt;li&gt;exchange-base.xml – only the requirements for Forest and Domain prep operations&lt;/li&gt;
&lt;li&gt;exchange-cadb.xml – Central Admin Database role&lt;/li&gt;
&lt;li&gt;exchange-cas.xml – Client Access Server role&lt;/li&gt;
&lt;li&gt;exchange-eca.xml – Central Admin role&lt;/li&gt;
&lt;li&gt;exchange-edge.xml – Edge Transport Server role&lt;/li&gt;
&lt;li&gt;exchange-hub.xml – Hub Transport Server role&lt;/li&gt;
&lt;li&gt;exchange-mbx.xml – Mailbox Server role&lt;/li&gt;
&lt;li&gt;exchange-typical.xml – Typical Exchange server (Client Access, Hub Transport, and Mailbox Server roles)&lt;/li&gt;
&lt;li&gt;exchange-um.xml – Unified Messaging role&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
run, for instance:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;servermanagercmd -ip exchange-typical.xml&lt;/blockquote&gt;&lt;br /&gt;
include -restart if you want it to restart automatically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Source:&lt;br /&gt;
&lt;a href=&quot;http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/0aefcc92-dc32-40cf-bf24-341d41974d0e&quot;&gt; http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/0aefcc92-dc32-40cf-bf24-341d41974d0e&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://exchangeserverpro.com/installing-exchange-server-2010-pre-requisites-on-windows-server-2008&quot;&gt;http://exchangeserverpro.com/installing-exchange-server-2010-pre-requisites-on-windows-server-2008&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/5580681376331379402/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/5580681376331379402?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/5580681376331379402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/5580681376331379402'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/10/exchange-2k10-installation-requirements.html' title='Exchange 2k10: Installation Requirements'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-3240670264053485754</id><published>2010-09-23T17:51:00.000-03:00</published><updated>2010-09-23T17:51:21.150-03:00</updated><title type='text'>Copy music from ipod/iphone back to PC</title><content type='html'>use:&lt;br /&gt;
&lt;br /&gt;
http://www.getsharepod.com/&lt;br /&gt;
&lt;br /&gt;
It&#39;s free!!&lt;br /&gt;
&lt;br /&gt;
If you are like me and decided to control what goes in and comes out from you ipod, read: manual sync for all items is checked. Then you might need to get the apps installed back to iTunes at some point. For instance, if you will be upgrading the firmware. It&#39;s pretty simple:&lt;br /&gt;
&lt;br /&gt;
iTunes - Store - Authorize this computer&lt;br /&gt;
iTunes - File - Transfer purchases from XXXXX iPhone&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/3240670264053485754/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/3240670264053485754?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3240670264053485754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3240670264053485754'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/09/copy-music-from-ipodiphone-back-to-pc.html' title='Copy music from ipod/iphone back to PC'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-3738831720964042117</id><published>2010-05-03T20:09:00.002-03:00</published><updated>2010-05-03T20:22:30.186-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gdb"/><title type='text'>debugging with GDB</title><content type='html'>Print value as hexa: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;print/x variable&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;p/x variable&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you need more printing formats type: help x&lt;br /&gt;basically:&lt;br /&gt;&lt;br /&gt;s -&gt; string&lt;br /&gt;c -&gt; char&lt;br /&gt;t -&gt; binary&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;if you coded something like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;char * stream;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;then you allocate enough memory to store you text and try to print out the contents with &lt;span style=&quot;font-weight:bold;&quot;&gt;p *stream&lt;/span&gt; you will get just the first character,  I guess this is because gdb sees stream as a char(1 byte long). To get the whole string one should use: &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;p/s (char[3])*p1.question.qname&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;p/s *p1.question.qname@3&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;These lines will print the first 3 chars of the string&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/3738831720964042117/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/3738831720964042117?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3738831720964042117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3738831720964042117'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/05/debugging-with-gdb.html' title='debugging with GDB'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-3440889147426822552</id><published>2010-01-13T20:26:00.002-02:00</published><updated>2010-01-13T20:27:42.756-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="openfire"/><title type='text'>OpenFire Ports</title><content type='html'>Openfire uses ports 5222, 7777, 9090, 9091 for client connections, file transfer proxy, http web administration and the secured administration respectively.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Is this both TCP and UDP? anyone?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.tonybhimani.com/2007/12/31/openfire-jabberxmpp-server-on-centos-mini-howto/&quot;&gt;http://www.tonybhimani.com/2007/12/31/openfire-jabberxmpp-server-on-centos-mini-howto/&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/3440889147426822552/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/3440889147426822552?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3440889147426822552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3440889147426822552'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/01/openfire-ports.html' title='OpenFire Ports'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-4226532235764016461</id><published>2010-01-12T10:58:00.003-02:00</published><updated>2010-01-13T20:25:51.823-02:00</updated><title type='text'>time to be used in command line</title><content type='html'>_`date &quot;+%d-%m-%Y_%H-%M-%S&quot;`&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;backup, time, date&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/4226532235764016461/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/4226532235764016461?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/4226532235764016461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/4226532235764016461'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/01/time-to-be-used-in-command-line.html' title='time to be used in command line'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-691925654399402806</id><published>2010-01-06T20:09:00.002-02:00</published><updated>2010-01-06T20:13:05.274-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><category scheme="http://www.blogger.com/atom/ns#" term="xorg"/><title type='text'>Starting X on a differente VT</title><content type='html'>That one was kind of tricky! The documentation is not explicit about that. But here is:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; startx -- :1 vt2 &lt;/blockquote&gt;The above command will start a new display(:1) in the second virtual terminal(accessed by pressing Ctrl+Alt+F2)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source: &lt;a href=&quot;http://www.computing.net/answers/linux/how-to-boot-knoppix-as-root/28471.html&quot;&gt;http://www.computing.net/answers/linux/how-to-boot-knoppix-as-root/28471.html&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/691925654399402806/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/691925654399402806?isPopup=true' title='10 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/691925654399402806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/691925654399402806'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/01/starting-x-on-differente-vt.html' title='Starting X on a differente VT'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-3729845681185403139</id><published>2010-01-06T18:58:00.004-02:00</published><updated>2010-01-06T20:08:50.650-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="linux"/><title type='text'>How to disable extra ttys</title><content type='html'>For some reason new distros are no longer using /etc/inittab. /etc/event.d/ is used instead.&lt;br /&gt;&lt;br /&gt;In order to disable a virtual terminal you can basically exclude or move to another directory the files representing the VT. tty1 for VT1(accessed by Ctrl+Alt+F1), so on and so forth.&lt;br /&gt;&lt;br /&gt;source: &lt;a href=&quot;http://crunchbanglinux.org/wiki/howto/disable_extra_ttys&quot;&gt;http://crunchbanglinux.org/wiki/howto/disable_extra_ttys&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/3729845681185403139/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/3729845681185403139?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3729845681185403139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/3729845681185403139'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2010/01/how-to-disable-extra-ttys.html' title='How to disable extra ttys'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-6352029635030395424</id><published>2009-12-05T23:09:00.002-02:00</published><updated>2009-12-05T23:21:01.400-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dc"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>How find out which windows DC you logged in</title><content type='html'>So simple:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;echo %LOGONSERVER%&lt;/blockquote&gt;or&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;systeminfo&lt;/blockquote&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;To get a list os availble DC&#39;s in a specific domain:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;nltest /dclist:&lt;span style=&quot;font-style: italic;&quot;&gt;domain.com&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;veriyfing that a domain controller can be located for a specific domain&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;nltest /dsgetdc:&lt;span style=&quot;font-style: italic;&quot;&gt;domain.com&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;More info:&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/247811&quot;&gt;How Domain Controllers Are Located in Windows&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/6352029635030395424/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/6352029635030395424?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/6352029635030395424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/6352029635030395424'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/12/how-find-out-which-windows-dc-you.html' title='How find out which windows DC you logged in'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-2278732020782735456</id><published>2009-11-23T14:44:00.005-02:00</published><updated>2009-11-23T15:11:48.556-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="ntlm"/><title type='text'>Descobrir SID de Grupos Windows</title><content type='html'>Caso você não consiga utilizar a sintaxe dominio\grupo com o ntlm-auth ou qualquer outro binário que utilize esse formato. É possível utilizar o SID do objeto.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;# ntlm_auth --username=teste --password=senha --require-membership-of=domain\\gg_hr&lt;br /&gt;[2009/11/23 14:45:31, 0] utils/ntlm_auth.c:get_require_membership_sid(236)&lt;br /&gt; Could not parse domain\group into seperate domain/name parts!&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;# wbinfo -n gg_hr&lt;/blockquote&gt;&lt;br /&gt;S-1-5-21-2153899196-3371015479-2672548576-1129 Domain Group (2)&lt;br /&gt;&lt;br /&gt;ou ADSI Edit do windows objectSID&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/2278732020782735456/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/2278732020782735456?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2278732020782735456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2278732020782735456'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/11/descobrir-sid-de-grupos-windows.html' title='Descobrir SID de Grupos Windows'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-1292114843699717519</id><published>2009-11-11T13:26:00.004-02:00</published><updated>2009-11-11T13:54:38.771-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="nagios"/><category scheme="http://www.blogger.com/atom/ns#" term="vbscripts"/><title type='text'>some vbscript for Nagios checks</title><content type='html'>&lt;span style=&quot;font-weight: bold;&quot;&gt;Detect if media is connected to a interface:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;aStatusStr = Split(&quot;Disconnected,Connecting,Connected,Disconnecting,&quot; _&lt;br /&gt;&amp;amp; &quot;Hardware not present,Hardware disabled,Hardware malfunction,&quot; _&lt;br /&gt;&amp;amp; &quot;Media disconnected,Authenticating,Authentication succeeded,&quot; _&lt;br /&gt;&amp;amp; &quot;Authentication failed,Invalid address,Credentials required&quot;, &quot;,&quot;)&lt;br /&gt;&lt;br /&gt;strComputer = &quot;.&quot;&lt;br /&gt;Set oWMI = GetObject(&quot;winmgmts:&quot; _&lt;br /&gt;  &amp;amp; &quot;{impersonationLevel=impersonate}!\\&quot; &amp;amp; strComputer _&lt;br /&gt;  &amp;amp; &quot;\root\cimv2&quot;)&lt;br /&gt;&lt;br /&gt;Set cItems = oWMI.ExecQuery(&quot;Select * from Win32_NetworkAdapter&quot;_&lt;br /&gt;         &amp;amp; &quot; where AdapterTypeID = 0&quot;) &#39; 0 = Ethernet 802.3&lt;br /&gt;&lt;br /&gt;For Each oItem in cItems&lt;br /&gt;&#39;&#39;if Instr(oItem.NetConnectionID, &quot;LAN&quot;) &amp;gt; 0 then&lt;br /&gt;&lt;br /&gt;if oItem.NetConnectionID &amp;lt;&amp;gt; &quot;&quot; then&lt;br /&gt;&lt;br /&gt;  output = output &amp;amp; oItem.NetConnectionID &amp;amp; &quot;: &quot;_&lt;br /&gt;           &amp;amp; aStatusStr(oItem.NetConnectionStatus) &amp;amp; &quot; * &quot;&lt;br /&gt;    &lt;br /&gt;End if&lt;br /&gt;&#39;&#39;End if&lt;br /&gt;Next&lt;br /&gt;&lt;br /&gt;Wsh.echo output&lt;br /&gt;WScript.Quit(0)&lt;br /&gt;&#39;&#39;&#39; Source: http://msdn.microsoft.com/en-us/library/aa394216%28VS.85%29.aspx&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Detect which node is the Active and Passive in a Windows Cluster environment:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;set WshShell = CreateObject( &quot;WScript.Shell&quot; )  &lt;br /&gt;&lt;br /&gt;Set objNet = CreateObject(&quot;WScript.NetWork&quot;) &lt;br /&gt;                      &lt;br /&gt;Dim strComputerName&lt;br /&gt;strComputerName =  objNet.ComputerName&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sExe = &quot;cluster resource &quot;&quot;cluster ip address&quot;&quot;&quot;&lt;br /&gt;with CreateObject(&quot;WScript.Shell&quot;)&lt;br /&gt;  with .Exec(sExe)&lt;br /&gt;    with .StdOut&lt;br /&gt;      do until .AtEndofStream&lt;br /&gt;        s = s &amp; Replace(.ReadLine, vbcr, &quot;&quot;) _&lt;br /&gt;          &amp; vbNewLine&lt;br /&gt;      Loop&lt;br /&gt;    end with &#39; StdOut&lt;br /&gt;  end with &#39; Exec&lt;br /&gt;end with &#39; Shell&lt;br /&gt;&lt;br /&gt;&#39;wsh.echo s &lt;br /&gt;Result = InStr(1, s, strComputerName, VBTEXTCOMPARE)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if Result &amp;lt;&amp;gt; 0 then&lt;br /&gt;WScript.echo strComputerName &amp; &quot; is the ACTIVE&quot;&lt;br /&gt;Else&lt;br /&gt;WScript.echo strComputerName &amp; &quot; is the PASSIVE&quot;&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;WScript.Quit(0)&lt;br /&gt;&lt;/code&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/1292114843699717519/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/1292114843699717519?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/1292114843699717519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/1292114843699717519'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/11/some-vbscript-for-nagios-checks.html' title='some vbscript for Nagios checks'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-469105723721077983</id><published>2009-11-04T17:32:00.005-02:00</published><updated>2009-12-05T14:12:01.839-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="lvm"/><title type='text'>Resizing physical disk and logical volumes</title><content type='html'>This is a VM which had the HD resized. Now it&#39;s time to resize the LVM partition, actually you don&#39;t do that, you will resize the PV.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;sles11_php:~ # fdisk -l /dev/sda&lt;br /&gt;&lt;br /&gt;Disk /dev/sda: 16.1 GB, 16106127360 bytes&lt;br /&gt;255 heads, 63 sectors/track, 1958 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;Disk identifier: 0x0005035d&lt;br /&gt;&lt;br /&gt;  Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sda1   *           2           9       64260   83  Linux&lt;br /&gt;/dev/sda2              10          74      522112+  82  Linux swap / Solaris&lt;br /&gt;/dev/sda3              75        1958    15133230   8e  Linux LVM&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here you can see sda3 now with 15Gb&lt;br /&gt;&lt;br /&gt;Now it&#39;s time to resize the PV&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sles11_php:~ # pvdisplay&lt;br /&gt; --- Physical volume ---&lt;br /&gt; PV Name               /dev/sda3&lt;br /&gt; VG Name               VGroot&lt;br /&gt; PV Size               9.43 GB / not usable 263.50 KB&lt;br /&gt; Allocatable           yes&lt;br /&gt; PE Size (KByte)       4096&lt;br /&gt; Total PE              2414&lt;br /&gt; Free PE               238&lt;br /&gt; Allocated PE          2176&lt;br /&gt; PV UUID               LGgBQf-sw8J-fbnu-1EHL-0z1G-J31k-eAJoXc&lt;br /&gt;&lt;br /&gt;sles11_php:~ # pvscan&lt;br /&gt; PV /dev/sda3   VG VGroot   lvm2 [9.43 GB / 952.00 MB free]&lt;br /&gt; Total: 1 [9.43 GB] / in use: 1 [9.43 GB] / in no VG: 0 [0   ]&lt;br /&gt;&lt;br /&gt;sles11_php:~ # pvresize /dev/sda3&lt;br /&gt; Physical volume &quot;/dev/sda3&quot; changed&lt;br /&gt; 1 physical volume(s) resized / 0 physical volume(s) not resized&lt;br /&gt;&lt;br /&gt;sles11_php:~ # pvdisplay&lt;br /&gt; --- Physical volume ---&lt;br /&gt; PV Name               /dev/sda3&lt;br /&gt; VG Name               VGroot&lt;br /&gt; PV Size               14.43 GB / not usable 2.36 MB&lt;br /&gt; Allocatable           yes&lt;br /&gt; PE Size (KByte)       4096&lt;br /&gt; Total PE              3694&lt;br /&gt; Free PE               1518&lt;br /&gt; Allocated PE          2176&lt;br /&gt; PV UUID               LGgBQf-sw8J-fbnu-1EHL-0z1G-J31k-eAJoXc&lt;br /&gt;&lt;br /&gt;sles11_php:~ #&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sles11_php:~ # vgdisplay&lt;br /&gt; --- Volume group ---&lt;br /&gt; VG Name               VGroot&lt;br /&gt; System ID&lt;br /&gt; Format                lvm2&lt;br /&gt; Metadata Areas        1&lt;br /&gt; Metadata Sequence No  8&lt;br /&gt; VG Access             read/write&lt;br /&gt; VG Status             resizable&lt;br /&gt; MAX LV                0&lt;br /&gt; Cur LV                6&lt;br /&gt; Open LV               6&lt;br /&gt; Max PV                0&lt;br /&gt; Cur PV                1&lt;br /&gt; Act PV                1&lt;br /&gt; VG Size               14.43 GB&lt;br /&gt; PE Size               4.00 MB&lt;br /&gt; Total PE              3694&lt;br /&gt; Alloc PE / Size       2176 / 8.50 GB&lt;br /&gt; Free  PE / Size       1518 / 5.93 GB&lt;br /&gt; VG UUID               CexmBK-uOq6-fnjo-qxFV-SIWW-04ZM-LENpdq&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The VG didn&#39;t need any changes.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;sles11_php:~ # lvresize -l +50%FREE /dev/VGroot/LVusr&lt;br /&gt; Extending logical volume LVusr to 5.46 GB&lt;br /&gt; Logical volume LVusr successfully resized&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sles11_php:~ # df -h&lt;br /&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;/dev/mapper/VGroot-LVroot&lt;br /&gt;                    1014M  357M  658M  36% /&lt;br /&gt;udev                  248M  104K  247M   1% /dev&lt;br /&gt;/dev/sda1              61M   16M   42M  28% /boot&lt;br /&gt;/dev/mapper/VGroot-LVhome&lt;br /&gt;                    1014M  4.3M 1010M   1% /home&lt;br /&gt;/dev/mapper/VGroot-LVopt&lt;br /&gt;                    1014M   60M  955M   6% /opt&lt;br /&gt;/dev/mapper/VGroot-LVtmp&lt;br /&gt;                    1014M  5.5M 1009M   1% /tmp&lt;br /&gt;/dev/mapper/VGroot-LVusr&lt;br /&gt;                     2.5G  2.4G  140M  95% /usr&lt;br /&gt;/dev/mapper/VGroot-LVvar&lt;br /&gt;                     2.0G  235M  1.8G  12% /var&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sles11_php:~ # xfs_growfs  /usr/&lt;br /&gt;meta-data=/dev/mapper/VGroot-LVusr isize=256    agcount=4, agsize=163840 blks&lt;br /&gt;        =                       sectsz=512   attr=2&lt;br /&gt;data     =                       bsize=4096   blocks=655360, imaxpct=25&lt;br /&gt;        =                       sunit=0      swidth=0 blks&lt;br /&gt;naming   =version 2              bsize=4096   ascii-ci=0&lt;br /&gt;log      =internal               bsize=4096   blocks=2560, version=2&lt;br /&gt;        =                       sectsz=512   sunit=0 blks, lazy-count=0&lt;br /&gt;realtime =none                   extsz=4096   blocks=0, rtextents=0&lt;br /&gt;data blocks changed from 655360 to 1432576&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sles11_php:~ # df -h&lt;br /&gt;Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;/dev/mapper/VGroot-LVroot&lt;br /&gt;                    1014M  357M  658M  36% /&lt;br /&gt;udev                  248M  104K  247M   1% /dev&lt;br /&gt;/dev/sda1              61M   16M   42M  28% /boot&lt;br /&gt;/dev/mapper/VGroot-LVhome&lt;br /&gt;                    1014M  4.3M 1010M   1% /home&lt;br /&gt;/dev/mapper/VGroot-LVopt&lt;br /&gt;                    1014M   60M  955M   6% /opt&lt;br /&gt;/dev/mapper/VGroot-LVtmp&lt;br /&gt;                    1014M  5.5M 1009M   1% /tmp&lt;br /&gt;/dev/mapper/VGroot-LVusr&lt;br /&gt;                     5.5G  2.4G  3.2G  44% /usr&lt;br /&gt;/dev/mapper/VGroot-LVvar&lt;br /&gt;                     2.0G  235M  1.8G  12% /var&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is a list of tools you need to extend each partition&#39;s type:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html&quot;&gt;http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An excellent howto in LVM:&lt;br /&gt;&lt;a href=&quot;http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/LVM-HOWTO.html&quot;&gt;http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/LVM-HOWTO.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Resizing a ext3 partition with progress bar :)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;e2fsck -f -C 0 /dev/xxx&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;If you forget the -C 0(zero) option you can send a SIGUSR1 signal to the process, like this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;kill -SIGUSR1 e2fsc_PID&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Now it&#39;s time to actually resize:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;resize2fs -p /dev/xxx&lt;/blockquote&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/469105723721077983/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/469105723721077983?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/469105723721077983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/469105723721077983'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/11/resizing-physical-disk-and-logical.html' title='Resizing physical disk and logical volumes'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-119555156332899085</id><published>2009-10-30T09:09:00.001-02:00</published><updated>2009-10-30T09:11:31.887-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="samba"/><title type='text'>samba binding only a specifig interface</title><content type='html'>Tip: If your box has multiple NICs, you may not want Samba to broadcast its presence on both interfaces. To make it only use one IP add the following, in [global]:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;interfaces = [interface_ip]/32 127.0.0.1/8&lt;br /&gt;bind only interfaces = yes&lt;/blockquote&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/119555156332899085/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/119555156332899085?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/119555156332899085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/119555156332899085'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/samba-binding-only-specifig-interface.html' title='samba binding only a specifig interface'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-7068845472609101815</id><published>2009-10-28T16:23:00.005-02:00</published><updated>2009-10-28T16:41:58.442-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iptables"/><title type='text'>Managing cached connections</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;I&#39;m developing a script to failover different links when one of them fails. After some tests I could see some strange behavior. After changing the routing table, flushing the route cache, removing the NAT rule and creating a new one to satisfy the new link, the packets were going out through the new  interface(specified in the new route) but using the translated IP address of the old NAT rule.&lt;br /&gt;&lt;br /&gt;After some research I found out that linux kernel keeps a kind of cache for all connections, maybe just the NATed ones?!&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The nice thing is you can see this table:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt; cat /proc/net/ip_conntrack&lt;/blockquote&gt;&lt;br /&gt;The netfilter team also developed a tool to manage this table, flush, list, delete, add entries, etc.&lt;br /&gt;It&#39;s called conntrack-tools. It&#39;s a replacement for the /proc interface. What you will need is to compile and install the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;libnfnetlink&lt;br /&gt;libnetfilter_conntrack&lt;br /&gt;conntrack-tools&lt;br /&gt;&lt;br /&gt;You can download all the sources from:&lt;br /&gt;&lt;a href=&quot;http://conntrack-tools.netfilter.org/downloads.html&quot;&gt;http://conntrack-tools.netfilter.org/downloads.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After installed you can call the conntrack binary.&lt;br /&gt;I.e.:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;conntrack -L -d x.x.x.x&lt;/blockquote&gt;&lt;br /&gt;The above command list all entries with x.x.x.x destination IP.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;conntrack -F&lt;/blockquote&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The above command flushes the whole table. That&#39;s exactly what I have to do in order in my fail-over scripts.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;conntrack -L -m 11&lt;/blockquote&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;If you&#39;re using the MARK target in any iptables rule you can check out if the packets are being marked correctly with the above command. This command list all the connections with mark=11(-j MARK --set-mark 11)&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://linux.derkeiler.com/Mailing-Lists/Debian/2005-08/3411.html&quot;&gt;http://linux.derkeiler.com/Mailing-Lists/Debian/2005-08/3411.html&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://lists.netfilter.org/pipermail/netfilter-devel/2002-October/009530.html&quot;&gt;http://lists.netfilter.org/pipermail/netfilter-devel/2002-October/009530.html&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://mailman.ds9a.nl/pipermail/lartc/2003q1/007249.html&quot;&gt;http://mailman.ds9a.nl/pipermail/lartc/2003q1/007249.html&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://linux.die.net/man/8/conntrack&quot;&gt;http://linux.die.net/man/8/conntrack&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.mail-archive.com/netfilter-devel@lists.samba.org/msg01394.html&quot;&gt;http://www.mail-archive.com/netfilter-devel@lists.samba.org/msg01394.html&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://conntrack-tools.netfilter.org/downloads.html&quot;&gt;http://conntrack-tools.netfilter.org/downloads.html&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/7068845472609101815/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/7068845472609101815?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/7068845472609101815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/7068845472609101815'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/managing-cached-connections.html' title='Managing cached connections'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-7220443748390495023</id><published>2009-10-27T17:39:00.001-02:00</published><updated>2009-10-27T17:40:31.218-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="basic"/><title type='text'>customizing ls time output</title><content type='html'>&lt;blockquote&gt;ls  -l --time-style=&quot;+%d-%m-%Y %H:%M:%S&quot; /var/log/xxxxxxx&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;It&#39;s the same syntax used by date command&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/7220443748390495023/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/7220443748390495023?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/7220443748390495023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/7220443748390495023'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/customizing-ls-time-output.html' title='customizing ls time output'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-2145808074572432032</id><published>2009-10-27T09:37:00.001-02:00</published><updated>2009-10-27T09:40:25.808-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gcc"/><title type='text'>Compilation stuff</title><content type='html'>./configure&lt;br /&gt;....&lt;br /&gt;checking lex library... -lfl&lt;br /&gt;checking whether yytext is a pointer... yes&lt;br /&gt;checking for bison... bison -y&lt;br /&gt;checking for pkg-config... yes&lt;br /&gt;checking for pkg-config... /usr/bin/pkg-config&lt;br /&gt;checking pkg-config is at least version 0.9.0... yes&lt;br /&gt;checking for LIBNFNETLINK... no&lt;br /&gt;configure: error: Cannot find libnfnetlink &gt;= 1.0.0&lt;br /&gt;&lt;br /&gt;However libnfnetlink was installed.&lt;br /&gt;&lt;br /&gt;# ls /usr/local/lib/pkgconfig/&lt;br /&gt;libnetfilter_conntrack.pc  libnfnetlink.pc&lt;br /&gt;&lt;br /&gt;#  pkg-config --libs libnfnetlink&lt;br /&gt;Package libnfnetlink was not found in the pkg-config search path.&lt;br /&gt;Perhaps you should add the directory containing `libnfnetlink.pc&#39;&lt;br /&gt;to the PKG_CONFIG_PATH environment variable&lt;br /&gt;No package &#39;libnfnetlink&#39; found&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#  PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/  pkg-config --libs libnfnetlink&lt;br /&gt;-L/usr/local/lib -lnfnetlink&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt; PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/  ./configure&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/2145808074572432032/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/2145808074572432032?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2145808074572432032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2145808074572432032'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/compilation-stuff.html' title='Compilation stuff'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-591956590306745958</id><published>2009-10-26T00:38:00.001-02:00</published><updated>2009-10-26T00:40:09.197-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="centos"/><title type='text'>Download RPM&#39;s from yum repos</title><content type='html'>Use:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;yumdownloader packagename&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;yumdownloader is included in yum-utils package&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/591956590306745958/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/591956590306745958?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/591956590306745958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/591956590306745958'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/download-rpms-from-yum-repos.html' title='Download RPM&#39;s from yum repos'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-5890451637938887447</id><published>2009-10-15T08:39:00.002-03:00</published><updated>2009-10-26T09:00:24.480-02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="iptables"/><title type='text'>Playing with ip command</title><content type='html'>ip -o -s -s route show table cache&lt;br /&gt;&lt;br /&gt;Existe um tabela chamada &quot;cache&quot; que nem preciso dizer que ela contém o cache :)&lt;br /&gt;&lt;br /&gt;com a opção -s é exibido a idade(age), em segundos, daquela entrada, quantas vezes aquela regra foi usada(used), etc.&lt;br /&gt;&lt;br /&gt;A opção -o é só pra mostra tudo em uma linha só. Fica mais fácil de fazer grep ou wc -l&lt;br /&gt;&lt;br /&gt;A idade é zerada toda vez que aquela regra é usada e a o valor used é incrementado.&lt;br /&gt;&lt;br /&gt;Não consegui determinar de quanto em quanto tempo essa tabela é esvaziada. Apenas determinei que de tempos em tempos ela é completamente zerada e reiniciada. Uma vez que eu acompanhei demorou algo em torno de 8 minutos, de uma outra vez 3:30min, depois 4 min cravados. Então o mais certo é: vai saber né?&lt;br /&gt;&lt;br /&gt;o importante é lembrar que quando se alterar rotas ou rules é importante limpar essa tabela de cache com o comando:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ip route flush cache&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;ou&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ip r f c&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Do contrário você vai morrer tentando e não vai entender o comportamento do seu linux roteando.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Vou só incluir alguns comando aqui de exemplo que serão úteis logo logo:&lt;br /&gt;&lt;br /&gt;ip rule show&lt;br /&gt;&lt;br /&gt;ip rule add from 192.168.0.0/24 table 10&lt;br /&gt;ou&lt;br /&gt;ip rule add from 192.168.0.0/24 table dez&lt;br /&gt;ou&lt;br /&gt;ip rule add from 192.168.0.0/24 lookup 10&lt;br /&gt;ou&lt;br /&gt;ip rule add from 192.168.0.0/24 table dez&lt;br /&gt;&lt;br /&gt;Observações:&lt;br /&gt;&lt;b&gt;lookup&lt;/b&gt; ou &lt;b&gt;table&lt;/b&gt; podem ser usado interchangeable.&lt;br /&gt;&lt;br /&gt;o Nome ou número da tabela no arquivo &lt;b&gt;/etc/iproute2/rt_tables&lt;/b&gt; também podem ser usados interchangeable.&lt;br /&gt;&lt;br /&gt;ip rule from 10.1.1.0/22 lookup WAN&lt;br /&gt;ip rule to 200.0.0.1/24 lookup ADSL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Usando marcas(lembrando que o pacote não é alterado de forma alguma, essa marcação quem toma conta é o kernel, como se fosse NAT, pois existem uma tabela, porém no NAT o pacote ainda é alterado, nesse caso não):&lt;br /&gt;&lt;br /&gt;iptables -t mangle -A PREROUTING -s 192.168.0.0/24 -j MARK --set-mark 10&lt;br /&gt;ip rule add fwmark 10 table GVT&lt;br /&gt;&lt;br /&gt;Se você realmente deseja alterar o pacote deve usar o alvo TOS do iptables(não testei):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;iptables -t mangle -A PREROUTING -s 192.168.0.0/24 -j TOS --set-tos 0x10&lt;br /&gt;&lt;br /&gt;tente: iptables -j TOs -h para descobrir as opções do --set-tos&lt;br /&gt;&lt;br /&gt;ip rule add tos 0x10 lookup 10&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Quando você for listar as rules você verá que surge na tela &#39;lowdelay&#39; ao invés do valor 0x10. Isso porque o ip traduz e/ou mapeia isso de acordo com o arquivo &lt;b&gt;/etc/iproute2/rt_dsfield&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;ip route get 192.168.1.55&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Will pretend sending a packet to this destination resolve and get back the route that will be used to reach the destination. It actually creates an entry into the cache table. Check it out with ip route show cache&lt;br /&gt;&lt;br /&gt;As the manual says it&#39;s equivalent to send a ping and running ip route show cache.&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/5890451637938887447/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/5890451637938887447?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/5890451637938887447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/5890451637938887447'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/playing-with-ip-command.html' title='Playing with ip command'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35083915.post-2665036649476932257</id><published>2009-10-02T08:53:00.001-03:00</published><updated>2009-10-02T08:53:55.322-03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="centos"/><title type='text'>Autoload modules in CentOS</title><content type='html'>40.2. Persistent Module Loading&lt;br /&gt;&lt;br /&gt;Kernel modules are usually loaded directly by the facility that requires them, which is given correct settings in the /etc/modprobe.conf file. However, it is sometimes necessary to explicitly force the loading of a module at boot time.&lt;br /&gt;&lt;br /&gt;Red Hat Enterprise Linux checks for the existence of the /etc/rc.modules file at boot time, which contains various commands to load modules. The rc.modules should be used, and not rc.local because rc.modules is executed earlier in the boot process.&lt;br /&gt;&lt;br /&gt;For example, the following commands configure loading of the foo module at boot time (as root):&lt;br /&gt;&lt;br /&gt;# echo modprobe foo &gt;&gt; /etc/rc.modules &lt;br /&gt;# chmod +x /etc/rc.modules&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-kernel-modules-persistant.html&quot;&gt;http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-kernel-modules-persistant.html&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;bye!!&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lutierigb.blogspot.com/feeds/2665036649476932257/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/35083915/2665036649476932257?isPopup=true' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2665036649476932257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35083915/posts/default/2665036649476932257'/><link rel='alternate' type='text/html' href='http://lutierigb.blogspot.com/2009/10/autoload-modules-in-centos.html' title='Autoload modules in CentOS'/><author><name>Lutieri G. B.</name><uri>http://www.blogger.com/profile/11743667065222291528</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>