Archive

Archive for the ‘Всичко друго’ Category

Quick: mdadm check RAID

Как да накараме mdadm да ни информира ако имаме проблем с някой от RAID масивите?

Елементарно:

mdadm --monitor --scan --mail=MAIL@DOMAIN.com --delay=3600 --daemonize --test

Как да видим опашката от мейли на Qmail?

Елементарно :)

/var/qmail/bin/qmail-qstat

Пример за това колко мейла има в опашката:

[12:04:03] blagomir@butterfly [~] #: /var/qmail/bin/qmail-qstat
messages in queue: 44
messages in queue but not yet preprocessed: 0

Пример, с който да покажем до къде изпращаме мейли:

[13:30:06] blagomir@butterfly [~] #: /var/qmail/bin/qmail-qread
16 Jul 2011 10:30:29 GMT  #4199501  640  <info@domain.bg> 
	remote	MAILBOX@DOMAIN.org
18 Jul 2011 08:17:14 GMT  #4530632  643  <info@domain.bg> 
	remote	MAILBOX@DOMAIN.org

QR код за адреса на нашия блог :)

За тези, които не знаят какво е QR code могат да погледнат тук (wiki)

Categories: Всичко друго Tags:

May 17th, 2011 No comments

Cisco change ssh default port

How to change cisco default port :

g1r5_router(config)#ip ssh port 2000 rotary 1
g1r5_router(config)#line  vty 0 4 
g1r5_router(config-line)#rotary 1
g1r5_router(config-line)#end
g1r5_router#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]

Now lets try it:

[13:16]vhristev@g1r5:~$uname -a
Darwin g1r5 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386 i386
[13:16]vhristev@g1r5:~$ssh 192.168.0.1 -p 2000 
vhristev@192.168.0.1's password: 
 
g1r5_router&gt;en
Password: 
g1r5_router#sh ver 
Cisco IOS Software, 1841 Software (C1841-ADVIPSERVICESK9-M), Version 12.4(13b), RELEASE SOFTWARE (fc3)
Categories: Всичко друго Tags:

Cisco lab

April 7th, 2011 2 comments

This is one of my labs when I deal with networking.

Categories: Всичко друго Tags:

To be or not to be.

March 29th, 2011 No comments

Categories: Всичко друго Tags:

Gentoo software RAID

March 29th, 2011 No comments

Gentoo Software RAID

Software RAID massives

You can check your RAID/LVM support with this command

cat /boot/config-`uname -r` | egrep 'RAID|LVM'
CONFIG_RAID_ATTRS=m
CONFIG_BLK_DEV_3W_XXXX_RAID=m
CONFIG_SCSI_AACRAID=m
CONFIG_MEGARAID_NEWGEN=y
CONFIG_MEGARAID_MM=m
CONFIG_MEGARAID_MAILBOX=m
CONFIG_MEGARAID_LEGACY=m
CONFIG_MEGARAID_SAS=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID10=m
CONFIG_MD_RAID456=m

Kernel Config

 Device Drivers
 Multi-device support (RAID and LVM)
 Multiple devices driver support (RAID and LVM) (MD [=y])
 RAID support (BLK_DEV_MD [=y])

Load modules:

modprobe raid0
modprobe raid1
modprobe raid10

Partitions with “cfdisk”

cfdisk (util-linux-ng 2.13.1.1)
 
Disk Drive: /dev/sda
Size: 80025280000 bytes, 80.0 GB
Heads: 255   Sectors per Track: 63   Cylinders: 9729
 
Name               Flags             Part Type        FS Type                   [Label]                Size (MB)
-----------------------------------------------------------------------------------------------------------------------------
sda1               Boot               Primary         Linux raid autodetect                               115.16
sda2                                  Primary         Linux swap / Solaris                               4087.97
sda3                                  Primary         Linux raid autodetect                             75820.64

Put partiton table from /dev/sda to /dev/sdb /dev/sdc1 /dev/sdd1 (:

sfdisk -d /dev/sda | sfdisk /dev/sdb | sfdisk /dev/sdc | sfdisk /dev/sdd

Create MD devices

cd /dev
MAKEDEV md

!!! Linux can’t boot from software RAID 10 we make new BOOT partition with RAID1

# Create Boot partition
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=4 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1

#Create Root partition

mdadm --create --verbose /dev/md1 --level=10 --raid-devices=4 /dev/sda3 /dev/sdb3 /dev/sdc3 /dev/sdd3

Watch our RAID creation

watch cat /proc/mdstat
watch -n1 'cat /proc/mdstat'

Update the mdadm config file.

mdadm --detail --scan &gt;&gt; /etc/mdadm.conf

# GRUB CONFIG

grub&gt; find /boot/grub/stage1
(hd0,0)
(hd1,0)
(hd2,0)
(hd3,0)
grub&gt;

#Install to drive 1

grub&gt; device (hd0) /dev/sda
grub&gt; root (hd0,0)
grub&gt; setup (hd0)

#Install to drive 2

grub&gt; device (hd0) /dev/sdb
grub&gt; root (hd0,0)
grub&gt; setup (hd0)

#Install to drive 3

grub&gt; device (hd0) /dev/sdc
grub&gt; root (hd0,0)
grub&gt; setup (hd0)

#Install to drive 4

grub> device (hd0) /dev/sdd
grub> root (hd0,0)
grub> setup (hd0)

Set grub menu.list

!!!!! change real_root=/dev/md???? whith your RAID ROOT configuration !!!!!!!!

echo -e "default 0\ntimeout 3\n\ntitle=Gentoo Linux (2.6.29-gentoo-r1-VHristev)\nroot (hd0,0)" &gt; /boot/grub/grub.conf
echo "kernel `ls /boot/kernel*` root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/md1 udev" &gt;&gt; /boot/grub/grub.conf
echo "initrd `ls /boot/initramfs*`" &gt;&gt; /boot/grub/grub.conf
grep --invert-match rootfs /proc/mounts &gt; /etc/mtab
Categories: Всичко друго Tags:

Mac OS X create ISO from DVD/CD

March 29th, 2011 No comments

You have DVD with software and you want to install with Parallels/VMware Fusion/Virtual Box but … you don’t want to use your old scribbled disk and we need to convert it to .iso.

 

[18:31]vhristev@coco-12:~$drutil status
Vendor   Product           Rev
MATSHITA DVD-R   UJ-868    KB19
 
Type: DVD-ROM              Name: /dev/disk1
Sessions: 1                  Tracks: 1
Overwritable:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
Space Free:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
Space Used:  348:05:15         blocks:  1566390 /   3.21GB /   2.99GiB
Writability:
Book Type: DVD-ROM (v1)
 
[18:31]vhristev@coco-12:~$diskutil umountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[18:31]vhristev@coco-12:~$dd if=/dev/disk1 of=Solaris_10.iso bs=2048

 

 

Categories: Всичко друго Tags:

Reinstalling the host management agents and HA agents on ESXi

March 28th, 2011 No comments

1. Right-click on the ESXi host and click Disconnect. This disconnects the ESXi host from the VirtualCenter Inventory.

2. Log in to ESXi Troubleshooting Mode. For more information, see Tech Support Mode for Emergency Support (1003677).

3. Uninstall the vpxa and aam components from the VMware ESXi host using the following commands:

/opt/vmware/uninstallers/VMware-vpxa-uninstall.sh

/opt/vmware/uninstallers/VMware-aam-ha-uninstall.sh

4. Right-click on the ESXi host and click Connect. This initiates a re-install of the vpxa agent.

5. Add the host to the appropriate cluster. This initiates a re-install of the aam agent.

If the agent fails to automatically install when connecting the ESX host in the vCenter Server:

1. Verify that /tmp/vmware-root exists on the ESX host. vCenter stages the vpxa RPM in this folder. To add this directory, execute:

 mkdir -p /tmp/vmware-root

Categories: ESX, ESX 4.x, VMware, Всичко друго Tags:

Console torrent client (rtorrent)

March 23rd, 2011 1 comment

I really like my rtorrent it is really easy to use it.

Install rtorrent on Mac os x (you need installed ports to use this feature)

[21:05]vhristev@g1r5:~$port search rtorrent
rtorrent @0.8.4 (net)
    console-based BitTorrent client
 
rtorrent-devel @0.8.5 (net)
    console-based BitTorrent client (development version)
 
Found 2 ports.
[21:05]vhristev@g1r5:~$sudo port install rtorrent
---&gt;  Computing dependencies for rtorrent
---&gt;  Cleaning rtorrent
[21:05]vhristev@g1r5:~$

How to start downloading torrent file.

My first advice is USE “screen” like me .I am in the office and want to start downloading something.
1.I run screen then i run my rtorrent and voala perfect console torrent client and i don’t have to worry about my connection between office and home (:
2. rtorrent TORRENT_FILE

 

Im lazy and download this pictures from internet (:

 

Basic keyboard shortcuts:

    ^q — closes rTorrent, done twice makes the program shutdown.
    Up, down arrows — highlight the downloads.
    Left arrow — returns to the previous screen.
    Right arrow — goes to the next screen.
    a|s|d — increase global upload speed about 1|5|50 KB/s
    A|S|D — increase global download speed about 1|5|50 KB/s
    z|x|c — decrease global upload speed about 1|5|50 KB/s
    Z|X|C — decrease global download speed about 1|5|50 KB/s
    ^S — starts download
    ^D — pauses and resumes the active download
    +|- — changes the download priority of selected torrent.
    Backspace — adds the specified .torrent. After pressing this button write full path or URL of .torrent file. You can use Tab and other tricks from bash.
Categories: Всичко друго Tags: