甚麼是勇敢?

勇於做自己?

勇於負起責任?

勇於承擔一切?

還是安於現狀?

歡迎大家來留言~ 

liaofamily 發表在 痞客邦 留言(0) 人氣()

 C disk space is not suffcient after upgrading to Windows 7 SP1.

 

use below command to delete old system files.

COMMAND PROMPT > dism /online /cleanup-image /spsuperseded

 

winsxs_clean  

liaofamily 發表在 痞客邦 留言(0) 人氣()

RESET FOUNDRY SWITCH PASSWORD

 

### connect console cable and press b buttom during power up switch

FE Boot Monitor Version 03.2.00 (BLDR-Rev1a)
Enter 'b' to go to boot monitor ...
BOOT INFO: load monitor from code flash, size = 95344

BOOT MONITOR> no password
OK! Skip password check when the system is up.

BOOT MONITOR> boot system flash primary
Load image from primary copy
........
Crossbar initialization Done
Parsing Config Data ...

SW: Version 03.3.01dTc3 Copyright (c) 1996-2004 Foundry Networks, Inc.
Compiled on Apr 05 2005 at 15:35:50 labeled as FER03301d
(3445111 bytes) from Primary FER03301d.bin
Boot Monitor: Version 03.2.00Tc4
HW: Stackable FES4802-PREM
==========================================================================
Serial #: FL4502XXXX
330 MHz Power PC processor 8245 (version 129/1014) 66 MHz bus
512 KB boot flash memory
16384 KB code flash memory
128 MB DRAM
The system uptime is 1 seconds
The system : started=cold start

FSecure SSH is included in this product

FRDY-FES4802> enable
No password has been assigned yet...

FRDY-FES4802# configure terminal

FRDY-FES4802(config)# enable super-user-password admin          (note: set enable password to admin)

FRDY-FES4802(config)# write memory

.Write startup-config done.

FRDY-FES4802(config)# end

 

### restart switch to test if it works or not

FRDY-FES4802# reload
Are you sure? (enter 'y' or 'n'): y
Halt and reboot

FE Boot Monitor Version 03.2.00 (BLDR-Rev1a)
Enter 'b' to go to boot monitor ...
BOOT INFO: load monitor from code flash, size = 95344
BOOT INFO: load image from primary copy
BOOT INFO: bootparam at 00020818, mp_flash_size = 00349197
BOOT INFO: code decompression completed
BOOT INFO: branch to 00400100
........
Crossbar initialization Done
Parsing Config Data ...

SW: Version 03.3.01dTc3 Copyright (c) 1996-2004 Foundry Networks, Inc.
Compiled on Apr 05 2005 at 15:35:50 labeled as FER03301d
(3445111 bytes) from Primary FER03301d.bin
Boot Monitor: Version 03.2.00Tc4
HW: Stackable FES4802-PREM
==========================================================================
Serial #: FL4502XXXX
330 MHz Power PC processor 8245 (version 129/1014) 66 MHz bus
512 KB boot flash memory
16384 KB code flash memory
128 MB DRAM
The system uptime is 3 seconds
The system : started=warm start reloaded=by "reload"

FSecure SSH is included in this product
PS: Power supply 2 is up

FRDY-FES4802> enable                                       (note: enter new enable password admin)
Password:
FRDY-FES4802#

liaofamily 發表在 痞客邦 留言(0) 人氣()

enable ssh and https on Foundry FES4802

 

### activate ssh service on Foundry FES4802

 

telnet@FastIron> show version
SW: Version 03.4.01dTc1 Copyright (c) 1996-2005 Foundry Networks, Inc.
Compiled on Dec 12 2005 at 16:19:09 labeled as FES03401d
(2231669 bytes) from Primary FES03401d.bin
Boot Monitor: Version 03.4.00Tc4
HW: Stackable FES4802
==========================================================================
Serial #: FW1105XXXX
330 MHz Power PC processor 8245 (version 129/1014) 66 MHz bus
512 KB boot flash memory
16384 KB code flash memory
128 MB DRAM
The system uptime is 1273 days 13 hours 21 minutes 51 seconds
The system started at 03:34:00 GMT+08 Fri Jan 08 2010

 

[root@XXX ~]$ telnet FastIron
User Access Verification

Please Enter Login Name: admin
Please Enter Password:

User login successful.

telnet@FastIron> enable
Password:
telnet@FastIron# config terminal
telnet@FastIron(config)# ip dns domain-name XXX.corp.tw
telnet@FastIron(config)# crypto key generate rsa
Generating rsa key pair....................................done!
rsa public_key "1024 35 1092829580966656243725368288654838732773079439203791924499777844407959381046653312763146715728184311 5393982489084826522373696123358368970099566544026688734670835754850613198473463480899414440450809918639070653712220352657115 6207272034627506115247811480747449986565441578944283841512250XXXXXXXXXXXXXXXXXXXXXXXX FastIron@XXX.corp.tw"

rsa private_key "*************************"

 

 

### activate https service on Foundry FES4802


telnet@FastIron(config)# crypto-ssl certificate generate

Creating certificate, please wait...

ssl-certificate creation is successful
crypto-ssl certificate generate secret_data MIICpjCCAg+gAwIBAgIEguXYdjANBgkqhkiG9YDVQQDEwtEZW1vIFZlbmRvcjAeFw0wNDAxMDEwMDAwMDBaFw0wNjAxMDEwMDAwMDBaMIGMMRswGQYDVQBAsTG0ZMQwwCgYDVQQGEwNVU0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOWHEOTAclA/Q07xhGkdDArdoY3+kMSyVGiCqh91a8yy4dtTuVqVZqftcd/O3y6Q1nxhX2C8ZSNcAHMyKnhg1oZV3ZxF+CRSxGCBFWGxm3hbgkIt7hVg/ZwiqAsvl/Xq5ywDBBvC2lHH7myp7ncCQAD0zD2HQBqDQYl5xXTLdy3MfMV2Zx629H3CU5UxcxGFRyzk/IOhdUCQQDfu12b8iPOztgqgi4nR3qG5Qpuwh4coBFUYF5kVGpq/cVz0g/7xo2SyBVxzTPd/vjHWq39zWcZJ5hx6oLT3gwNAkEA52/xuIYiA/J5LuLc1UDCeVUkOZayD4fYIMkoyhQJYhfrIPKXxox9n38N959/5h/lrDNfkBU9t4O7NBsqOW9pWw==
telnet@FastIron(config)# web-management https
telnet@FastIron(config)# write memory
.Write startup-config done.
telnet@FastIron(config)#Saving SSH host keys process is ongoing. Please wait ................................................. ........................................Writing SSH host keys is done!

telnet@FastIron(config)#exit

liaofamily 發表在 痞客邦 留言(0) 人氣()

CLI to backup D-Link switch configuration by tftp

 

### activate tftp service on RHEL6

[root@XXX ~]$ vim /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
# protocol. The tftp protocol is often used to boot diskless \
# workstations, download configuration files to network-aware printers, \
# and to start the installation process for some operating systems.
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -c -s /tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}


[root@XXX ~]$ service xinetd restart


### backup D-Link switch configuration by tftp

DES-3552:admin# upload cfg_toTFTP 10.1.1.3 dest_file LS2277.cfg
Command: upload cfg_toTFTP 10.1.1.3 dest_file LS2277.cfg

Connecting to server................... Done.
Upload configuration................... Done.

liaofamily 發表在 痞客邦 留言(0) 人氣()

CLI to change command prompt of D-Link DES-3552 switch   

 

### ssh to D-Link switch

[root@XXX~]$ ssh admin@LS2277
admin@LS2277's password:

DES-3552 Fast Ethernet Switch
Command Line Interface

Firmware: Build 2.60.017
Copyright(C) 2010 D-Link Corporation. All rights reserved.

