How to scan Java files only in HP Fortify Audit Workbench 16.10

Recently I needed to run a Fortify scan on a project with several modules. I was told to scan only Java files (*.java) but with the constraint that this files should not be the ones inside test directories (*test*) After doing some research and reading the documentation I came up with the following command: “-b” “SiryProject” “-machine-output” “-source” “1.8” “C:MyProjectsSiryProject**srcmainjava***.java” …

How to convert a String into JSON object in NodeJS

Just a few days ago I needed to do this and I found this useful function. Very simple: var jsonStr = “{“firstName”:”Siry”, “lastName”:”Mazari”}”; console.log(‘JSON String: %s’, jsonStr); var jsonObj = JSON.parse(jsonStr); console.log(‘First Name: %s’, jsonObj.firstName); console.log(‘Last Name: %s’, jsonObj.lastName); The variable jsonStr contains a String representation of a JSON object. The variable jsonObj contains the object that was parsed from …

How to add Archive Version to MANIFEST.MF file with Maven

I was asssigned a task in which I needed to see the version of the war file deployed in the weblogic admin console, it was not being displayed and they wanted to see it, so I had no clue about it, after some research I found that in the MANIFEST.MF file of the WAR file there should have this entry: Weblogic-Application-Version: …

How to increase memory in HP Fortify Audit Workbench 4.10

Today I faced some issue when using Fortify. I was getting something like this: [error]: There is not enough memory available to complete analysis.  For details on making more memory available, please consult the user manual [warning]: There were 2 problems with insufficient memory. Results may be incomplete. Consider allocating more memory. I did look in the user manual and …

How to find strings in files in Linux

Today I needed to search for a specific string in all files inside a SOAP UI project, you just need to execute the following command: grep -rnw “getList” /home/SOAPUI_Proj/ Please notice that the text in italics means that the value is variable. Sources http://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/ http://stackoverflow.com/questions/16956810/finding-all-files-containing-a-text-string-on-linux

How to change keyboard layout in CentOS Linux

Today I ran into the problem of installing a virtual machine that has a french keyboard layout.  I have a US keyboard so it’s clear that I needed to change. Here’s how to do it from console. Open the keyboard file for editing vi /etc/sysconfig/keyboard You will see something like this: Change KEYTABLE and LAYOUT from “fr” to “us” Save it …

How to empty an Oracle 11g XE database

Once I needed to empty an Oracle database that was used by several systems, so it was a big mess with tables not needed and a lot of trash. Anyway, here’s a script that will generate a file with drop commands, this is the one that will drop all objects in the database. The good thing about this is that you …

How to connect to a remote Oracle database

Here is how to connect to a remote Oracle database using SQLPlus: sqlplus user/pass@(DESCRIPTION=(ADDRESS=(PROTOCOL=protocol)(HOST=host)(PORT=port))(CONNECT_DATA=(SID=sid))) Please note that the words in Italics represent variables: user – user name for the remote database pass – password for the remote database protocol – protocol used to connect to remote database, usually TCP host – IP address or hostname of the remote host port – remote …

How to change IP address on CentOS Linux

A few weeks back I needed to change my IP address on a Linux CentOS installed in a VirtualBox machine. Here is how to do it: ifconfig eth0 192.168.0.34 ifconfig eth0 netmask 255.255.255.0 Sources: http://www.tecmint.com/ifconfig-command-examples/ http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox

How to get your MAC address in Windows 7

I needed to get mine today, the command is very simple and needs to be executed in a cmd window. Here is how to get the MAC address with the name of the adapter. C:Usershecperez>getmac -v You will see something like this: