Linux – tar tricks

Sometimes I find myself on a unix based system for the first time in awhile and I have to use the tar program to extract data from a tar or tar.gz compressed data set.

Here is a nifty set of helpful tips:

You can also extract files that match a specific pattern. This example shows how to extract files that start with psoft from the tar file psoft.tar regardless of its directory location:

$ tar -xf psoft.tar --wildcards --no-anchored 'psoft*'

To extract all xml files:

$ tar -xf psoft.tar --wildcards --no-anchored '*.xml'

Command Flags:

  • -x: instructs tar to extract files.
  • -f: specifies filename / tarball name.
  • -v: Verbose (show progress while extracting files).
  • -j : filter archive through bzip2, use to decompress .bz2 files.
  • -z: filter archive through gzip, use to decompress .gz files.
  • –wildcards: instructs tar to treat command line arguments as globbing patterns.
  • –no-anchored: informs it that the patterns apply to member names after any / delimiter.

This post was sourced from article: Tar Extract a Single File(s) From a Large Tarball from CyberCiti

 

Oracle SES – Permissions & IB Setup

Well, I have just had my first full exposure to the glory they call Oracle Secure Enterprise Search!  All I can say is damn, that was NOT easy.

The documentation is pretty good that I found, and maybe it is easier on a fresh install but I was doing the setup on an existing environment that I had just upgraded.  The upgrade was for Finance from 8.9 to 9.2.  In the 9.2 application VERITY is no long supported, and the PeopleSoft Search Framework only supports Oracle Secure Enterprise Search (O-SES).  The first trick is to download it from edelivery and in my case I installed the software on my batch processing server.  This install will install a full Oracle database with a webservice that by default runs on port 7777.  There is a bunch of setup that needs to be done to get this working, but the documentation I had for the install was very good for this part.

Some of the next parts I thought were a little difficult to follow, and so the first item is, I used my system start user as my main user, and made sure it had the following roles:

Search Administrator, Search Developer, Search Query Administrator, Search Server

I also have a custom permission list that this user has access to and I made sure that the permission was assigned the search group: PTPORTALREGISTRY.  This appears to be a new security element in the permission lists.

The new Search Framework uses a ton of IB service operations to do all of its work, and one element you need to do is set the Portal Content & Portal URI text fields on the Node for all the local nodes, otherwise the search results will return incorrect content reference paths (extra:  don’t forget the “/” at the end of the URI).

Now, I also inactivated all my integration broker routings for the default local node after the upgrade so no IB would unnecessarily be taking place.  This might have been a bad idea, but old habits are hard to break.  Since O-SES uses the IB for its Search Framework, the following Service Operations need to be active with the routing turned on!

Service: PT_SES – Service Operation: PT_SES_CREF_GET, PT_SES_USERSEC_GET, PT_SES_INIT,

Service: PTSF_META_DATA: Service Operation: PTSF_GET_GROUP_CAT_LBLS, PTSF_GET_SRCH_CAT_DET, PSFT_GET_SRCH_GROUPS

Service: PTSF_SECURITY: Service Operation: PTSF_AUTHENTICATEUSER, PTSF_GETSECATTRVALUES, PTSF_GETUSERROLES, PTSF_POSTPROCESS_FILTER, PTSF_VALIDATESRCHUSER, PTSF_VALIDATEUSERROLE,

Service: PTSF_SES_FEED – Service Operation: PTSF_CRAWLER_CFG, PTSF_SES_CRAWLSTATUS, PTSF_SES_GET_CONTROL_FEED, PTSF_SES_PROCESS_ERRS, PTSF_SES_SCHEDULED_FEED

Service: ADMINSERVICE:  Service Operation: CREATE, CREATEALL, DELETE, DELETEALL, EXPORT, EXPORTALL, GETAPIVERSION, GETSTATE, START, UPDATE, UPDATEALL

Service: PTFP_FEED – Service Operation: PTFP_GETPREPUBFEED  (not 100% sure on this one, but I turned it on along the way).


Make sure you add the PTPORTALREGISTRY to the Home Page Context Type, I added mine and made it default.  I also found that I was getting no returns and then after a day of thinking about things I tried again and everything appeared to be working fine.  I believe that the system was bounced web and app during that time, so if all else fails that might work!


Good Luck!

COBOL – Runtime install fails psauto64

When installing the runtime license for Server Express 5.x, you will most likely encounter an error reporting that psauto64.int is in an unsupported format. This unsupported format error is caused by a failure to read the file from the nfs mounted file system. By explicitly setting the path in the psauto64 (or psauto32) script to a file reference the script will execute correctly.

Simply open the psauto64 or psauto32 script with vi and change the follwing:

From:  $COBDIR/bin/cobrun psauto64.int verbose
To:        $COBDIR/bin/cobrun ./psauto64.int verbose

Happy installing! 🙂

Whats my Product Key

I was moving one of my database servers to a new cloud, and I could not find the product key that I used to install the SQL Server install.  So I did some google action and found a bunch of folks that had little to no clue on how to get the real product code.  I found a dude named Laser on the gearbox software website, that is a genius, and this worked for both my 2008 and 2012 versions of SQL Server.

In the registry I navigated to the key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\100\DTS\Setup] – DigitalProductID, for SQL Server 2012 it will be in the “110” entries, and it might not be actually under this entry, I found it several spots so if you don’t see it there look around a bit.

Now I did find the the 2012 tag was actually the actual 16 2-digit hex values I was looking for where the 2008 tag was 164 2-digit hex values.  In the case of the 164 code, you need to 53rd pair to 69th pair to get your 16 2-digit hex value.

Next you need to take that value and reverse the entry, so for example,

01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16 becomes:  16,15,14,13,12,11,10,09,08,07,06,05,04,03,02,01

Now remove the commas and take your 32 digit code and put it into a Radix 16 to 24 converter, I found a calculator to do it.

Lastly, for Microsoft codes you need to take your results and do one last conversion:

0 ==> B,  1 ==> C,  2 ==> D,  3 ==> F,  4 ==> G,  5 ==> H,  6 ==> J,  7 ==> K,  8 ==> M,

9 ==> P,  A ==> Q,  B ==> R,  C ==> T,  D ==> V,  E ==> W,  F ==> X,  G ==> Y,  H ==> 2,

I ==> 3,  J ==> 4,  K ==> 6,  L ==> 7,  M ==> 8,  N ==> 9

Yep, it sounds crazy, but it works!  To be totally honest, I have never worked with radix based number systems before, and I am not about to start, and honestly, I get freaked out by hex values in the registry, but those codes cost a lot of money, so if you are like me and either forget to write it down because that would be easy, or inherit a system that was installed by somebody that didn’t write it down, this might just save you!