domenica 25 ottobre 2015

Eclipse syntax-highlighting to default

Restore default java, xml syntax-highlighting

Download from  http://eclipsecolorthemes.org/?view=theme&id=790
EPF file

File-> Import -> General -> preference

Select epf downloaded.

 

giovedì 22 ottobre 2015

eclipse reduce tab height

Simple and definitive guide for this annoing problem

Every Linux GTK (and not only) them present horrible Eclipse IDE
I'm working with:
CentOs 7 GUI
Eclipse Mars 4.5

You can customize file in this path:

$YOURHOMEDIR/.p2/pool/plugins/org.eclipse.ui.themes_x.x.x.x.V.xxxxxx/e4_default_gtk.css

Modify css class as:

.MPartStack {
  font-size: 9;
  font-family: Liberation Sans;
  swt-tab-renderer: null;
  swt-tab-height: 22px;
  swt-selected-tabs-background: #FFFFFF #ECE9D8 100%;
  swt-simple: false;
  swt-mru-visible: false;
}


to obtain decent tab style

Alternative to yuo can install Eclipse plugin :

Go to menu Help > Install new software, then install E4 CSS editor (Incubation) plug-in using update site (add this link: http://download.eclipse.org/e4/updates/0.12).

After restart, go to Window > Preferences, General > Appearance and now you can edit styles here for any selected theme




mercoledì 21 ottobre 2015

Centos 7 disco full estendere spazio

Centos 7 filesystem xfs
Estensione dello spazio aggiungendo nuovo disco
Aggregazione nuovo disco nel volumegroup esistente


## Add phisical disk
In this case appears as /dev/sdb

### Modify disk
fdisk -l
fdisk /dev/sdb
m
n (create new partition)
p (primary)
1
enter (default)
enter (deafult)
t (select partition type)
8e (Linux LVM type)
w (save change to disk)

## Create Partition
pvcreate /dev/sdb1  (create patition)
df -h

## Extend Volume group
vgdisplay
vgextend centos /dev/sdb1
vgdisplay
df -Pk
pvs
lvextend -L +15G /dev/mapper/centos-root
df -Pk

## Extend VolumeGroup type xfs
lvs
xfs_growfs /
df -Pk
df -Th
lvs

giovedì 15 ottobre 2015

Xclock Xming Xterm Can't open display

yum install xorg-x11-apps.x86_64
yum  install xorg-x11-xauth
yum install xorg-x11-fonts-*

vi /etc/ssh/sshd_config
      X11Forwarding yes

export DISPLAY=<ip client che esegue server X>:0.0

sul client :

Download Xming Server da http://www.x.org/
Inserire nel file X0.hosts ip del server remoto
Lanciare Xming

Su server remoto test con

xclock&

martedì 1 settembre 2015

opcnode - Hp Omu command

  • To Start the HPOM   management server process
  • To Stop the HPOM   management server process
  • To check the HPOM   server status
Installation
  • To install agent on Unix opc_inst -s <management_server_name>
  • To install agent on Windows
    cscript opc_inst.vbs -s <management_server_name>
  • To Unistall agent
    opc_inst -r
  • To check the agent status
    opcagt status [local agent status]
    opcragt <nodename> [ remote agent status from management server ]
  • To Distribute MonOMUr, Action, Commands & Templates
    opcragt -distrib -monOMUr -action -commands -templates -force <node_name>
Adding/deleting nodes
  • To add a node to node bank
    opcnode -add_node node_name="<node_name>" node_label="<label>" net_type="NETWORK_IP" mach_type="<Machine_type" group_name="<primary_group_name"
  • To delete a node from node bank
    opcnode -del_node node_name="<node_name>" net_type="NETWORK_IP"
  • To change the host name or ip address
    /opt/OV/contrib/OpC/opcchgaddr -force -sync IP <OLD_IP> <OLD_HOST_NAME> IP <NEW_IP> <NEW_HOST_NAME>
Test opcmsg
/opt/OV/bin/OpC/opcmsg s=critical o=Test a=Test msg_text="This server is now being monOMUred"
To start the heartbeat polling of managed node
opchbp -start <managed node>
To List Certificates:
  • ovcm -listpending -l
    opccsa -list_pending_cr
To grant a certificate
ovcm -grant <certificate_id>
To List and check status of certificates
ovcert -list
ovcert -status
To remove certificated
ovcert -remove <certificate_id>
To create a new certificate request
ovcert -certreq
To list the templates/policies
opctemplate -l or ovpolicy -l
To enable/disable a template
opctemplate -e <template_name>
opctemplate -d <template_name>
To download histroy messages
opchistdwn -older 0s -file <file_location>
To acknowledge messaged
opcackmsg -u <username> <message ID>
opcackmsgs -g <group_name> -n <node_name>

Manual Certificate Deployment From management server    a) opccsacm -issue -name <Node Name> -file /tmp/a -pass <password>
From agent
   b) ovcert -importcert -file /tmp/a -pass <password>
