Acerca de Linux, BSD y notas personales

Archives for Nix category

X forwarding with ssh -X and XMing

Redirecting X over tcp / udp and using something like “XWin -query machine” is insecure. So are most VNC solutions. You can use X forwarding over ssh:


% ssh -X -C -c blowfish MachineHostname xterm

(Blowfish encryption tends to be a bit faster, and -C enforces compression, though it should be enabled by default. If you have issues with X forwarding, check your /etc/ssh/sshd_config for “X11Forwarding yes” and “ForwardX11 yes“).

Sometimes you _have_ to run a graphical interface on a UNIX machine, and do so from your Windows box. Examples include the Oracle Installer and some other Java applications.

While you could install Cygwin to provide you with an XOrg server implementation, Cygwin tends to be quite big. A lighter and faster option would be to use XMing. It’s small, fast and just works. Just fire up XWin, and it will listen on 0:0 by default.

Now you can use “ssh -X machineIP xterm” and it will start a remote XTerm right on your machine. Or if you use putty, make sure you redirect X:

Now run your favorite GUI application.

Patching the Solaris / BOX / Patch Management

Steps:

1. Register the system with Sun in order to use Update Manager and other tools. i.e. Sun Update Connection

Applications -> Utilities -> UpdateManager

# which updatemanager
/usr/bin/updatemanager

Registration without subscription key limits updates to the following:

a. Security updates for sotware
b. applicable hardware updates ( firmware )

Note: Sun Update Connection features are unavailable without a service plan ( provides subscription key )

Note> Update Manager defaults to downloading signed patches

… Next Patch MGMT 2 …

Solaris DVD Installer PKG MGMT.

Setup NFS on installation server to share DVD contents:

share -F nfs -o ro,anon=0 /export/home/Solaris10

[ssybl2:~]# cat /etc/dfs/dfstab

# Place share(1M) commands here for automatic execution
# on entering init state 3.
#
# Issue the command ’svcadm enable network/nfs/server’ to
# run the NFS daemon processes and the share commands, after adding
# the very first entry to this file.
#
# share [-F fstype] [ -o options] [-d ""] [resource]
# .e.g,
# share -F nfs -o rw=engineering -d “home dirs” /export/home2
share -F nfs -o ro,anon=0 /export/home/install/Solaris_10/Tools/Boot


To re-read dfstab :
exportfs -a

Mount remote server’s installation NFS share point

mount -F nfs servidor:/mnt /export/home/solaris10ISO

#### installer ####

prodreg - application to manage add/remove programs on Solaris BOX

### Shell - Based package management tools ###

pkginfo - display software package information
pkgadd - transfer software packages to the system
pkgrm - remove a package from the system
pkgchk - check package installation accuracy

1. pkginfo - dumps to STDOUT (screen/terminal) all installed pakacges
pkginfo returns - category, package name, description

2. pkginfo -l [package_name] - detailed package listing

3. pkginfo -x returns and extracted list of packages. abbreviation, name, arch.

4. pkginfo -q queries for a package and returns exit status ( 0 / 1 )

5. pkginfo -i - fully installed packages
pkginfo -p partially installed

### pkgchk ### integrity

1. pkgchk -v SUNWevolution - checks/lists files included with SUNWevolution

2. pkgchk -lp - determines which package vim belongs to

# pkgchk -lp /opt/csw/bin/vim
Pathname: /opt/csw/bin/vim
Type: regular file
Expected mode: 0755
Expected owner: root
Expected group: bin
Expected file size (bytes): 1791664
Expected sum(1) of contents: 53780
Expected last modification: Nov 12 23:25:27 2007
Referenced by the following packages:
CSWvim
Current status: installed

3. pkgchk -ap /opt/csw/bin/vim - audits the permissions on the file ‘vim’ ( exit status 0/1 )

4. pkgchk -fp - fix permissions on the file

5. pkgchk -cp /opt/csw/bim/vim sum check ( integrity of the file )

6. pkgchk -q - returns useable exit status

### pkgadd ### install programs

1. pkgadd -d package_name - install from current directory or spool directory /var/spool/pkg

2. pkgadd - this will install programs in the spool directory

Common Solaris Package Online Repositories:

1. www.sunfreeware.com
2. www.blastwave.org - blastwave.org/mirrors.php
3. www.sun.com

pkgadd -d nano
pkgadd -v nano
pkgadd -d URL

Note: when installing via HTTP, packaged MUST be in package stream form.

Use ‘pkgtrans’ to transform packaged to packaged stream format.

### pkgrm ### Package Remove

1. pkgrm package_name

www.sunfreeware.com

http://www.sunfreeware.com/indexsparc10.html

chkrootkit solaris

### ps ###


1. ps, ps -ef (includes all processes)
2. pgrep - searches process list for matching programms
3. pkill - searches process list for matching programs and kills them

4. pwdx 1064 what directory is running a process
5. prstat ( like top in linux )
6. prtdiag - display system diagnostic information

Currently running:

1. ps


[ssybl0:~]$ ps
PID TTY TIME CMD
1030 pts/2 0:00 bash
1034 pts/2 0:00 ps

All the programs
2. ps -ef


[ssybl0:~]$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 0 0 0 19:19:06 ? 0:20 sched
root 1 0 0 19:19:08 ? 0:00 /sbin/init
root 2 0 0 19:19:08 ? 0:00 pageout
root 3 0 0 19:19:08 ? 1:06 fsflush
daemon 310 1 0 19:19:32 ? 0:00 /usr/sbin/rpcbind
root 7 1 0 19:19:09 ? 0:08 /lib/svc/bin/svc.startd
root 9 1 0 19:19:09 ? 0:29 /lib/svc/bin/svc.configd
root 335 1 0 19:19:34 ? 0:02 /usr/lib/inet/inetd start
daemon 315 1 0 19:19:32 ? 0:00 /usr/lib/nfs/statd
carlosap 968 965 0 20:07:00 ? 0:00 /usr/lib/ssh/sshd
root 366 364 0 19:19:34 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 118 1 0 19:19:23 ? 0:00 /usr/lib/ldoms/drd
smmsp 542 1 0 19:19:41 ? 0:00 /usr/lib/sendmail -Ac -q15m
root 364 1 0 19:19:34 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
daemon 316 1 0 19:19:32 ? 0:00 /usr/lib/nfs/nfs4cbd
daemon 117 1 0 19:19:23 ? 0:01 /usr/lib/crypto/kcfd
root 356 342 0 19:19:34 ? 0:00 /usr/lib/saf/ttymon
root 370 7 0 19:19:34 console 0:00 /usr/lib/saf/ttymon -g -d /dev/console -l console -m ldterm,ttcompat -h -p ssyb
daemon 321 1 0 19:19:33 ? 0:00 /usr/lib/nfs/lockd
root 159 1 0 19:19:23 ? 0:01 /usr/sbin/nscd
root 228 1 0 19:19:25 ? 0:00 /usr/sbin/cron
root 358 1 0 19:19:34 ? 0:00 /usr/lib/utmpd
root 157 1 0 19:19:23 ? 0:00 /usr/lib/sysevent/syseventd
root 170 1 0 19:19:24 ? 0:01 /usr/lib/picl/picld
daemon 317 1 0 19:19:32 ? 0:00 /usr/lib/nfs/nfsmapid
root 365 364 0 19:19:34 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 220 1 0 19:19:25 ? 0:00 /usr/lib/efcode/sparcv9/efdaemon
root 342 7 0 19:19:34 ? 0:00 /usr/lib/saf/sac -t 300
carlosap 1030 1028 0 21:05:53 pts/2 0:00 -bash
root 453 1 0 19:19:40 ? 0:00 /usr/sbin/vold -f /etc/vold.conf
root 482 1 0 19:19:41 ? 0:00 /usr/sbin/syslogd
root 444 1 0 19:19:40 ? 0:00 /usr/lib/autofs/automountd
root 445 444 0 19:19:40 ? 0:00 /usr/lib/autofs/automountd
noaccess 837 1 0 19:19:55 ? 1:38 /opt/se6000/java_1.5.0/usr/java/bin/java -server -Xms64m -Xmx512m -XX:+Backgrou
root 562 1 0 19:19:42 ? 0:00 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
root 540 1 0 19:19:41 ? 0:00 /usr/lib/sendmail -bd -q15m
root 559 1 0 19:19:42 ? 0:00 /usr/sfw/sbin/snmpd
root 502 1 0 19:19:41 ? 0:05 /opt/SUNWsefms/sbin/./wrapper-solaris-sparc-32 /opt/SUNWsefms/sbin/../System/wr
root 965 523 0 20:06:57 ? 0:00 /usr/lib/ssh/sshd
root 523 1 0 19:19:41 ? 0:00 /usr/lib/ssh/sshd
carlosap 1042 1030 0 21:31:18 pts/2 0:00 ps -ef
root 532 502 0 19:19:41 ? 1:13 /opt/se6000/java_1.5.0/usr/java//bin/java -DSUNWsefms=../ -Xms8m -Xmx128m -Djav
carlosap 1028 1025 0 21:05:53 ? 0:00 /usr/lib/ssh/sshd
root 548 1 0 19:19:41 ? 0:04 /usr/lib/fm/fmd/fmd
root 580 1 0 19:19:42 ? 0:00 /usr/lib/dmi/dmispd
root 584 1 0 19:19:42 ? 0:00 /usr/lib/dmi/snmpXdmid -s ssybl0.ssy.gob.mx
root 620 1 0 19:19:45 ? 0:06 /opt/SMgr/agent/jre/bin/java -classpath /opt/SMgr/agent/SMagent.jar devmgr.laun
root 1025 523 0 21:05:50 ? 0:00 /usr/lib/ssh/sshd
root 975 970 0 20:09:55 pts/1 0:00 -bash
carlosap 970 968 0 20:07:00 pts/1 0:00 -bash
root 666 1 0 19:19:46 ? 0:00 /usr/dt/bin/dtlogin -daemon

Search all instances of sshd
pgrep sshd the same effect like ps -ef |grep sshd


[ssybl0:~]# pgrep sshd
968
965
523
1028
1025


[ssybl0:~/docs]$ prtdiag
System Configuration: Sun Microsystems sun4v Sun Blade T6300 Server Module
Memory size: 3968 Megabytes

================================ Virtual CPUs ================================

CPU ID Frequency Implementation Status
—— ——— ———————- ——-
0 1000 MHz SUNW,UltraSPARC-T1 on-line
1 1000 MHz SUNW,UltraSPARC-T1 on-line
2 1000 MHz SUNW,UltraSPARC-T1 on-line
3 1000 MHz SUNW,UltraSPARC-T1 on-line
4 1000 MHz SUNW,UltraSPARC-T1 on-line
5 1000 MHz SUNW,UltraSPARC-T1 on-line
6 1000 MHz SUNW,UltraSPARC-T1 on-line
7 1000 MHz SUNW,UltraSPARC-T1 on-line
8 1000 MHz SUNW,UltraSPARC-T1 on-line
9 1000 MHz SUNW,UltraSPARC-T1 on-line
10 1000 MHz SUNW,UltraSPARC-T1 on-line
11 1000 MHz SUNW,UltraSPARC-T1 on-line
12 1000 MHz SUNW,UltraSPARC-T1 on-line
13 1000 MHz SUNW,UltraSPARC-T1 on-line
14 1000 MHz SUNW,UltraSPARC-T1 on-line
15 1000 MHz SUNW,UltraSPARC-T1 on-line
16 1000 MHz SUNW,UltraSPARC-T1 on-line
17 1000 MHz SUNW,UltraSPARC-T1 on-line
18 1000 MHz SUNW,UltraSPARC-T1 on-line
19 1000 MHz SUNW,UltraSPARC-T1 on-line
20 1000 MHz SUNW,UltraSPARC-T1 on-line
21 1000 MHz SUNW,UltraSPARC-T1 on-line
22 1000 MHz SUNW,UltraSPARC-T1 on-line
23 1000 MHz SUNW,UltraSPARC-T1 on-line

======================= Physical Memory Configuration ========================
Segment Table:
————————————————————–
Base Segment Interleave Bank Contains
Address Size Factor Size Modules
————————————————————–
0×0 4 GB 4 2 GB MB/CMP0/CH0/R0/D0
MB/CMP0/CH0/R0/D1
2 GB MB/CMP0/CH3/R0/D0
MB/CMP0/CH3/R0/D1

