How to compile Apache Zeppelin with Spark 1.6

zeppelinhqdefaultRecently I found Apache Zeppelin, an Apache Incubator project that seems to bring a new paradox into the data science game, and other areas.

Something I’ve really like about Zeppelin is the ease of interaction with spark, I use the spark-shell all the time, but it’s tedious having to re-evaluate commands that I previously inputted, Zeppelin fixes this problem. It let’s me go back and forth across the script that I’m building on spark which is nice.

At time of writing the latest release of Zeppelin is 0.5.6, which comes bundled with Spark 1.4.1 but for reasons I want to use Spark 1.6 so in order to build Zeppelin with Spark 1.6 you are going to have to build it from the source.

1.- Download the latest stable source code from Zeppelin’s download page:

https://zeppelin.incubator.apache.org/download.html

2.- untar

1
tar -zxvf zeppelin-0.5.6-incubating.tgz

3.- compile with support for spark 1.6

1
mvn clean package -Pspark-1.6 -Dspark.version=1.6.0 -Dhadoop.version=2.6.0-cdh5.4.8 -Phadoop-2.6 -Pyarn -Ppyspark -Pvendor-repo -DskipTests

For more information on what other parameters you can tweak, checkout Zepellin’s Readme file

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Solr FieldType class to type

Solr, you are great but we need a list of mappings between your classes and your types to understand everyone’s examples of you.

Here’s a small list I’ve compile for Solr 5.3

 

Class Type
org.apache.solr.schema.TrieLongField
org.apache.solr.schema.TrieDateField tdate
org.apache.solr.schema.BoolField boolean
org.apache.solr.schema.TextField text_general
org.apache.solr.schema.StrField strings

I hope this is useful for everyone landing on this artcile

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

How to fix HBase 0.94.x not starting after downgrade

hbase_logo-470x140After downgrading my HBase installation from HBase 1.1.2 (currently stable at time of writing) to HBase 0.94.27, for purposes of compatibility with Gora I found myself unable to run HBase with multiple errors, after a couple of hours of debugging I found that the solution is to simply delete all the files in the hbase.rootdir which I specified in my hbase-site.xml

so, if your hbase-site.xml looks like this

1
2
3
4
5
6
7
<!--?xml version="1.0"?-->
<!--?xml-stylesheet type="text/xsl" href="configuration.xsl"?-->

hbase.rootdir
file:///home/hbuser/HBASE/hbase
hbase.zookeeper.property.dataDir
/home/hbuser/HBASE/zookeeper

just cd to the previous directory and drop the hbase folder and recreated

1
cd /home/hbuser/HBASE
1
rm -Rf hbase
1
mkdir hbase

after this, just start hbase with start-hbase.sh and eveything should be fine.

 

Related Error Stacks:

1
2
3
org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
java.lang.NullPointerException
at org.apache.hadoop.hbase.util.Bytes.toBytes(Bytes.java:442)
1
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Coda 2 Plugin to autocomplete Angular

coda-iconI love the new Coda 2.5, it has great improvements over the first release of Coda 2 however there is one huge thing that it’s missing and that is more Angular integration.

I think it’d be great if we could have bot syntax and code competition that fits our Angular needs.

So….. I wrote a small plugin that autocompletes the basic angular functions and services, it’s not much but it can get you started, please leave some feedback regarding what do you think I could improve or feel free to collaborate on GitHub.

Downolad from GitHub

VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)

How to duplicate a GlideRecord on ServiceNow

servicenowWhile working on generating thousand of rows to stress my application on ServiceNow I figure a way to duplicate any GlideRecord.

It’s important to note that in my example I’m querying a table and duplicating each record, this method should work with any single GlideRecord.

For the sake of simplicity here’s the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//query the rows we want to copy
var ga = new GlideRecord('cmdb_ci_server');
ga.query();

while (ga.next()) {
    //get all the fields for this record
    var fields = ga.getFields();
    //create a new record
    var gr = new GlideRecord('cmdb_ci_server');
    gr.initialize();
    for (var i = 0; i < fields.size(); i++) {
        var glideElement = fields.get(i);
        //make sure we don't copy the sys_id
        if(glideElement.getName() != 'sys_id')
        {
            gr[key] = ga.getValue(glideElement.getName());                 
        }
    }
    var newSysId = gr.insert();
};
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

