16
May

RHEL5 BONDING with 3750 802.3ad

   Posted by: admin   in Linúc ếch bợt

Testing :

modprobe bonding  mode=4 miion=100 xmit_hash_policy=1

ifconfig bond0 192.168.253.101/24 up

ifconfig eth0 down

ifenslave bond0 eth0

ifenslave bond0 eth1

——— sh run ——-

!

interface Port-channel1

description Port channel for RHEL5-Server

switchport access vlan 105

switchport mode access

!

!

interface GigabitEthernet1/0/15

description This port is reversed for RHEL5-Server

switchport access vlan 105

switchport mode access

channel-protocol lacp

channel-group 1 mode active

!

interface GigabitEthernet1/0/16

description This port is reversed for RHEL5-Server

switchport access vlan 105

switchport mode access

channel-protocol lacp

channel-group 1 mode active

!

Finalizing :

put in your /etc/modules.conf :

alias bond0 bonding options bond0 mode=4 miimon=100 xmit_hash_policy=1

create ifcfg-bond0 file in /etc/sysconfig/network-scripts directory that looks like this:
DEVICE=bond0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.255
ONBOOT=yes
BOOTPROTO=none
USERCTL=no
All interfaces that are part of the trunk, should have SLAVE and MASTER definitions. For example, in the case of RedHat, if you wish to make eth0 and eth1 (or other interfaces) a part of the bonding interface bond0, their config files (ifcfg-eth0, ifcfg-eth1, etc.) should look like this:
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none 

 

4
May

unsupported esx console

   Posted by: admin   in Lăng nhăng lít nhít

  1. alt-f1 (Note: As pointed out below, you will not see your typing on this screen, just trust us, it is there).
  2. unsupported
  3. root pw
  4. vi /etc/inetd.conf
  5. delete the “#” from ssh
  6. kill -HUP ( inetd )
ssh-keygen -t rsa
scp id_rsa.pub user@esxiserver:/vmfs/volumes/datastore1/authorized_keys

login to the esxiserver TSM propmt and add to /etc/rc.local

mkdir /.ssh
cp /vmfs/volumes/datastore1/authorized_keys /.ssh/
chmod -R 600 /.ssh

List all services

#svcs

svcadm [enable/disable] [service]

enable/disable X login

#/usr/dt/bin/dtconfig [-d/-e]

download packages from sunfreeware.com

#gunzip package_local.gz

#pkgadd -d package_local

#pkgrm

#reboot

change hostname in /etc/hostname.e1000g0 and /etc/nodename

enable dhcp by #touch /etc/dhcp.e1000g0

hint : flash=1, mirror=1,remove mirror part

29
Mar

radius - ldap

   Posted by: admin   in Linúc ếch bợt, Mẹo vặt của hiếu râu

install freeradius

cd /etc/freeradius - etc/raddb

vi radiusd.conf