========================= IO Configuration =========================

IO
Location Type Slot Path Name Model
———– —– —- ——————————————— ————————- ———
MB/NET0 PCIE MB /pci@780/pci@0/pci@1/network@0 network-pciex8086,105e
MB/NET1 PCIE MB /pci@780/pci@0/pci@1/network@0,1 network-pciex8086,105e
MB/PCI-EM0 PCIE 0 /pci@780/pci@0/pci@9/SUNW,emlxs@0 SUNW,emlxs-pci10df,fc20 LPem11002+
MB/PCI-EM0 PCIE 0 /pci@780/pci@0/pci@9/SUNW,emlxs@0,1 SUNW,emlxs-pci10df,fc20 LPem11002+
MB/USB0 PCIE MB /pci@7c0/pci@0/pci@1/pci@0/usb@0 usb-pciclass,0c0310
MB/USB1 PCIE MB /pci@7c0/pci@0/pci@1/pci@0/usb@0,1 usb-pciclass,0c0310
MB/USB2 PCIE MB /pci@7c0/pci@0/pci@1/pci@0/usb@0,2 usb-pciclass,0c0320
MB/SAS-SATA PCIE MB /pci@7c0/pci@0/pci@2/scsi@0 scsi-pciex1000,58 LSI,1068E

============================ Environmental Status ============================
Fan sensors:
All fan sensors are OK.

Temperature sensors:
All temperature sensors are OK.

Current sensors:
All current sensors are OK.

Voltage sensors:
All voltage sensors are OK.

============================ FRU Status ============================
All FRUs are enabled.


…. NEXt PACKAGE MGMT ……

System Info Commands

### SYSTEM INFO COMMANDS ###

Solaris version and platform information


[ssybl0:~]# cat /etc/release
Solaris 10 5/08 s10s_u5wos_10 SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 24 March 2008

showrev

[ssybl0:~]# showrev
Hostname: bl0
Hostid: 84avaa
Release: 5.10
Kernel architecture: sun4v
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.10 Generic_127127-11

### Determine configured memory (includes physical memory)

1. prtconf

[ssybl0:~]# prtconf
System Configuration: Sun Microsystems sun4v
Memory size: 3968 Megabytes
System Peripherals (Software Nodes):

SUNW,Sun-Blade-T6300
scsi_vhci, instance #0
ib, instance #0 (driver not attached)
packages (driver not attached)
SUNW,builtin-drivers (driver not attached)
deblocker (driver not attached)
disk-label (driver not attached)
terminal-emulator (driver not attached)
dropins (driver not attached)
SUNW,asr (driver not attached)
kbd-translator (driver not attached)
obp-tftp (driver not attached)
ufs-file-system (driver not attached)
chosen (driver not attached)
openprom (driver not attached)
client-services (driver not attached)
options, instance #0
aliases (driver not attached)
memory (driver not attached)
virtual-memory (driver not attached)
virtual-devices, instance #0
flashprom (driver not attached)
channel-devices, instance #0
virtual-channel (driver not attached)
virtual-channel-client, instance #1
virtual-channel (driver not attached)
console, instance #0
rtc (driver not attached)
fma, instance #0
sunvts (driver not attached)
sunmc (driver not attached)
explorer (driver not attached)
led (driver not attached)
flashupdate (driver not attached)
ncp, instance #0
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
pci, instance #0
pci, instance #0
pci, instance #1
network, instance #0
network, instance #1
pci, instance #2
pci, instance #3
pci, instance #4
SUNW,emlxs, instance #0
fp (driver not attached)
disk (driver not attached)
fp, instance #2
ssd, instance #0
ssd, instance #2
SUNW,emlxs, instance #1
fp (driver not attached)
disk (driver not attached)
fp, instance #0
ssd, instance #1
ebus, instance #0
serial, instance #0 (driver not attached)
pci, instance #1
pci, instance #5
pci, instance #6
pci, instance #0
usb, instance #0
usb, instance #1
usb, instance #0
pci, instance #7
scsi, instance #0
tape (driver not attached)
disk (driver not attached)
sd, instance #1
pci, instance #8
pci, instance #9
os-io (driver not attached)
iscsi, instance #0
pseudo, instance #0
[ssybl0:~]# prtconf | grep -i memory
Memory size: 3968 Megabytes
memory (driver not attached)
virtual-memory (driver not attached)