org.hibernate.HibernateException: /hibernate.cfg.xml not found in IntelliJ Project

hibernate_logo_aWhile working on a project on IntelliJ I added Hibernate, everything looked great since IntelliJ Idea 13 added the libraries and even allowed me import a schema until I hit run, then I stumble across this problem:

“org.hibernate.HibernateException: /hibernate.cfg.xml not found”

Like, “WHAT?” Wasn’t IntelliJ supposued to configure everything for me? Well, it configured everything up to a nice point but this error was a show stopper, the solution is quite simple and that is to move the hibernate.cfg.xml file to your WEB-INF/classes directory

To fixed I had to do the following.

In your project, in the WEB-INF directory, create a classes folder if it already doesn’t exist.

Look for hibernate.cfg.xml in your Project, it’s usually located at Project > src > main > java and copy it to Project > src > main > webapp > WEB-INF > classes

Hit Run and that’s it.

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

How to delete de DefaultDomain of an Integrated Application Server for Weblogic on OS X

weblogicWow, this has a really long post title.

Basically what I just figured out is how to delete the default domain that is created by the integrated Application Server (weblogic) by Jdeveloper.

Open Terminal.app

1
cd  ~/.jdeveloper/

Here you’ll find various folders, go into the one that resembles systemjdevversion for example

1
cd system12.1.2.0.40.66.68

then delete folder DefaultDomain

1
rm -Rf DefaultDomain

After this just restart jdeveloper and you can create a default domain again.

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

True meaning of blog

It’s been a while since I’ve added a post to my blog, I though I’d just add this quick note just to add the feel of new post to the main page.

When I decided to start a blog I realized that I could simply share with the world what I learn, of course not everything I learn, but the things that I learn that google couldn’t solve with a simple search, most knowledge is arcane, if you could see my notes you’d be surprised how much tweaks and work arounds I figure. For this 2014 I’ll try to share more of my findings on this website.

Hope something is reading out there.

Huh, the internet, such majestic creature.

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Search for a song and play it with Alfred 2.0 for free

logoAlfred 2.0 just came out and personally I found it’s an amazing app, I’m still a huge fan of Butler but let’s face it, Manytricks hasn’t updated the software in a very long time and the users (at least me) are hungry for new features.

Alfred 2.0 delivers a lot of fetures, among them the chance to create your own workflows with many scripting languages likes bash, php and ruby among others.

So I had the need of searching a song in my iTunes library, that simple right? no! while Butler did that just out of the box, with Alfred 2.0 you need to buy the PowerPack which is 15 pounds (around $20 dollars) and still, when you look for a song using the mini-player, which you have to activate with a different set of keys or commands, the song you played will play once and then plain silence will be heard, that kinds of anoys me as I’m always expecting the music to keep player.

To solve this issue I made a really simple and fast workflow that allows you to look for songs on your iTunes Library, I don’t know if it could work without the power pack so I’ll post both, the one I’m sure that works with the powerpack of Alfred and the slower version that works with iTunes and applescript.

Hope it’s useful to you.

iTunes Search and Play (to use with PowerPack)

iTunes Search and Play (to use without powerpack)

VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)

Getting all the months in the current Fiscal Year with a Query on Oracle

logo_oracleI usually like to do everything dinamically, so I wanted to figure out the current set of months for the current fiscal year on Oracle DB using a simple query, from everyone’s favorite table dual.

So here’s there query:

1
2
3
4
5
6
7
8
9
10
11
12
SELECT TO_CHAR(add_months(TRUNC(SYSDATE, 'mm'),
              DECODE(EXTRACT(MONTH FROM SYSDATE),
              1,-7,
              2,-7,
              3,-7,
              4,-7,
              5,-7,
              6,5,
              5) - EXTRACT(MONTH FROM SYSDATE)+level),
              'Mon-yy')
FROM dual
CONNECT BY level <= 12;

This will output the following (SYSDATE at the time of writing is 03/07/13 “mm/dd/yy”)

Jun-12
Jul-12
Aug-12
Sep-12
Oct-12
Nov-12
Dec-12
Jan-13
Feb-13
Mar-13
Apr-13
May-13

 

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

I just moved everything to wordpress so everything is broken