Posts

A simple and easy Spark standalone program for beginners.

A simple and easy Spark standalone program for beginners....

Courtsey: Hariprasad Bhaskaran


Aim :
To demonstrate writing a simple spark scala program
use sbt to build it
create dependencies for spark-core and spark-sql in build.sbt
create a final jar that can be submitted using spark-submit...


Program code below:


MyAdd2.scala
=================

import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
import org.apache.spark.sql._
import org.apache.spark.sql.hive.HiveContext
import org.apache.spark.sql.hive._
import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.SQLContext._


object MyAdd2
{

def main(args: Array[String] )
{

val conf = new SparkConf().setAppName("t1").setMaster("local")
val sc2 = new SparkContext(conf)
val sqlContext = new org.apache.spark.sql.hive.HiveContext(sc2)

import sqlContext.implicits._

val mylist = sc2.parallelize(List( 1 ,2,3,4,5,6,7,8,9,100) )
val mylistDF = mylist.map( x => (x,1) ).toDF("vals","…

Converting OVA file to VMX file

Ever downloaded OVA files and found that your virtualization player refuses to open it , then you should use this simple utility called OVF Tool.

for example , if u want convert ova type file to vmware file , 
u can use a command like this

Step 1:
download ovftool from here

http://communities.vmware.com/community/vmtn/automationtools/ovf


step 2:
Since this is a command line tool , after installation , go to the
installation directory and type ovftool

if command is recognized , then ovftool works



step 3: conversion

u can use the ovftool like this as shown below

assuming
srcfile.ova - is source file , which is in ova format
destfile_name.vmx - is destination file , which should be in vmx format


usage :

ovftool srcfile.ova destfile_name.vmx




My Old Garage Stuff!!

Just found my old web site , where i posted my earlier hobby projects... going to compile them all.


1.http://harisoft.net.tf/index_files/Page597.htm

 this website contains old C programs , some games written by me in C are also there.
Also basic Java , RMI are there..-- All old stuff though!
Winrouter restarter software is also there!!


2. http://hartella.sourceforge.net/

HarTella is a Gnutella V0.6 Client  that i have created , it has around 20K lines and is created from scratches, it works well and users can use it connect to Gnutella network and download/share files.


How to upgrade Huawei WA1003A to a Feature Rich Firmware

Image
I am one of those guys who still have the Huaweii WA1003a Router provided by BSNL and its still working perfectly (guess a solid build) , but its nearly 7 years passed and  no new firmware update was provided , on asking for newer version of firmware in huawei forums... the reply was shocking as one of Huawei staff replied "Sorry , Quidway 1003A is a terminal product not a DATACOM router."(Source: http://forum.huawei.com/jive4/thread.jspa?threadID=319714&tstart=1&orderStr=9).
Ok, Finally i decided to put Third party Feature Rich firmware called  RouterTech Firmware
The upgrade process is a little difficult , but people who have knowledge of linux commands should handle this fairly easily. THIS UPGRADE PROCESS IS NOT FOR NOVICES AND ANY MISTAKES MAY BRICK THE ROUTER AND MAKE IT USELESS.

ALSO , MAKE SURE YOU HAVE ACCESS TO OTHER  MEANS OF INTERNET CONNECTION LIKE MOBILE GPRS / 3G AVAILABLE  IN THE EVENT OF YOU BRICKING THE ROUTER... YOU CAN USE  READ THE UNBRICKING PROCED…

HP WebOS is being made Open Source

WebOS is based on linux and is used HP Built mobiles like palm pixi , HP Veer etc.. the pros of it are really good UI (gesture control) and now HP decided to make it Open source , i think it sure will become a good competitor to Android OS as more and more hackers and developers collobrate for development of this solid mobile OS.

a Trick to download up to 120 GB per month in Bsnl BBG FN Combo 500 plan

This trick will only be applicable for BSNL  BBG FN Combo 500 plan which has unlimited downloading from 2 AM to 8 AM




Here is a quick summary of this plan .

Monthly charge : Rs. 500
Speed: 256 Kbps to 2Mbps
Limits: 2.5 GB free usage
Night Unlimited: from 2 am to 8 am
Extra charge if traffic exceeds imposed limits: 20 paise per MB
Minimum hire period: 1 month



How much can i download per month using this trick ?


Free usage Time :  2 am ~ 8 am  ==>  6 hours of free download time.


speed = 2 Mbps 


 How much can i download in a day using free download = 2 Mbps * 6 hours


= 2 * 1048576  * 6 * 60 * 60 bits
= 45298483200 bits
=5662310400 bytes
=5529600 KB
=5400 MB
=5.2 GB



but 5.2 GB seems only theoritical , i have friends who have reported up to 4-4.5 GB / day using this technique.




How much can one download in a month ?


 Assumming  daily download  to be 4 GB /day and 30 days / month


 it will come to 4 GB * 30 = 120 GB ( ghosh! , better get a new hard disk! )



IS THIS TRICK LEGAL?


   It is perfectly legal and y…

How to search for a file, without using windows search

Image
Here is a way to search for a file in windows without using windows search


Step 1 : Goto command line (Windows key + R ) and type CMD

Step 2: goto root directory by typing cd \

Step 3: To search a file, type

dir /s <file name>

Eg : dir /s winrouter*.*

you can see that it can accept wildcards