ldap {

server = “demo1″

identity = “myaccount”

password = “mypassword”

basedn = “OU=Users,OU=Production,DC=demo,DC=com,DC=vn”

filter = “(&(sAMAccountName=%{Stripped-User-Name:-%{User-Name}})(memberOf=OU=Groups,OU=Production,DC=demo,DC=com,DC=vn))”

#password_attribute = userPassword

# set this to ‘yes’ to use TLS encrypted connections

# to the LDAP database by using the StartTLS extended

# operation.

# The StartTLS operation is supposed to be used with normal

# ldap connections instead of using ldaps (port 689) connections

start_tls = no

# tls_cacertfile        = /path/to/cacert.pem

# tls_cacertdir         = /path/to/ca/dir/

# tls_certfile          = /path/to/radius.crt

# tls_keyfile           = /path/to/radius.key

# tls_randfile          = /path/to/rnd

# tls_require_cert      = “demand”

# default_profile = “cn=radprofile,ou=dialup,o=My Org,c=UA”

# profile_attribute = “radiusProfileDn”

#access_attr = “dialupAccess” <<——– comment this line

# Mapping of RADIUS dictionary attributes to LDAP

Uncomment ldap in authorize and authenticate sessions
vi clients.conf
client 10.100.0.0/24 {
secret          = mypassword
shortname       = hcm-network-vl100
}
vi users
DEFAULT Auth-Type = LDAP
Fall-Through = 1
radtest user pass 127.0.0.1 0 testing123
29
Mar

httpd - ldap

   Posted by: admin   in Linúc ếch bợt, Mẹo vặt của hiếu râu

LoadModule ldap_module modules/mod_ldap.so
LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

AuthType Basic
AuthBasicProvider ldap
AuthName “DEMO”
AuthLDAPURL “ldap://demo1.demo.com.vn:3268 demo2:3268/DC=demo,DC=com,DC=vn?samAccountName?sub?(objectCategory=person)”

AuthLDAPBindDN demo\myaccount

AuthLDAPBindPassword mypassword

Require ldap-group OU=Groups,OU=Production,DC=demo,DC=com,DC=vn

23
Mar

USB 3G modem 4linux

   Posted by: admin   in Mẹo vặt của hiếu râu

#lsusb

vendor=0×0471 product=0×1237

#rmmod usb-storage

#modprobe usbserial vendor=0×0471 product=0×1237

—————————————–

#file wvdial.conf
#internet Dialer version 1.56
#created by Cyblade
#Written for the E220 usb modem
[Dialer Defaults]
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Stupid Mode = 1
Modem Type = Analog Modem
ISDN = 0
Phone = *99***1#
Modem = /dev/ttyUSB0
username = username
Password = password
Dial Command = ATDT
Baud =466600
Init4 = AT+CGDCONT=1,”IP”,”e-connect”

—————————-

/etc/modprobe.d/modprobe.conf

options usbserial vendor=0×0471 product=0×1237

show vlan

config t

vlan 330 [ create/edit vlan 330 ]

name my_vlan [ description ]

exit

no vlan 330 [ delete vlan 330 ]

show interface status

interface range Gi1/10-20 [ edit interfaces Gi1/10 -> Gi1/20 ]

switchport trunk encapsulation dot1q [ set encapsulation mode ]

switchport mode trunk [ set trunk mode ]

siwtchport trunk native vlan 1 [ set native to vlan 1 ]

do show run

no switchport access [ turn off access mode ]

switchport trunk allowed vlan none [ disable all vlan ]

switchport trunk allowed vlan add 332 [ enable vlan 332 ]

——

conf t

inte rang fa 0/1-24

switchport port-security

switchport port-security aging time 60

switchport port-security mac-address 1234.5678.9012

switchport port-security violation protect

end

———————————-

lookup an IP, first, pinging 192.168.1.15

Core1# sh ip arp 192.168.1.15

MAC Address : 0000.1111.1111

Core1# sh mac address-table address 0000.1111.1111

Port Gi1/0/20

access switch acsw02

acsw02# sh mac address-table address 0000.1111.1111

port Fa0/18

==> found

29
Sep

mysql TRIGGER

   Posted by: admin   in Lăng nhăng lít nhít

DELIMITER |
CREATE TRIGGER hose_log
BEFORE UPDATE ON HOSE FOR EACH ROW
BEGIN

UPDATE HOSELOG SET

B1 = IF(ISNULL(NEW.B1),B1,IF(NEW.B1=OLD.B1,B1,IF(NEW.B1>OLD.B1,2,1))),

cB1 = IF(ISNULL(NEW.B1),cB1,IF(NEW.B1=OLD.B1,cB1,NOW())),

B2 = IF(ISNULL(NEW.B2),B2,IF(NEW.B2=OLD.B2,B2,IF(NEW.B2>OLD.B2,2,1))),

cB2 = IF(ISNULL(NEW.B2),cB2,IF(NEW.B2=OLD.B2,cB2,NOW())),

B3 = IF(ISNULL(NEW.B3),B3,IF(NEW.B3=OLD.B3,B3,IF(NEW.B3>OLD.B3,2,1))),

cB3 = IF(ISNULL(NEW.B3),cB3,IF(NEW.B3=OLD.B3,cB3,NOW())),

S1 = IF(ISNULL(NEW.S1),S1,IF(NEW.S1=OLD.S1,S1,IF(NEW.S1>OLD.S1,2,1))),

cS1 = IF(ISNULL(NEW.S1),cS1,IF(NEW.S1=OLD.S1,cS1,NOW())),

S2 = IF(ISNULL(NEW.S2),S2,IF(NEW.S2=OLD.S2,S2,IF(NEW.S2>OLD.S2,2,1))),

cS2 = IF(ISNULL(NEW.S2),cS2,IF(NEW.S2=OLD.S2,cS2,NOW())),

S3 = IF(ISNULL(NEW.S3),S3,IF(NEW.S3=OLD.S3,S3,IF(NEW.S3>OLD.S3,2,1))),

cS3 = IF(ISNULL(NEW.S3),cS3,IF(NEW.S3=OLD.S3,cS3,NOW())),

B1Vol = IF(ISNULL(NEW.B1Vol),B1Vol,IF(NEW.B1Vol=OLD.B1Vol,B1Vol,IF(NEW.B1Vol>OLD.B1Vol,2,1))),

cB1Vol = IF(ISNULL(NEW.B1Vol),cB1Vol,IF(NEW.B1Vol=OLD.B1Vol,cB1Vol,NOW())),

B2Vol = IF(ISNULL(NEW.B2Vol),B2Vol,IF(NEW.B2Vol=OLD.B2Vol,B2Vol,IF(NEW.B2Vol>OLD.B2Vol,2,1))),

cB2Vol = IF(ISNULL(NEW.B2Vol),cB2Vol,IF(NEW.B2Vol=OLD.B2Vol,cB2Vol,NOW())),

B3Vol = IF(ISNULL(NEW.B3Vol),B3Vol,IF(NEW.B3Vol=OLD.B3Vol,B3Vol,IF(NEW.B3Vol>OLD.B3Vol,2,1))),

cB3Vol = IF(ISNULL(NEW.B3Vol),cB3Vol,IF(NEW.B3Vol=OLD.B3Vol,cB3Vol,NOW())),

S1Vol = IF(ISNULL(NEW.S1Vol),S1Vol,IF(NEW.S1Vol=OLD.S1Vol,S1Vol,IF(NEW.S1Vol>OLD.S1Vol,2,1))),

cS1Vol = IF(ISNULL(NEW.S1Vol),cS1Vol,IF(NEW.S1Vol=OLD.S1Vol,cS1Vol,NOW())),

S2Vol = IF(ISNULL(NEW.S2Vol),S2Vol,IF(NEW.S2Vol=OLD.S2Vol,S2Vol,IF(NEW.S2Vol>OLD.S2Vol,2,1))),

cS2Vol = IF(ISNULL(NEW.S2Vol),cS2Vol,IF(NEW.S2Vol=OLD.S2Vol,cS2Vol,NOW())),

S3Vol = IF(ISNULL(NEW.S3Vol),S3Vol,IF(NEW.S3Vol=OLD.S3Vol,S3Vol,IF(NEW.S3Vol>OLD.S3Vol,2,1))) ,

cS3Vol = IF(ISNULL(NEW.S3Vol),cS3Vol,IF(NEW.S3Vol=OLD.S3Vol,cS3Vol,NOW())),

Last = IF(ISNULL(NEW.Last),Last,IF(NEW.Last=OLD.Last,Last,IF(NEW.Last>OLD.Last,2,1))),

cLast = IF(ISNULL(NEW.Last),cLast,IF(NEW.Last=OLD.Last,cLast,NOW())),

LastVol = IF(ISNULL(NEW.LastVol),LastVol,IF(NEW.LastVol=OLD.LastVol,LastVol,IF(NEW.LastVol>OLD.LastVol,2,1))),

cLastVol = IF(ISNULL(NEW.LastVol),cLastVol,IF(NEW.LastVol=OLD.LastVol,cLastVol,NOW())),

MatchVol = IF(ISNULL(NEW.MatchVol),MatchVol,IF(NEW.MatchVol=OLD.MatchVol,MatchVol,IF(NEW.MatchVol>OLD.MatchVol,2,1))),

cMatchVol = IF(ISNULL(NEW.MatchVol),cMatchVol,IF(NEW.MatchVol=OLD.MatchVol,cMatchVol,NOW())),

CurrentRoom = IF(ISNULL(NEW.CurrentRoom),CurrentRoom,IF(NEW.CurrentRoom=OLD.CurrentRoom,CurrentRoom,IF(NEW.CurrentRoom>OLD.CurrentRoom,2,1))),

cCurrentRoom = IF(ISNULL(NEW.CurrentRoom),cCurrentRoom,IF(NEW.CurrentRoom=OLD.CurrentRoom,cCurrentRoom,NOW()))

WHERE StockNo=OLD.StockNo;

END |

————————–

DROP TRIGGER mydb.hose_log

trigger

========================

BEGIN
DELETE FROM ACL_TICKETS_BACKUP.tbl_log_assign WHERE id=NEW.id;
INSERT INTO ACL_TICKETS_BACKUP.tbl_log_assign SELECT * from tbl_log_assign where id=NEW.id;
END
27
Aug

RAM disk - tmpfs

   Posted by: admin   in Lăng nhăng lít nhít

mount -t tmpfs -o size=128M tmpfs /_RAM

wget http://slackware.mirrors.tds.net/pub/slackware/slackware-12.2/extra/jdk-6/jdk-6u11-i586-1.tgz

installpkg jdk-6u11-i586-1.tgz

http://ant.apache.org/svn.html
svn co http://svn.apache.org/repos/asf/ant/core/trunk/ ant

cd ant

./build.sh

copy dist/bin,lib to /usr/local

svn co https://svn.apache.org/repos/asf/ant/ivy/core/trunk ivy
cd ivy
ant jar
cp build/artifact/jars/ivy.jar /usr/local/lib
cd ..

svn co http://red5.googlecode.com/svn/java/server/tags/0_9_1 red5-0.9.1
cd red5-0.9.1
ant prepare
ant dist

cd dist

./red5.sh &
http://10.100.0.3:5080/
http://videowhisper.com/download.php VideoWhisper RTMP Applications -> red5
cd webapps
wget http://videowhisper.com/downloads/videowhisper_red5.zip
unzip videowhisper_red5.zip
./red5-shutdown.sh
./red5.sh &

download http://haotu.macatung.com/wp-content/uploads/vctar.bz2

http://your-ip/vc
vi settings.php
$rtmp_server="rtmp://your-ip/videowhisper";
vi vc_login.php [disableSound=1]
screen2webcam simulator