DES-3552:user#


### jump to administrator level privileges

DES-3552:user#enable admin
Command: enable admin

PassWord:
Success.

DES-3552:admin#

 

### change command prompt from DES-3552 to your SWITCH NAME

DES-3552:admin#config command_prompt LS2277
Command: config command_prompt LS2277

Success.

LS2277:admin#

liaofamily 發表在 痞客邦 留言(0) 人氣()

oracle password recovery free tool ~ ngorca

 

COLUMN NAME FORMAT A30
COLUMN PASSWORD FORMAT A30
COLUMN SPARE4 FORMAT A70

SQL> SELECT name,password FROM SYS.USER$ WHERE password is not null and name = 'SYSTEM';

NAME PASSWORD
------------------------------ ------------------------------
SYSTEM D4DF7931AB130E37

SQL> SELECT name,spare4 FROM SYS.USER$ WHERE password is not null and name='SYSTEM';

S:22B95AF42FB2B84115E236B86BBB8DEC5E0366DA46B51C5D49ED2E88AEC8


[ossadmin@nmswp ngorca-1.0.2]$ vi hashlist
SYSTEM:D4DF7931AB130E37:22B95AF42FB2B84115E236B86BBB8DEC5E0366DA46B51C5D49ED2E88AEC8

 

[root@XXX ngorca-1.0.2]$ ngorca -f hashlist -l7 -c2 -t2 -v4


ngorca 1.0.2 (http://netgarage.org)

starting 2 thread(s) to calculate 1 hash value(s)
.................................................

[passlength=7] status 32 %

found pwd --- beer!
username: SYSTEM password: manager
needed 5994 seconds of cpu time
needed 2998 seconds

.................................................

needed 5994 seconds of cpu time
needed 2998 seconds

 

 

ngorca Note:

-f hashlist
To use ngorca a list of username and hash is required, which has the format
username:hash. The hash values are calculated one after another.
example of hash file entry with old DES hash and SHA1 hash:
NETGARAGE:5D7F5FD88AE4C07F:EAC3EAC57FF0635AB298EB40CBDA1BB45DFC1B7F20464AA591C1613A2CB8
<username>:<16 byte DES hash>:<40 byte SHA1 hash + 20 byte salt>
In oracle versions 7-10g there is only the DES hash.

-l password length
Length of the password. If this option is not set the passwords from a length of 5-8 bytes are calculated.

-c charset
The charset of the password. 1 for numeric, 2 for alpha, 3 for alpha numeric
and 4 for alpha numeric with special characters. The default is 3.

-v verbose level
Loglevel for the logfile and standard output 1 - 4 with 4 as the highest level
which contains percent printouts. The default is 1.

-t thread number
The number of threads which should be used. It is recommended to take the
number of cpu's which you want to involve in the calculation for the best
result. The default is 1.

liaofamily 發表在 痞客邦 留言(0) 人氣()

create 2nd MySQL instance on Linux

 

### create directory

mkdir /var/lib/mysql2
chown -R mysql.mysql /var/lib/mysql2/
mkdir /var/log/mysql2
chown -R mysql.mysql /var/log/mysql2

 

[root@XXX ~]$ vi /etc/my2.cnf


[client]
default-character-set = utf8
port = 3307
socket = /var/lib/mysql2/mysql2.sock

[mysqld]
default-character-set = utf8
port = 3307
socket = /var/lib/mysql2/mysql2.sock
datadir = /var/lib/mysql2
skip-locking
key_buffer = 384M
max_allowed_packet = 1M
max_connections = 1000
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
myisam_sort_buffer_size = 64M
thread_cache = 8
query_cache_size = 32M
thread_concurrency = 15
lower_case_table_names = 0
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
skip-name-resolve
wait_timeout=1814400

[mysqldump]
quick
max_allowed_packet = 16M

[isamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout


[mysqld_safe]
log-error = /var/log/mysqld2.log
pid-file = /var/run/mysqld/mysqld2.pid

 

### install 2nd db
[root@XXX ~]# mysql_install_db --user=mysql --datadir=/var/lib/mysql2/


### starting 2nd instance of mysql
[root@XXX ~]# mysqld_safe --defaults-file=/etc/my2.cnf &
Starting mysqld daemon with databases from /var/lib/mysql2


### connecting mysql db but using the wrong socket file
[aliao@XXX ~]$ /usr/bin/mysql -u root -p -h localhost -P 3307
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)


### connecting mysql db, need to specify the socket file
[aliao@XXX ~]$ /usr/bin/mysql -u root -p -h localhost -P 3307 -S /var/lib/mysql2/mysql2.sock
[aliao@XXX ~]$/usr/bin/mysql -S /var/lib/mysql2/mysql2.sock
mysql> SET PASSWORD FOR root@localhost=PASSWORD('');
Query OK, 0 rows affected (0.00 sec)

mysql> select host,user,password from mysql.user;
+-----------+------+----------+
| host | user | password |
+-----------+------+----------+
| localhost | root | |
| XXX | root | |
| 127.0.0.1 | root | |
| localhost | | |
| XXX | | |
+-----------+------+----------+
5 rows in set (0.00 sec)


### shutdown 2nd instance of mysql
[root@XXX ~]# mysqladmin -S /var/lib/mysql2/mysql2.sock shutdown
STOPPING server from pid file /var/run/mysqld/mysqld2.pid
120222 15:49:25 mysqld ended

[1]+ Done mysqld_safe --defaults-file=/etc/my2.cnf

 

### add 2nd instance of mysql to service list and activate it 

[root@XXX init.d]# chkconfig --add mysqld2

[root@XXX init.d]# chkconfig mysqld2 on

[root@XXX init.d]# chkconfig --list|grep mysql
error reading info for service opennms: No such file or directory
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mysqld2 0:off 1:off 2:on 3:on 4:on 5:on 6:off

liaofamily 發表在 痞客邦 留言(0) 人氣()

 


SUSE10P3:~ # cat /etc/issue


Welcome to SUSE Linux Enterprise Server 10 SP3 (x86_64) - Kernel \r (\l).


 


------------ package management zypper 
### .. repos


SUSE10P3:~ # zypper service-add --type YaST dir:///root/Downloads/SLES10_SP3/ SLES-10-SP3


9509 zmd ZENworks Management Daemon is running.


WARNING: this command will not synchronize changes.
Use rug or yast2 for that.
Added Installation Sources:
[x]* SLES-10-SP3 (dir:///root/Downloads/SLES10_SP3/)


### .. repos


SUSE10P3:~ # zypper service-list
# | Enabled | Refresh | Type | Name | URI
--+---------+---------+------+-------------+----------------------------------
1 | Yes | Yes | YaST | SLES-10-SP3 | dir:///root/Downloads/SLES10_SP3/



### .. package
SUSE10P3:~ # zypper search nmap
Restoring system sources...
Parsing metadata for SLES-10-SP3...
S | Catalog | Type | Name | Version | Arch
--+-------------+---------+----------+-----------+-------
i | | package | nmap | 4.20-60 | x86_64
v | SLES-10-SP3 | package | nmap | 4.00-14.2 | x86_64
| SLES-10-SP3 | package | nmap-gtk | 4.00-14.2 | x86_64



SUSE10P3:~ # zypper remove nmap
Restoring system sources...
Parsing metadata for SLES-10-SP3...
Parsing RPM database...
Summary:
<uninstall> [S0:0][package]nmap-4.20-60.x86_64
Continue? [y/n]: y
Removing: [S0:0][package]nmap-4.20-60.x86_64



SUSE10P3:~ # zypper install nmap
Restoring system sources...
Parsing metadata for SLES-10-SP3...
Parsing RPM database...
Summary:
<install> [S1:1][package]nmap-4.00-14.2.x86_64
Continue? [y/n]: y
Downloading: [S1:1][package]nmap-4.00-14.2.x86_64, 680.7 K(2.5 M unpacked)
Installing: [S1:1][package]nmap-4.00-14.2.x86_64



SUSE10P3:~ # zypper search nmap
Restoring system sources...
Parsing metadata for SLES-10-SP3...
S | Catalog | Type | Name | Version | Arch
--+-------------+---------+----------+-----------+-------
i | SLES-10-SP3 | package | nmap | 4.00-14.2 | x86_64
| SLES-10-SP3 | package | nmap-gtk | 4.00-14.2 | x86_64

liaofamily 發表在 痞客邦 留言(0) 人氣()

tomcat 6.0.33 on Solaris 10

 

### download tomcat and install it to /usr/local/tomcat6

root@XXX:/export/home/netxsqm/Downloads > gunzip apache-tomcat-6.0.33.tar.gz
root@XXX:/export/home/netxsqm/Downloads > tar xvf apache-tomcat-6.0.33.tar


root@XXX:/export/home/netxsqm/Downloads > mv apache-tomcat-6.0.33 /usr/local/

root@XXX:/ > groupadd -g 91 tomcat
UX: groupadd: WARNING: gid 91 is reserved.


root@XXX:/usr/local > ln -s ./apache-tomcat-6.0.33/ tomcat6

root@XXX:/usr/local > useradd -m -g tomcat -u 91 -d /export/home/tomcat -s /bin/bash -c 'Apache Tomcat' tomcat
UX: useradd: WARNING: uid 91 is reserved.
64 blocks

root@XXX:/usr/local > chown -R tomcat:tomcat /usr/local/apache-tomcat-6.0.33

 

### create tomcat6  service configuration

root@XXX:/var/svc/manifest/application > vi tomcat6.xml

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="tomcat6:default">
<service name="application/tomcat6" type="service" version="6">
<create_default_instance enabled="false"></create_default_instance>
<single_instance></single_instance>

<dependency name="network" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/milestone/network:default"></service_fmri>
</dependency>

<dependency name="name-services" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/milestone/name-services:default"></service_fmri>
</dependency>

<exec_method name="start" type="method" exec="/usr/local/tomcat6/bin/startup.sh" timeout_seconds="30">
<method_context></method_context>
</exec_method>

<exec_method name="stop" type="method" exec="/usr/local/tomcat6/bin/shutdown.sh" timeout_seconds="30">
<method_context></method_context>
</exec_method>

<property_group name="startd" type="framework">
<propval name="ignore_error" type="astring" value="core,signal"></propval>
</property_group>

<stability value="Stable"></stability>
<template>
<common_name>
<loctext xml:lang="C">Apache Tomcat 6.0.33</loctext>
</common_name>
<documentation>
<doc_link name="Tomcat6 Documentation" uri="http://tomcat.apache.org/tomcat-6.0-doc/index.html"></doc_link>
</documentation>
</template>
</service>
</service_bundle>

 

### validate and import tomcat6 service configuration


root@XXX:/var/svc/manifest/application > svccfg validate ./tomcat6.xml
root@XXX:/var/svc/manifest/application > svccfg import ./tomcat6.xml

### activate tomcat6 service

root@XXX:/var/svc/manifest/application > svcadm enable tomcat6
root@XXX:/var/svc/manifest/application > svcs -lp tomcat6
fmri svc:/application/tomcat6:default
name Apache Tomcat 6.0.33
enabled true
state online
next_state none
state_time Tue May 28 22:26:45 2013
logfile /var/svc/log/application-tomcat6:default.log
restarter svc:/system/svc/restarter:default
contract_id 83975
dependency require_all/none svc:/milestone/network:default (online)
dependency require_all/none svc:/milestone/name-services:default (online)
process 19539 /usr/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-6.0.33/c

liaofamily 發表在 痞客邦 留言(0) 人氣()

1 2