Skip to content

Instantly share code, notes, and snippets.

View cjjavellana's full-sized avatar

Christian Javellana cjjavellana

View GitHub Profile
@cjjavellana
cjjavellana / yum_pip_install_cache.txt
Created June 2, 2018 09:11
Yum, PIP installation from Cache
## Installing Yum dependencies from cache
$ yum install -y package -C
## Building Wheel Packages for Offline Installation
$ pip wheel --wheel-dir=/tmp/SomePackage SomePackage
## Installating Wheel Packages from Cache
$ pip install --no-index --find-links=/tmp/SomePackage SomePackage
## Miscellaneous
[root@rhel7-demo ~]# subscription-manager repos --enable=rhel-7-server-rpms
Repository 'rhel-7-server-rpms' is enabled for this system.
[root@rhel7-demo ~]# subscription-manager repos --enable=rhel-7-server-extras-rpms
Repository 'rhel-7-server-extras-rpms' is enabled for this system.
[root@rhel7-demo ~]# subscription-manager repos --enable=rhel-7-server-optional-rpms
Repository 'rhel-7-server-optional-rpms' is enabled for this system.
[root@rhel7-demo ~]# vi /etc/yum.conf
[root@rhel7-demo ~]# yum install docker device-mapper-libs device-mapper-event-libs
Failed to set locale, defaulting to C
Loaded plugins: product-id, search-disabled-repos, subscription-manager
import java.util
import java.util.Calendar
import com.cjavellana.beans.SimpleObject
import net.spy.memcached.{AddrUtil, BinaryConnectionFactory, MemcachedClient}
import org.apache.ignite.Ignition
import org.apache.ignite.cache.CacheMode
import org.apache.ignite.configuration.{CacheConfiguration, IgniteConfiguration}
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder
@cjjavellana
cjjavellana / iptables
Last active April 10, 2016 01:34
IP table configuration of my utility server
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
@cjjavellana
cjjavellana / gist:fdd7a24b20157cbecbc9
Last active April 20, 2016 16:10
Anything hadoop

Download Serde jar from here

https://github.com/downloads/IllyaYalovyy/csv-serde/csv-serde-0.9.1.jar

Create table in hive (with optionally enclosed by quotes data)

hive> add jar /opt/hive-2.0.0/testdata/csv-serde-0.9.1.jar
hive> create external table employee (userid int, date_added date, name string, last_name string) row format serde 'com.bizo.hive.serde.csv.CSVSerde' with serdeproperties ("separatorChar"=",","quoteChar"=""") stored as textfile;

Hive is not allowed to impersonate

Change hive.server2.enable.doAs to false in hive-site.xml

@cjjavellana
cjjavellana / gist:bfc3559d3aefa7e753af
Last active January 30, 2016 21:35
Installing Jdk 8 & GitBucket
# To Install Oracle JDK 1.8
# cd /opt/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u72-b15/jdk-8u72-linux-x64.tar.gz"
# tar xzf jdk-8u72-linux-x64.tar.gz
# To Install GitBucket
# wget https://github.com/gitbucket/gitbucket/releases/download/3.11/gitbucket.war
# Start Gitbucket
@cjjavellana
cjjavellana / Jms.scala
Last active August 29, 2016 08:59
Scala Akka Camel Weblogic JMS Sample
import java.util.Properties
import org.apache.camel.component.jms.{ JmsComponent, JmsConfiguration }
import org.springframework.jms.support.destination.JndiDestinationResolver
import org.springframework.jndi.{ JndiObjectFactoryBean, JndiTemplate }
import akka.actor.{ ActorSystem, Props }
import akka.camel.CamelExtension
@cjjavellana
cjjavellana / gist:9694d37d520175e10534
Created December 20, 2015 08:33
Destroy, re-initialize and seed a mysql database in docker container
#!/bin/sh
# check if there is a running db instance
running_db_instance=`docker ps | grep weaveposbackend_db | wc -l`
if [ $running_db_instance -gt "0" ]
then
instance_name=`docker ps | grep weaveposbackend_db | awk '{print $12}'`
echo "Stopping db instance $instance_name"
@cjjavellana
cjjavellana / create_r54_subdomain.rb
Last active December 20, 2015 08:34
Create Route 53 Subdomain
def create_r53subdomain
begin
r53client = Aws::Route53::Client.new
resp = r53client.change_resource_record_sets({
hosted_zone_id: "<hosted zone id>",
change_batch: {
comment: "Create subdomain",
changes: [
{
action: "CREATE",
# Creating docker machine for dev environment
$ docker-machine create --driver virtualbox dev
# Lists all docker machines
$ docker-machine ls
# See how to connect to dev docker machine
$ docker-machine env dev
# Configure shell to connect to docker machine