To get the remote coreid of the agent:
bbcutil -ping http://<nodename>
To change the coreid of a node in the management server
opcnode -chg_id node_name=<node_name> id=<core_id_from_bbcutil>
To list the core id set in the node bank
opcnode -list_id node_list=<node_bank>
To map the node in the node bank to the certificate request
opccsa –map_node <managed_node name>=<nodebank_managed_node_name>
To create a certificate request from the managed node
ovcert -certreq
To create a new core id from the managed node ovcoreid -create -force
To List the set of configurations from agent ovconfget
To change the agent configuration ovconfchg -ns <nodename> -set <param> <value>
To list the groups in node group bank
opcnode -list_groups|grep Name|awk '{print $3}'
To change the communication type
opcnode -chg_commtype node_list=<nodename> net_type=NETWORK_IP comm_type=COMM_BBC
To change the node type
opcnode -chg_nodetype node_list=<nodename> node_type=<node_type>  [eg.. MESSAGE_ALLOWED]
To List nodes enrolled in HPOM 
opcnode -list_nodes|grep Name|awk '{print $3}'
To view coda collections
codautil -dumpds value
To check DB SPI connection
 /var/opt/OV/bin/OpC/monOMUr/dbspicao -p -v -d  or /var/opt/OV/bin/OpC/cmds/dbspiadm conncheck -nw
To switch off monOMUring for DB instance
dbspicol OFF <instance_name>
Integrating DBSPI with OVPA [unix] :  /var/opt/OV/bin/OpC/cmds/dbspi_mw_int  ( For enabling Graphing )
 /var/opt/OV/bin/OpC/cmds/dbspi_mw_int -osm  .. -udm ( For reporter )
To list open sessions of JAVA and Motif GUIs
checkuiwww
To check OM management server queue files
/opt/OV/contrib/OpC/opcqschk
/opt/OV/contrib/OpC/opcqchk
To create trap template from trapd.conf
ovtrap2opc /etc/opt/OV/share/conf/C/trapd.conf <Template_name> <Service_name>
To check the syntax of flexible management templates
opcmomchk
To list the services opcservice -list
To assign a service to opc user opcservcie -assign <user_name> <service_name>

Oracle start up scripts
/sbin/init.d/OMUracle start/stop
############################################
UNIX Agent recycle :
1. Kill the agent process using : ovc -kill 2. Remove all the files under "/var/opt/OV/log/OpC/"
3. Start the agent process using : ovc -start
############################################
opcdeploy/ovdeploy:
opcdeploy -cmd "<cmd_to_run_at_agent_end>" -node <node_name>
opcdeploy -deploy -file <file_location> -node <node_name> -targetdir <Target_dir> -trd absolute
############################################
SQL Tweaks
To get unassigned nodes to NG  in HPOM 
select nn.node_name from opc_nodes n, opc_node_names nn
     where nn.node_id = n.node_id
     and not exists (select 1 from opc_nodes_in_group nig where nig.node_id = nn.node_id);
