January 9, 2017

Stopping PI channels thrugh queries

During a migration of one PO system we had to stop all PO channels when the App was still not installed because at the time of the App installed we wanted to be on the safe zone without any risk of channels getting started automatically.

We used following queries:

December 19, 2016

Edimax BR-6428ns v2: Unbrick after bad firmware

If you like me bricked your Edimax BR-6428ns V2 while upgrading it to its latest firmware the steps to unbrick this router are:

September 14, 2016

Deleting network profiles on Windows 10

The only way I found to delete network profiles from Windows is directly from the registry on path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\Profiles:

September 6, 2016

Testing SFAPI credentials

Useful tool directly from SSFF to validate credentials:

https://sfapitoolsflms.hana.ondemand.com/SFIntegration/sfapitools.jsp

September 5, 2016

Updating jobs owners, creators and step users in tables TBTCO and TBTCP

In many projects I have been requested at some stage to update all jobs to use the proper batch user, and in some particular cases the clients decided that they wanted the owner and creator of the job to be updated too.

I have designed below queries to accomplish such task directly on TBTCO and TBTCP tables:


August 11, 2016

SAP Code Page

SAP has different number to indicate character encoding for UTF-8 and UTF-16. SAP call it code page number. UTF-8 is using number 4110 and UTF-16 is using number 4102.
*Note: 4103, 4104 and 4105 also are Unicode code page, you can see it in table "TCP00".

For example:
If we want to export an Excel file by using "GUI_DOWNLOAD" with encoding "UTF-16", then at the Exporting parameter "CODEPAGE", pass the value "4102" then the file will be export with UTF-16 encoding.

May 12, 2016

SAP Java Applications - No connection to data source * available. All * pooled connections are in use and * connection requests are currently waiting


A client developing custom Java applications faced the following error while testing one of their apps:



[EXCEPTION]
 com.sap.sql.log.OpenSQLException: No connection to data source SAPSIDDB available. All 50 pooled connections are in use and 7 connection requests are currently waiting. The connection pool size might need to be adjusted.


April 4, 2016

List of important Transaction codes to create IDocs

Transaction code
Function
WE30 Used to create the Basic Idoc type
WE20 For creating partner profile
WE81 To create message type
WE82 Used to associate the message type and the idoc type
WE21 To create the port
SM59 To give the name of the logical destination
WE41 To create Outbound Process Code
WE02 To check the status of IDOC
WE05 To check the status of IDOC
WE42 To create Inbound Process Code
BD51 To define the function module characteristics 



Source: wiki.scn.sap.com

March 1, 2016

Scripts to check SQL connection strings


 Some powershell functions I wrote to test SQL Connection strings:


Describing a table in Microsoft SQL

If you would be using Oracle the easiest way to obtain the definition/description of a table is using the "descr [tablename]" SQL command.

However in microsoft such command does not exist, the most similar to Oracle's descr is the stored procedure sp_help, and you can call it as "sp_help [tablename]" or "exec sp_help [tablename]" while using Microsoft SQL Server Studio, and the output you should obtain will be similar to this:

February 5, 2016

SAP SUM does not launch due to java policy access denied errors

When running SUM application sometimes you could face the following error when trying to execute the application theough the browser:



Just click on details and you will find the most common problem is access denied due to java policy problems:


The solution consists in modifying the java.policy file located in C:\Program Files\Java\jre7\lib\security and/or the user profile folder by adding a line allowing the class that is getting denied:



Once you save the file just try to execute the JNLP again theough the browser and it should work.

January 25, 2016

The adventures of moving to windows 10: Cannot configure it to never sleep.

One of the firsts problems I faced with windows 10 was that no matter what power plan configuration I use it always goes to sleep after two minutes (even after changing the sleep timing to never).

The solution was quite easy, it was just modifying the registry as follows and then adjusting the new option that appears on the power plan.

December 1, 2015

OpenNebula in a server with two network interfaces. Organizing the traffic with iproute2

During the installation of OpenNebula in our sandbox server we decided that it would be proper to split the traffic between the two network interfaces, one for administration, and one for the VMs traffic to the physical network.

There are many ways of handling the traffic, but for our convenience we decided to use the iproute2 routes and rules.


Exporting a list with details of the volumes of a server/computer in xml format to replicate the volumes in other machine

We were doing a massive datacenter migration, and it included lots of databases (And the respective applications).
As the approach we used was migration the C drive using a migration tool, and then restoring the datafiles to the new servers, we had to create all the mountpoints manually. Doing the preparation of the mountpoints manually would be totally crazy (As we have more than 150 databases, and some of them have up to 40 datafiles), I created the following script that generates some XMLs, and a report with the necessary information and instructions to automate the preparation of the disks.

Make PowerGUI 3.0 work with CLRVersion 4.0*

To force PowerGUI to run for .NET v4.0 place a configuration file called ScriptEditor.exe.config in the installation directory with these contents: By default, PowerGUI is intended to be used with Microsoft PowerShell 2.0. To work with Microsoft PowerShell 3.0 for testing purposes, run the following command-lines for PowerGUI Administrative Console and PowerGUI Script Editor:
AdminConsole.exe –version 3.0 ScriptEditor.exe –version 3.0


More info: http://powergui.org/servlet/KbServlet/download/4041-102-6400/PowerGUI_3.5_UserGuide.pdf

Changing the default shell in Linux (More specifically, Debian)

It always happens to me that after I install a new server I create my non-root user and I cannot remember the command to change the default shell of my user.

So, just as a self reminder, the command to change the default shell is chsh -s

Example:

chsh -s /bin/bash
The second, and more aggressive option is to change the default shell for further user creations by changing the default config file. For this we have to modify the /etc/default/useradd file by changing the SHELL variable with the shell we want to be default, for example:
... SHELL=/bin/bash ...

References:

Disabling SSH password authentication for a user

We decided that for our servers it would be a good idea to disable SSH password authentication for the root user and only permit PGP keys authentication, as we store the keys to login with the root user in a GnuK token in case of emergency.

The story is pretty short, it requires to simply create a match rule in the /etc/ssh/sshd_config file:

Match User root PasswordAuthentication no
There is always a second (And better option if you have many users using PGP keys as the authentication method), creating a rule for a group:
Match Group SSHNoPwdAuth PasswordAuthentication no

November 30, 2015

Compiling and flashing GnuK binaries to the FST-01 using ST-LINK/V2 clone with OPENOCD manually or with the scripts provided in the gnuk repository

It has been two months since I bought the FST-01 to store my GPG private keys, basically to test it, and also because I like the idea of storing the private keys in a separate device (I had some experience implementing smartcards for dual factor authentication, but never before with GPG certificates, so it is good to start testing how it works).

Well, basically what happened is that as soon as I bought it started trying to write certificates into it, and the tests were successful, till I tried to delete them to write the real certificates. I found that with the binary that was wrote on my FST-01 it was not possible to delete the certificates, and after tried many things I also locked it, so I bought also a ST-LINK/V2 clone interface to flash it and start from scratch (I have a bus pirate also, but I was looking around for 1 month on how to flash using SWD with it and I found one or two posts about that but as I simple gave up as it was too complex).

I thought that with the ST-LINK/V2 the story was going to be different but... not that far as I was reading several posts for more than a week about how to use it specifically to flash the FST-01, and I found no clear articles about that, so I will try to summarize how I did it myself.

Problems with Java lincenses during system copy

When copying java SAP systems using the standard tools we had two issues with the old licenses stored on the system:

  1. Temp licence cannot be installed as the system was already provided with an installation number: