mount -o loop -t iso9660 filename.iso /mnt/iso
(remember to create the directory /mnt/iso first)
Then browse to /mnt/iso and install
(remember to create the directory /mnt/iso first)
Then browse to /mnt/iso and install
ping -c 5 google.com[sibin@localhost]$ ping -c 5 google.com
PING google.com (74.125.235.8) 56(84) bytes of data.
64 bytes from sin01s04-in-f8.1e100.net (74.125.235.8): icmp_req=1 ttl=54 time=234 ms
64 bytes from sin01s04-in-f8.1e100.net (74.125.235.8): icmp_req=2 ttl=54 time=45.7 ms
64 bytes from sin01s04-in-f8.1e100.net (74.125.235.8): icmp_req=3 ttl=54 time=88.1 ms
64 bytes from sin01s04-in-f8.1e100.net (74.125.235.8): icmp_req=4 ttl=54 time=45.7 ms
64 bytes from sin01s04-in-f8.1e100.net (74.125.235.8): icmp_req=5 ttl=54 time=46.2 ms
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 45.758/92.011/234.135/72.918 ms Now optimize the ping command:$ ping -c 5 -n -i 0.2 -W1 google.com
[sibin@ast-wks-069 ~]$ ping -c 5 -n -i 0.2 -W1 google.com
PING google.com (74.125.235.9) 56(84) bytes of data.
64 bytes from 74.125.235.9: icmp_req=1 ttl=54 time=46.4 ms
64 bytes from 74.125.235.9: icmp_req=2 ttl=54 time=46.4 ms
64 bytes from 74.125.235.9: icmp_req=3 ttl=54 time=45.7 ms
64 bytes from 74.125.235.9: icmp_req=4 ttl=54 time=45.5 ms
64 bytes from 74.125.235.9: icmp_req=5 ttl=54 time=49.5 ms
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 803ms
rtt min/avg/max/mdev = 45.569/46.762/49.541/1.433 ms
traceroute -n -w SECONDS -q NUMBER host
$ traceroute -n -w 3 -q 1 www.google.com$ traceroute -n -w 3 -q 1 -N 32 www.google.com$ traceroute -n -w 3 -q 1 -N 32 -m 16 www.google.com$ sudo yum install lvm2
$ sudo modprobe dm-mod
$ sudo vgscan
$ sudo vgchange -ay VolGroup00
$ sudo lvs
$ sudo mkdir /mnt/fcroot
$ sudo mount /dev/VolGroup00/LogVol00 /mnt/fcroot -o ro,user
simon@pandora:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/pandora-root
7.3G 843M 6.1G 12% /
tmpfs 502M 0 502M 0% /lib/init/rw
udev 497M 136K 496M 1% /dev
tmpfs 502M 0 502M 0% /dev/shm
/dev/sda1 228M 16M 201M 8% /boot
Now we add a new disk to the system. This is done by physically adding a new disk or in my case, by adding a new disk via iSCSI. Using /var/log/messages, we can determine that the new disk is accessible under /dev/sdb. So let’s prepare this new disk…simon@pandora:~$ su -
Password:
root@pandora:~# fdisk /dev/sdb
[..]
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-1044, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1044, default 1044):
Using default value 1044
Command (m for help): p
Disk /dev/sdb: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4fce54ed
Device Boot Start End Blocks Id System
/dev/sdb1 1 1044 8385898+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Now we have our new partition accessible under /dev/sdb1 (as seen above). Now you could use the mkfs
tools to create a new filesystem on this partition and use it without
LVM. But that is not what we want to do, so let’s continue by
configuring LVM itself…root@pandora:~# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
Nice. So let’s see which physical volumes we have:root@pandora:~# pvdisplay
--- Physical volume ---
PV Name /dev/sda5
VG Name pandora
PV Size 7.76 GiB / not usable 2.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 1986
Free PE 0
Allocated PE 1986
PV UUID HsOAt3-snnh-MskC-mlE4-Runf-IkYx-KuDJ5j
"/dev/sdb1" is a new physical volume of "8.00 GiB"
--- NEW Physical volume ---
PV Name /dev/sdb1
VG Name
PV Size 8.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID Oddlkr-jSoL-2PKR-kyxG-Wy33-T0Hh-JvflWQ
Ah nice, so we can see that LVM has a “NEW Physical volume”.root@pandora:~# vgextend pandora /dev/sdb1
Volume group "pandora" successfully extended
root@pandora:~# vgdisplay
--- Volume group ---
VG Name pandora
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 15.75 GiB
PE Size 4.00 MiB
Total PE 4033
Alloc PE / Size 1986 / 7.76 GiB
Free PE / Size 2047 / 8.00 GiB
VG UUID hTcf4N-Srft-Myz2-YQYc-AC9T-pfaA-LIL1KZ
That went well. Now we’re basically done with adding new space to our
volume group. We can now use the newly added physical volume and assign
it to different logical volumes that are then used by the filesystem.root@pandora:~# lvdisplay
--- Logical volume ---
LV Name /dev/pandora/root
VG Name pandora
LV UUID UJQUwV-f3rI-Tsd3-dQYO-exIk-LSpq-2qls13
LV Write Access read/write
LV Status available
# open 1
LV Size 7.39 GiB
Current LE 1892
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0
--- Logical volume ---
LV Name /dev/pandora/swap_1
VG Name pandora
LV UUID KHBPkh-qrv8-uZkS-dU4C-f3vF-SpHW-d3vtMH
LV Write Access read/write
LV Status available
# open 1
LV Size 376.00 MiB
Current LE 94
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:1
We can see that on this machine, we have two logical volumes, one for
the root filesystem and one for our swap partition. Since we want to extend the root filesystem,
we simply take the LV name (“/dev/pandora/root”) and use the following
command to extend that logical volume with all the space available on
the specified VG (in my case “pandora”):root@pandora:~# lvextend -l 100%FREE /dev/pandora/root
Extending logical volume root to 15.39 GiB
Logical volume root successfully resized
Alternatively, you may specify the amount of space that is added to the logical volume (e.g. lvextend -L+1G /dev/pandora/root).root@pandora:~# resize2fs /dev/mapper/pandora-root
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/pandora-root is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/pandora-root to 4033536 (4k) blocks.
The filesystem on /dev/mapper/pandora-root is now 4033536 blocks long.
Done. To validate, let’s run the same command we ran at the beginning of this article.root@pandora:~# exit
logout
simon@pandora:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/pandora-root
16G 845M 14G 6% /
tmpfs 502M 0 502M 0% /lib/init/rw
udev 497M 144K 496M 1% /dev
tmpfs 502M 0 502M 0% /dev/shm
/dev/sda1 228M 16M 201M 8% /boot
simon@pandora:~$
openssl rsa -noout -modulus -in (Key file) | md5sum
openssl req -new -keyout server.key -out server.csropenssl req -in server.csr -noout -text| Daemon | Command |
|---|---|
| OpenSSH | /usr/sbin/sshd -t && echo $? /usr/sbin/sshd -T |
| Apache | /usr/sbin/apache2 -t apachectl configtest |
| nginx | /usr/local/nginx/sbin/nginx -t /usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf |
| lighttpd | /usr/local/sbin/lighttpd -t -f /usr/local/etc/lighttpd/cyberciti.biz/lighttpd.conf |
| Bind (named server config) | named-checkconf /etc/named.conf |
| Bind (zone syntx) | named-checkzone cyberciti.biz /var/named/zone.cyberciti.biz |
| Squid proxy | /usr/sbin/squid -k check /usr/sbin/squid -k parse |
| MySQL server | mysqld --verbose --help /usr/libexec/mysqld --verbose --help 1>/dev/null |
| Postfix MTA | postfix check postfix -vvv |
| Samba SMB/CIFS | testparm -v |
| tcpd | tcpdchk tcpdchk -v |
| dhcpd (DHCP / BOOTP) server | dhcpd -t -cf /path/to/dhcpd.testing.conf |
| vsftpd server | vsftpd -olisten=NO /path/to/vsftpd.testing.conf |
| nagios | nagios -v /path/to/testing/nagios.cfg |
| Openntpd NTPD server | ntpd -d -f /usr/local/etc/ntpd.conf -n |
| Xorg (X11 Server) | Xorg -config /path/to/xorg.conf.new -retro |
| syslogd / rsyslogd | rsyslogd -c4 -f /etc/rsyslog.testing.conf -N 1 |
| CUPS Printing System | cupsd -f -c /path/to/cupsd.testing.conf -t |
| slapd (OpenLDAP) | slapd -Tt |
| varnishd | varnishd -C -f /path/to/wordpress.vlc |
| exim MTA | exim -bV |
| Bash/Ksh scripts | bash -n ./myscript ksh -n /path/to/script.ksh |
| BSD pf firewall | pfctl -nf /etc/pf.conf |
| proftpd | proftpd -t -c /path/to/proftpd.testing.conf |
| Perl scripts | perl -c /path/to/script.pl perl -wc /path/to/script.pl |
| Error Bit | Purpose |
|---|---|
| E_ALL | All errors and warnings (doesn't include E_STRICT) |
| E_ERROR | Fatal run-time errors |
| E_WARNING | Run-time warnings (non-fatal errors) |
| E_PARSE | Compile-time parse errors |
| E_NOTICE | Run-time notices (these are warnings which often result from a bug in your code, but it's possible that it was intentional (e.g., using an uninitialized variable and relying on the fact it's automatically initialized to an empty string) |
| E_STRICT | Run-time notices, enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code. |
| E_CORE_ERROR | Fatal errors that occur during PHP's initial startup |
| E_CORE_WARNING | Warnings (non-fatal errors) that occur during PHP's initial startup |
| E_COMPILE_ERROR | Fatal compile-time errors |
| E_COMPILE_WARNING | Compile-time warnings (non-fatal errors) |
| E_USER_ERROR | User-generated error message |
| E_USER_WARNING | User-generated warning message |
| E_USER_NOTICE | User-generated notice message |
# vi /etc/php.inierror_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERRORAlternately, you can show all errors, except for notices and coding standards warnings
error_reporting = E_ALL & ~E_NOTICESave and close the file. Restart apache web server:
# /etc/init.d/httpd restartps auxps aux | awk '{print $4"\t"$11}' | sort | uniq -c | awk '{print $2" "$1" "$3}' | sort -nrsu- yum install -y ccsm emerald-themes compizconfig-backend-gconf fusion-icon-gtk emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-fusion-extras-gnome
#To setup compiz-fusion for KDE you need to install these additional packages:
su- yum install -y ccsm emerald-themes compizconfig-backend-kconfig fusion-icon-qt emerald compiz-fusion libcompizconfig compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-kde compiz-manager
su - yum install -y ccsm emerald-themes compizconfig-backend-kconfig compizconfig-backend-gconf fusion-icon* emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-fusion-extras-gnome compiz-kde compiz-manager
ps -eo pid,etime | grep pidnumber
$ ps -aef | grep {process-name}
$ ps -aef | grep httpd Next pass this PID to pfiles command,$ pfiles {PID}
$ pfile 3533# ps aux | grep {program-name}$ ps -C {program-name} -o pid=$ ps -C firefox -o pid=7857To list opne files for firefox process, enter:
$ ls -l /proc/7857/fdtotal 0 lr-x------ 1 vivek vivek 64 2008-03-05 22:31 0 -> /dev/null l-wx------ 1 vivek vivek 64 2008-03-05 22:31 1 -> pipe:[18371] lr-x------ 1 vivek vivek 64 2008-03-05 22:31 10 -> /usr/lib/firefox/firefox l-wx------ 1 vivek vivek 64 2008-03-05 22:31 2 -> pipe:[18371]
$ lsof -p 351# date -s "2 OCT 2006 18:00:00"# date --set="2 OCT 2006 18:00:00"# date +%Y%m%d -s "20081128"# date +%T -s "10:13:13"