Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
echo install jdk1.8
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.rpm
yum localinstall jdk-8u144-linux-x64.rpm -y
touch /etc/profile.d/java.sh
export JAVA_HOME='/usr/java/jdk1.8.0_144'
cat <<EOT > /etc/profile.d/java.sh
export JAVA_HOME="$JAVA_HOME"
export JAVA_PATH="$JAVA_HOME"
export PATH="$PATH:$JAVA_HOME"
#! /bin/bash
echo Download the Elastic PGP key
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
elastic_repo=/etc/yum.repos.d/elastic_stack.repo
touch $elastic_repo
cat <<EOT > $elastic_repo
[elastic-5.x]
name=Elasticsearch repository for 5.x packages
baseurl=https://artifacts.elastic.co/packages/5.x/yum
@yonglai
yonglai / bookmanager.py
Last active June 3, 2017 14:02
Example python regex usage on e-book management
import os
from sets import Set
import shutil
import re
duplicates = []
folder = '/vagrant/books/unorganized'
totalNumOfFiles = 0
numOfDupFiles = 0
numOfNonDupFiles = 0
#! /bin/bash
echo download scala
wget http://downloads.typesafe.com/scala/2.12.2/scala-2.12.2.tgz
tar xvf scala-2.12.2.tgz
mv scala-2.12.2 /usr/lib
ln -s /usr/lib/scala-2.12.2 /usr/lib/scala
export PATH=$PATH:/usr/lib/scala/bin
scala -version
echo download spark
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-16.04"
config.ssh.forward_agent = true
config.vm.network "forwarded_port", guest: 4444, host: 4444
config.vm.provision 'setup', type: 'shell', path: 'headless_selenium_sever_setup.sh'
end
@yonglai
yonglai / headless_selenium_server_setup.sh
Created May 22, 2017 21:59
script to set up headless selenium in Ubuntu
#!/bin/sh
set -e
if [ -e /.installed ]; then
echo 'Already installed.'
else
echo ''
echo 'INSTALLING'
echo '----------'
#! /bin/bash
echo create bpm.service
touch /etc/systemd/system/bpm.service
chmod 644 /etc/systemd/system/bpm.service
cat <<EOT >> /etc/systemd/system/bpm.service
[Unit]
Description=Tibco ActiveMatrix BPM 4.0 server
After=syslog.target network.target
[Service]
# We only take '/' as path separator
# The following properties may be modified
tibco.home=/home/vagrant/tibco/amx-bpm
tibco.config.mgmt.home=/home/vagrant/TIBCO_HOME/amx-bpm/tibco/data
amx.version=3.3
# Administrator Server Configuration: Details
admin.enterprise.name=AMX-BPM
admin.instance.name=AMX-BPM-Server
admin.shared.folder=${tibco.config.mgmt.home}/admin/${admin.enterprise.name}/shared
# We only take '/' as path separator
# The following properties may be modified
tibco.home=/home/vagrant/tibco/amx-bpm
plugins.home=${tibco.home}/tct/components/shared/1.0.0/plugins
machine.model.location=/home/vagrant/tibco/amx-bpm/tools/machinemodel/shared/1.0.0/machine.xmi
# Shell Configuration Details
source.jar.folders=/vagrant/bpm_install
shell.name=com.tibco.tpcl.gen.oracle.jdbc
shell.version=11.1.0.112100
<?xml version="1.0"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>---Universal Installer Silent Installation Properties---</comment>
<!--accept the license agreement-->
<entry key="acceptLicense">true</entry>
<!--the root installation directory-->
<!--if the product does not support multiple instances and TIBCO_HOME has already been set then-->