Friday, December 8, 2017

Kong Installation

The following instruction is for CentOS7 only

Install Kong

rpm -ivh https://bintray.com/kong/kong-community-edition-rpm/download_file?file_path=dists/kong-community-edition-0.11.1.el7.noarch.rpm
yum install epel-release
yum install kong-community-edition

Install & prepare Database

Kong needs a database and supports both PostgreSQL 9.4+ and Cassandra 3.x.x as its datastore. In our POC we have tested it with Postgres 9.6
yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install postgresql96-server.x86_64
yum install postgresql96
/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl enable postgresql-9.6
systemctl start postgresql-9.6

su - postgres
psql
CREATE USER kong; CREATE DATABASE kong OWNER kong;
Now, run the Kong migrations:
sudo kong migrations up [-c /path/to/kong.conf]

Run Kong on port 80 for HTTP

Edit /etc/kong/kong.conf Change: proxy_listen = 0.0.0.0:8000 To: proxy_listen = 0.0.0.0:80
sed -i "s/proxy_listen = 0.0.0.0:8000/proxy_listen = 0.0.0.0:80/" /etc/kong/kong.conf

Start Kong

kong start

Increase nofile

Default file descriptor in CentOS7 is set to 1024, to increase this value for more connections to Kong:
cat >>  etc/security/limits.conf < EOF
*       soft    nofile  32767
*       hard    nofile  32767
EOF

Friday, November 10, 2017

JupyterHub & Spark Setup

Install Java

Java is required to run pyspark

Docker

Docker container is on Debian jessie, jessie-backports needs to be added for OpenJDK
echo "deb http://cdn-fastly.deb.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
apt-get update -y
Please note the -t jessie-backports option
apt-get install -t jessie-backports openjdk-8-jdk -y

Download & Install Spark

download spark 2.2.0 pre-built for hadoop 2.7 [https://www.apache.org/dyn/closer.lua/spark/spark-2.2.0/spark-2.2.0-bin-hadoop2.7.tgz] untar spark distribution under /opt/spark

Configure Spark

configure the following environment variables in /opt/spark/conf/spark-env.sh For example:
SPARK_LOCAL_IP=192.168.1.11
SPARK_WORKER_MEMORY=4g
SPARK_WORKER_CORES=2
Make the default spark rdd directory group writable
mkdir -p /var/lib/spark/rdd
chown -R spark: spark
chmod g+w -R spark

chmod group read/writable on a deep sub-directory under home

On rare cases where you need to provide group read and writable access from a multi-level sub-directory under your home, not that it's recommended from security perspective.  Note when making your home directory readable by group you will have problem with passwordless ssh.

cd ; p="/home/runwuf/project/test/p1/runwuf" ; while [ $p != "/home"  ] ; do chmod g+rw $p ; p=`echo $p | rev | cut -f2- -d"/" | rev` ; done

Wednesday, February 25, 2015

transfer photos from iphone to linux

here's a simple command to grab all photos off the iphone (tested on 4s) to linux.
apt-get install gphoto2
gphoto2 --auto-detect -P -R

Saturday, January 25, 2014

Google Earth on Ubuntu 13.10

Google Earth requires ia32-libs, you'll see the following message when install Google Earth on Ubuntu 13.10:

dpkg -i google-earth-stable_current_amd64.deb

 google-earth-stable depends on ia32-libs; however:
  Package ia32-libs is not installed.

ia32-libs on 13.10 has been replaced by 3 separate packages as the following:

apt-get install ia32-libs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However, the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

if you attempt to install google earth package again it would still complain missing ia32-libs, you can use the ignore-depends option to bypass this:
dpkg -i --ignore-depends=ia32-libs google-earth-stable_current_amd64.deb

you may need to run the following to correct some other missing packages:
apt-get install -f

In short, just copy & paste the following:
apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 ; \
dpkg -i --ignore-depends=ia32-libs google-earth-stable_current_amd64.deb ; \
apt-get install -f -y

Sunday, December 22, 2013

k9copy on Ubuntu 13.10


k9copy is no longer available after Ubuntu 12.10, simply because the author does not believe in Linux anymore due to the war between different desktop & distro :-(
http://k9copy.sourceforge.net/web/index.php/en/nouveautes/12-theend
Thank you Jean-Michel for this wonderful program!

If you want to use k9copy, you can use the deb from 12.10:
64-bit:
sudo wget http://launchpadlibrarian.net/103736674/k9copy_2.3.8-3_amd64.deb

32-bit:
sudo wget http://launchpadlibrarian.net/103714201/k9copy_2.3.8-3_i386.deb

sudo apt-get -f install

Enjoy!

Friday, December 20, 2013

Picasa for Linux

Picasa for Linux was no longer supported by Google since years ago, I'm sure there are still a few people on Linux using it but they don't even provide the download files for the older version anymore. 

You can find them here:
http://packages.linuxmint.com/pool/import/p/picasa/

If the above link is no longer available, try google for the following files:
picasa_3.0.5724-01_amd64.deb2008-Oct-27 12:21:3929.7Mapplication/x-debian-package
picasa_3.0.5724-01_i386.deb2008-Oct-27 12:20:1229.8Mapplication/x-debian-package
picasa_3.0.5744-02_amd64.deb2011-Jan-24 08:59:3330.3Mapplication/x-debian-package
picasa_3.0.5744-02_i386.deb2011-Jan-24 09:00:1630.3Mapplication/x-debian-package