The ArtOfBI.com Newsletter

Is stupid new and freshly informative on BI and EPM.

Save one little gremlin by not pouring water on its head.

Or, sign up for killer tips, tricks and other BI / EPM goodness delivered right to your inbox.

Hell just do both. Enter your email below.

Oh no what happened?
I already signed up.

BTW, Signing up gets rid of this annoying banner.

Cheers,
Christian & The ArtOfBi.com Team

Art of Business Intelligence > Business Intelligencetitle_li=Linux

Archive | Linux

Removing ^M From Linux Files

I was at a project recently where someone had updated several Linux config/text files using a Windows machine.
They FTP‘d the files to their desktop, used notepad or something similar to make the edits, and then FTP’d the file back to the Linux server thinking that all would work swimmingly. Unfortunately they overwrote the original files when they uploaded the files back to the Linux server.

Tux, the Linux penguin

Image via Wikipedia

As you know when this happens, Linux can recognize these foreign line breaks and places a nasty ^M at the end of each break as it interprets it as an actual character. This renders most config files, especially a XML based config file, useless for parsing by the program trying to read the file.

The solution is regular expression based and looks kinda funky but it works.

Basically open the file in question using the VI editor. Hit the colon command to start the menu input and enter the expression below against the file.

:%s/[ctrlkey+v and ctrl-key+M]//g

which will give you

:%s/^V^M//g

References

  • http://thedaneshproject.com/posts/how-to-remove-m-character-with-vi/
Enhanced by Zemanta

Posted in Business Intelligence, LinuxComments (1)

Obsfucating or Preventing Decompiling of Your Java Code

So, when creating a non open source Java application or library where you do not want the uncompiled code assessable, there seems to only be one way to truly achieve this.  That is through obsfucating your code at compile time. Preferably this is done using an obfuscation tool and integrating it into the ANT build process (build.xml). There are a few pay, free, and open-source solutions that will help a developer accomplish this.

I wanted to focus on the free/OSS solution for this and since NetBeans is my Java IDE of choice I stayed close to that combined solution.  What I found was that the main solutions to obsfucate are proguard, yGuard, and RetroGuard.

I like the idea of going with the open-source concept of proguard (or some mod) as this seems like what a lot of vendors such as Oracle are using within several of their applications/tools.

There are a few tutorials such as this one from Geertjan at Oracle a few years back.  Clearly, if Oracle is pushing this strategy it is probably a good way to go.  Check the comments on that blog post to see that some people have even attempted to use deobfsfucator/decompilers tools such as JD to no avail.  I like it!

References:

Posted in Business Intelligence, Linux, NetBeansComments (2)

OBI 11g SampleApp v107 VirtualBox – Host Shared Folders Mount

The new Oracle BI 11g Sample is amazing and has a lot of features.  It is quite perfect for a sandbox testing environment (with the main exception being that the Admin Tool is still MS Windows-based and not available in this Linux OS VM Image).

One question that gets passed around quite a bit is how to transfer files between the SampleApp VM Image guest (VirtualBox VM Image OS) and the host machine (Your laptop or workstation main OS).  There are really only two core answers to this.

  1. FTP
  2. Shared Folders

FTP

The file transfer protocol is nothing new to you I am sure.  However, what can be confusing is the virtual FTP’ing of files basically within your same machine, i.e.: your host machine to your guest VM Image (all from the same machine if testing on your laptop or local workstation).  To achieve this you need to set your VirtualBox VMImage (or VMWare image is you are clever enough to convert the base SampleApp VM Image) Network Adapter to one that can communicate with the host OS.  My favorite is just to used the “Bridged” network adapter configuration from my home office as I have a DHCP router which will automatically assign my VM Image OS an IP on my LAN.   After restarted the VM Image to take the network adapter configuration, run an /sbin/ifconfig -a from the terminal window to show the IP address that was assigned to the virtual machine. Got it? Good!

Now from your host OS, open up your favorite FTP client and FTP to that IP address.  You can use the oracle/oracle credentials or the root/oracle credentials.  Be sure to list port 22 not port 21. You should be able to connect with no problem as by default the folks at Oracle have disabled the firewall and SELinux on the SampleApp VM Image.  Once connected, you can transfer files as you normally would from your local machine to any other remote server; it’s just all virtual now. Sweet!

Shared Folders

The other option is a bit more complex when running a Linux OS as the VM Image guest machine but the ability to have a local reference to the host OS’s folder/directory of your choosing can be very beneficial.   Unlike a MS Windows guest OS, which if using Shared Folders will automatically assign a driver letter, etc. to the shared folders, the Linux OS, which is what we are dealing with for the SampleApp VM Image requires a “mount”.  That’s right, you still have to break out your Linux command-line expertise and run the “mount” command after using the VirtualBox Shared Folder settings (Devices > Shared Folders…).

Fortunately the VirtualBox documentation provides a great step-by-step section to walk you through creating the mount.  This was quite handy since the mount requires a file-system type reference specific to VirtualBox.

One thing I did notice though was that after the mount of the shared folder to local folder that I instantiated, the mount folder ultimately ended up in the /media/ folder with a prefix of “sf_”.  I thought this strange but really didn’t care too much as long as I could get at the data transfer files and location I need I was happy.

References:

http://www.virtualbox.org/manual/ch04.html#sharedfolders

Posted in 11g, Business Intelligence, Linux, OBIEEComments (2)

My name is Christian Screen, a Business Intelligence mastermind working with mainly Oracle and Microsoft technologies. The views expressed here are my own and do not reflect the views of Oracle, Microsoft, or my employer. RSS