Determine installed processors ( includes physical/virtual processors )


[ssybl0:~]# psrinfo
0 on-line since 08/22/2008 19:19:05
1 on-line since 08/22/2008 19:19:07
2 on-line since 08/22/2008 19:19:07
3 on-line since 08/22/2008 19:19:07
4 on-line since 08/22/2008 19:19:07
5 on-line since 08/22/2008 19:19:07
6 on-line since 08/22/2008 19:19:07
7 on-line since 08/22/2008 19:19:07
8 on-line since 08/22/2008 19:19:07
9 on-line since 08/22/2008 19:19:07
10 on-line since 08/22/2008 19:19:07
11 on-line since 08/22/2008 19:19:07
12 on-line since 08/22/2008 19:19:07
13 on-line since 08/22/2008 19:19:07
14 on-line since 08/22/2008 19:19:07
15 on-line since 08/22/2008 19:19:07
16 on-line since 08/22/2008 19:19:07
17 on-line since 08/22/2008 19:19:07
18 on-line since 08/22/2008 19:19:07
19 on-line since 08/22/2008 19:19:07
20 on-line since 08/22/2008 19:19:07
21 on-line since 08/22/2008 19:19:07
22 on-line since 08/22/2008 19:19:07
23 on-line since 08/22/2008 19:19:07

Physical Procesors:

prtinfo -p

virtual processors

prtinfo -pv

[ssybl0:~]# psrinfo -pv
The physical processor has 24 virtual processors (0-23)
UltraSPARC-T1 (cpuid 0 clock 1000 MHz)


isainfo - describe instruction set architectures

[ssybl0:~]# isainfo
sparcv9 sparc
[ssybl0:~]# isainfo -bv
64-bit sparcv9 applications
asi_blk_init

ssybl2:~]$ isainfo -bv
64-bit amd64 applications
cx16 sse3 sse2 sse fxsr amd_3dnowx amd_3dnow amd_mmx mmx cmov amd_sysc
cx8 tsc fpu

[ssybl0:~]# isalist
sparcv9 sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc sparcv9+vis sparcv9+vis2 sparcv8plus+vis sparcv8plus+vis2

[ssybl2:~]$ isalist
amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

#### Determine and change system timestamp ###

1. date - to reveal current timestamp
2. date ‘+DateTime: %m.%d.%Y @ %H:%M.%S’
3. date mmddHHMMccyy
4. date 050817252006

BASH .bash_profile


[ssybl0:~]# cat .bash_profile
export TERM=xtermc
export PS1=’[\h:\w]\$ ‘
alias ls=’ls -l’
alias vi=’vim’

Configuración BLADE

Brocade 200E Fibre Channel Switch

Brocade 200E Fibre Channel Switch

Designed to meet the needs of small and growing SAN environments, the Brocade 4 Gb/sec 200E Fibre Channel switch delivers low-cost access to SAN technology. The switch scales from 8 to 16 ports, is easy to use and install, and is ideal for small and medium-sized organizations deploying their first SAN or expanding their current one.
At A Glance

* Low-cost, high-performance switch designed for small SAN environments
* Scales from 8 to 12 or 16 ports
* Advanced Web tools ease installation and maintenance
* Auto-sensing Fibre Channel switching at 1, 2, and 4 Gb/sec
* Inter-Switch Link Trunking enables high-speed data path up to 16 Gb/sec

Key Applications

* Backup and Restore
* DAS to SAN Migration
* High Availability
* Server/Storage Consolidation

Average Customer Rating
Product Rating

1 star
(1 Rating)
Write a Review
Read 1 Review
Key Industries

* Education
* Financial Services
* Global Government
* Healthcare
* Manufacturing
* Media, Entertainment, and Internet Services
* Retail
* Transportation and Travel

MySQL Solaris Tools

http://www.sun.com/systems/solutions/mysql/tools.jsp