Showing posts with label daniele tasinato. Show all posts
Showing posts with label daniele tasinato. Show all posts

Sunday, October 25, 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.

 

Friday, October 23, 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




Wednesday, October 21, 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

Friday, October 16, 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&

Tuesday, September 1, 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

Wednesday, April 1, 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

Sunday, May 4, 2014

WindowBuilder supports only SmartGWT versions 2.4, 2.5. But 4.1p found

To fix this error substitute file com.google.gdt.eclipse.designer.SmartGWT_3.1.2.r43x201307151456.jar under eclipse/plugin white these (free com.google.gdt.eclipse.designer.SmartGWT_3.1.2.r43x201307151456.jar
Confirm to work with SmartGWT 4.1p + eclipse 4.3(kepler) + gwt-designer 3.1.2. Below modification code details changed on file linked
Daniele
Index: src/com/google/gdt/eclipse/designer/smart/parser/ClassLoaderValidator.java
===================================================================
src/com/google/gdt/eclipse/designer/smart/parser/ClassLoaderValidator.java (working copy)

 import org.eclipse.jdt.core.IJavaProject;
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;

 /**
  * {@link IClassLoaderValidator} for SmartGWT.
  * 

  * @coverage SmartGWT
  */
 public final class ClassLoaderValidator implements IClassLoaderValidator {

  private static final Pattern VERSIONS_PATTERN = Pattern.compile("^(\\d+\\.\\d+)[dp]?$");
  private static final String[] VALID_VERSIONS = {"2.4", "2.5", "3.0", "3.1", "4.0", "4.1", "5.0"};
  private static final String VALID_VERSIONS_STRING = StringUtils.join(VALID_VERSIONS, ", ");
 
   ////////////////////////////////////////////////////////////////////////////
   //

       public String runObject() throws Exception {
         Class classVersion = classLoader.loadClass("com.smartgwt.client.Version");
         String version = (String) ReflectionUtils.invokeMethod(classVersion, "getVersion()");
         Matcher matcher = VERSIONS_PATTERN.matcher(version);
         if (matcher.matches() && ArrayUtils.contains(VALID_VERSIONS, matcher.group(1))) {
           initializeSmartGWT(classLoader);
           return null;
         }

Monday, April 7, 2014

MysqlException Number Code List

When we catch exception using, for example, mysql net connector we can go deep and find out error.
We can discover error code, checking property Number of class MySqlException.



try
{
 connection.Open();
}
catch (MysqlException ex)
{
 switch (ex.Number)
                {

                    case 0:
                        return "Cannot connect to server";
                        break;

                    case 1045:
                        return "Invalid username/password, please try again";
                        break;                  

                 }
}

For a complete errors number list plaese referrer to http://dev.mysql.com/doc/refman/5.6/en/error-messages-server.html and in the share/errmsg.txt file

Monday, March 10, 2014

Cenots set Fully Qualified Domain Name Glasshfish problem

How to configure fqdn on centos for your linux box on private lan
Remeber that domain must be always full qualified,  domain + extension  (local + .com)

Example data:
Server Name ----------------------------------- gffp01t
Static ip ----------------------------------------- 192.168.1.191
Local domain (for your lan example) ------ local.com 

1 Edit Hosts File
$ sudo vim /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 gffp01t.local.com gffp01t
192.168.1.191 gffp01t.local.com gffp01t
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 
::1 gffp01t.local.com gffp01t

2 Edit network $ sudo vim  /etc/sysconfig/network HOSTNAME=gffp01t.local.com

.....
Reboot system  
.....

4 Verify
$ hostname
(output) gffp01t.local.com
$ hostname -f
(output) gffp01t.local.com

Monday, August 19, 2013

NSIS customize files based on languages

 NSIS How to get user selected language without using registry function

This is an example based on my custom needed to rename config file for my application based on language selection by user during setup 

First onInit function you must pop $LANGUAGE variable on global stack as you can retrive it later.

Function .onInit
....

....
!insertmacro MUI_LANGDLL_DISPLAY
 Pop $LANGUAGE

FunctionEnd


Then on interested section you wite your custom language files (D_MyApp..... E_MyApp.... F_MyApp...)

Section "MainSection" SEC01
  SetOutPath "$INSTDIR"
  SetOverwrite try
  SetDetailsPrint none
  SetShellVarContext all
  File "D:\projects\xxxxx\MyApp_v32_09082013\D_MyApp.exe.config"
  File "D:\projects\xxxxx\MyApp_v32_09082013\E_MyApp.exe.config"
  File "D:\projects\xxxxx\MyApp_v32_09082013\F_MyApp.exe.config"


 Here you compare $LANGUAGE with
LCID value  (see http://www.science.co.il/Language/Locale-codes.asp  for reference)

If selected language match then rename file else continue if statement

  StrCmp $LANGUAGE '1031' customGerman noDE
  customGerman:
  Rename "$INSTDIR\D_MyApp.exe.config" "$INSTDIR\MyApp.exe.config"
  goto languageSettingsDone
 
  noDE:
  StrCmp $LANGUAGE '1033' customEnglish noEN
  customEnglish:
  Rename "$INSTDIR\E_MyApp.exe.config" "$INSTDIR\MyApp.exe.config"
  goto languageSettingsDone

  noEN:
  StrCmp $LANGUAGE '1036' customFrench noFR
  customFrench:
  Rename "$INSTDIR\F_MyApp.exe.config" "$INSTDIR\MyApp.exe.config"
  goto languageSettingsDone
 
  noFR:
  goto languageSettingsDone
 
  languageSettingsDone:
....

....
....

;Contiune with other files


If this short giude has been usefull for you please leave comment

Thursday, May 9, 2013

webmin customize This web server is running in SSL mode. Try the URL


To customize webmin error message when try access to webmin login on http connection follow these few steps (this giude refer to centos 6.4 )

1 cd /usr/libexec/webmin/
2. vim miniserv.pl

3. find error string ... "This web server is running in SSL mode. Try the URL..."
4. Change it with you favorite error message string and variables
5. Save
6 service webmin restart

Done!

Now you can login to your http:\\yourdomain.ext:10000 console and see :)


Brokenpipe

Please leave a small feedback if this post has been usefull for you.

Sunday, June 10, 2012

ZigBee ProBee-ZE10 DLL coming soon

I'm working on first beta release for dll library on Sena ProBee ZE 10 chipset
Goals are to abstrac low level requests, to simply high level c# class.
Project basen on event driven task such as class will supply all events directly on your class handler code.
Those interested can ask questions here or follow the development on www.brokenpipe.it

Tuesday, June 21, 2011

Crystal Reports filed text newline, carriage return, \r\n

Nel mio crystal report ho un textFiled, vorrei settare il suo valore runtime.

rpt.DataDefinition.FormulaFields["fieldTarga"].Text =TextBoxTarga.Text;
Tutto funziona correttamente, fino a quando il valore da assegnare non contiene i caratteri speciali linefeed e carriage return "\r\n". Questo è un bug di Crystal Report for .NET 
Per risolvere il problema, anche se di primo acchito appare insensato, possiamo ovviare usando questa semplice funzione:
string FormatCRField(string s)
        {
            return "'" + s.Replace("\r\n", "' + chr(10) + '") + "'";
        }
Sostituisce "\r\n"  con chr(10) che verrà interpetato correttamente dal "parser" di CR.
Spero che questo possa aiutarti.