Browsed by
Category: Programming Notes

[Ubuntu] Install Spark1.6.0 on Ubuntu 14.04

[Ubuntu] Install Spark1.6.0 on Ubuntu 14.04

What is Spark?

Apache Spark is a fast and general-purpose cluster computing system. It provides high-level APIs in Java, Scala, Python and R, and an optimized engine that supports general execution graphs. It also supports a rich set of higher-level tools including Spark SQL for SQL and structured data processing, MLlib for machine learning, GraphX for graph processing, and Spark Streaming.

You can download Spark from here, or follow the below command to download and install Spark1.6.0.

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Ubuntu] Install chef-server, chef management console on Ubuntu 14.04

[Ubuntu] Install chef-server, chef management console on Ubuntu 14.04

What is Chef?

Chef is a systems and cloud infrastructure automation framework that makes it easy to deploy servers and applications to any physical, virtual, or cloud location, no matter the size of the infrastructure. Each organization is comprised of one (or more) workstations, a single server, and every node that will be configured and maintained by the chef-client. Cookbooks (and recipes) are used to tell the chef-client how each node in your organization should be configured. The chef-client (which is installed on every node) does the actual configuration.

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Linux] Install PostgreSQL 9.4 on CentOS 7

[Linux] Install PostgreSQL 9.4 on CentOS 7

postgresql-logo

About
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows.

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Java] Install/uninstall Oracle/Open JDK, Maven, Ant, Tomcat on Ubuntu14.04

[Java] Install/uninstall Oracle/Open JDK, Maven, Ant, Tomcat on Ubuntu14.04

I used the following command to install Java tools on Ubuntu14.04 , and it also works for old Ubuntu version.

Install Oracle JDK6, JDK7, JDK8

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer

or

$ sudo apt-get install oracle-java7-installer

or 

$ sudo apt-get install oracle-java8-installer

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Java] Create a Simple Report by Jaspersoft Studio 6.1

[Java] Create a Simple Report by Jaspersoft Studio 6.1

Jaspersoft Studio is an Eclipse-based report designer for JasperReports Library and JasperReports Server; it’s available as an Eclipse plug-in or as a stand-alone application. Jaspersoft Studio allows you to create sophisticated layouts containing charts, images, subreports, crosstabs, and more. You can access your data through a variety of sources including JDBC, TableModels, JavaBeans, XML, Hibernate, Big Data (such as Hive), CSV, XML/A, as well as custom sources, then publish your reports as PDF, RTF, XML, XLS, CSV, HTML, XHTML, text, DOCX, or OpenOffice. But my focus is on how to create a simple report and simple code.

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Linux] The command lines for network setting

[Linux] The command lines for network setting

1. IP and Subnet Mask setting

  • Assign IPv4 addresses to Network Interface
    $ ifconfig *interface* *IPv4 address*
    
    e.g:
    $ ifconfig eth0 192.168.10.91
    
  • Assign IPv6 address to Network Interface
    $ ifconfig *interface* inet6 add *IPv6 6Address*/*IPv6 Prefix Length*
    
    e.g: 
    $ ifconfig eth0 inet6 add 2001:b030:7015:ff01::1/64
    
  • Assign a IPv4 Subnet Mask to Network Interface
    $ ifconfig *interface* netmask *IPv4 Subnet Mask"
    
    e.g: 
    $ ifconfig eth0 netmask 255.255.255.0
    
  • 2. default gateway setting:
  • Assign IPv4 Gateway to Network Interface
    $ route add default gw *IPv4 Gateway* *interface*
    
    e.g:
    $ route add default gw 192.168.10.254 eth0
    
  • Assign IPv6 gateway
    $ route -A inet6 add default gw *IPv6 gateway*
    
    e.g: 
    $ route -A inet6 add default gw 2001:b030:7015:ff01::ffff
    
  • DNS setting:
    $ vim /etc/resolv.conf
    
    nameserver *ip adress*
    
    e.g:
    nameserver 8.8.8.8
    
Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Java] Using Jackson and Jersey to parse a JSON file to an List

[Java] Using Jackson and Jersey to parse a JSON file to an List

This example will show you how to convert a JSON file into a JSON String, then parse it to ArrayList. Assuming I hava a timeZoneList.json file:

[
  {
    "zoneID": "Pacific/Kwajalein",
    "offset": -12,
    "zoneName": "(GMT -12:00) Eniwetok, Kwajalein"
  },
  {
    "zoneID": "Pacific/Midway",
    "offset": -11,
    "zoneName": "(GMT -11:00) Midway Island, Samoa"
  },
  {
    "zoneID": "US/Hawaii",
    "offset": -10,
    "zoneName": "(GMT -10:00) Hawaii"
  },
  .....(more timezone objects)
]

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail
[Ubuntu] Using Amazon RDS with WordPress

[Ubuntu] Using Amazon RDS with WordPress

In order to improve efficiency and elasticity of EC2 instance, we need to use a database that is installed on a separate machine. A good solution is using AWS RDS. Before we create a database RDS instance, we need to make a dump of the existing database on our WordPress server.

In the following, I will list these instructions.

Read More Read More

Facebooktwittergoogle_plusredditpinterestlinkedinmail