Show Assignments on Node SELECT OPC_NODE_NAMES.NODE_NAME, OPC_SOURCE_TEMPL.TEMPLATE_NAME FROM OPC_NODE_CONFIG, OPC_NODE_NAMES, OPC_SOURCE_TEMPL WHERE OPC_NODE_CONFIG.NODE_ID = OPC_NODE_NAMES.NODE_ID AND OPC_NODE_CONFIG.TEMPLATE_ID = OPC_SOURCE_TEMPL.TEMPLATE_ID AND OPC_NODE_NAMES.NODE_NAME LIKE 'ENTER NODE NAME HERE';
Show Template Assignment SELECT OPC_NODE_NAMES.NODE_NAME, OPC_SOURCE_TEMPL.TEMPLATE_NAME FROM OPC_NODE_CONFIG, OPC_NODE_NAMES, OPC_SOURCE_TEMPL WHERE OPC_NODE_CONFIG.NODE_ID = OPC_NODE_NAMES.NODE_ID AND OPC_NODE_CONFIG.TEMPLATE_ID = OPC_SOURCE_TEMPL.TEMPLATE_ID AND OPC_SOURCE_TEMPL.TEMPLATE_NAME LIKE 'ENTER TEMPLATENAME HERE';
############################################
Set environment variables in .profile
        . /opt/OV/bin/ov.envvars.sh
        PATH=$PATH:/opt/OV/bin         export PATH
############################################
/opt/OV/contrib/OpC/opcsystst
-a        Do everything below
-h       Display the hostname
-u       Display the uname info
-i       Display all configured network interfaces
-l       Display the local IP address
-o       Display the OpC mgmt server
-n       Resolve and display the IP addresses for all displayed node
  names and resolve and display the node names for all
  displayed IP addresses
-r       Display all registered RPC servers
############################################
/opt/OV/bin/OpC/install/opctranm -jobfile <file>
whereas <file> can have for example the following entries:
nodename.domain.com
/tmp/file1 /tmp/file2
=> this will transfer file1 from the management server /tmp directory to /tmp/file2 on the agent nodename.domain.com
nodename.domain.com
!ls
=> this will execute an ls on the unix agent node coco and return the result
nodename.domain.com
!<path>ifconfig /all
############################################
You can use the SQL scripts in the below dir to get reports.
/etc/opt/OV/share/conf/OpC/mgmt_sv/reports/C/

For ex: call_sqlplus.sh sel_nodes <Fully_qualified_domain_name> --> will give the node details
############################################
OVPA
perfstat -p , -e , -v
/opt/perf/bin/utility -xc /var/opt/perf/alarmdef --> to chk syntax of alarmdef file
/opt/perf/bin/utility -xc /var/opt/perf/parm --> chk parm file
############################################
Directories
/var/opt/OV/share/tmp/OpC/distrib        template Distribution directory
/etc/opt/OV/share/conf/OpC/mgmt_sv        Flexible management templates
/var/opt/OV/share/conf/SPISvcDisc/        Service Discovery xml
/var/opt/OV/log/SPISvcDisc/discovery_error.log    Discovery Error Log
Agent Policies
/var/opt/OV/datafiles/policies/configsettings/ --> nodeinfo
/var/opt/OV/datafiles/policies/le/             --> logfile templates
/var/opt/OV/datafiles/policies/mgrconf/        --> MoM templates
/var/opt/OV/datafiles/policies/monOMUr/        --> monOMUr templates
/var/opt/OV/datafiles/policies/msgi/           --> opcmsg templates
/var/opt/OV/datafiles/policies/trapi/          --> SNMP trap templs
############################################
Unix utils
Tar and Untar:
tar -cvf <dir.tar> dir
tar -xvf a.tar
Mounting iso image to HPUX 11.31
mkdir /isoimg lvcreate -n ISOLV -L 3096 /dev/vg00 dd if=isoimage of=/dev/vg00/rISOLV bs=8192 mount /dev/vg00/ISOLV /isoimg

using pfs mount
/usr/sbin/pfs_mountd &
/usr/sbin/pfsd &
pfs_mount -o xlat=unix /iso_image.iso /ISO_CDROM/
To change kernel parameters with command line
kctune -K -h <parameter>=<value> [Ex : kctune -K -h maxuprc=3687 ]
To Check the quality pack installed on HPUX
/usr/sbin/swlist | grep -e QPK -e GOLD -e BUNDLE11i
swinstall -s <Source_depot_file> -x autoreboot=false \
-x patch_match_target=true

mercoledì 1 aprile 2015

Centos 7 change keyboard layout

To list all available locale:
localectl list-keymaps 
 
To set locale:
  localectl set-keyp [map name] 
 
To change the default keyboard layout for X11
  localectl set-x11-keymap [map name] 
 
To load locale keys:
  loadkeys [it,fr,us,...]
 
To persist new setting for all user add command to 
 
/etc/profile.d