Skip to content

Instantly share code, notes, and snippets.

View virtualadrian's full-sized avatar
🤓
Geek: A knowledgeable and obsessive enthusiast.

VirtualAdrian virtualadrian

🤓
Geek: A knowledgeable and obsessive enthusiast.
View GitHub Profile
#!/bin/sh
SRC=/usr/src
NGINX_VERSION=1.8.0 # http://nginx.org/en/download.html
NPS_VERSION=1.9.32.6 # https://developers.google.com/speed/pagespeed/module/build_ngx_pagespeed_from_source
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
@virtualadrian
virtualadrian / sample.sh
Created November 28, 2017 06:01 — forked from e7d/sample.sh
Bash "try catch"
#!/bin/bash
export AnException=100
export AnotherException=101
# start with a try
try
( # open a subshell !!!
echo "do something"
[ someErrorCondition ] && throw $AnException
@virtualadrian
virtualadrian / README.md
Created November 18, 2017 01:52 — forked from tachesimazzoca/README.md
Ubuntu 16.04 LTS + Mac OS X
@virtualadrian
virtualadrian / README.md
Created November 18, 2017 01:49 — forked from tachesimazzoca/README.md
H2 Database Scripts

H2 Database Scripts

Make a directory, like ~/.h2, and put the following files in it.

  • ~/.h2/lib/h2-*.jar: Get the latest h2-*.jar file from http://www.h2database.com/.
  • ~/.h2/bin/h2-server: org.h2.tools.Server
  • ~/.h2/bin/h2-shell: org.h2.tools.Shell
  • ~/.h2/db/ : H2 data files *.mv.db

You may add the path ~/.h2/bin to your env $PATH.

@virtualadrian
virtualadrian / README.md
Created November 18, 2017 01:49 — forked from tachesimazzoca/README.md
H2 Database Scripts

H2 Database Scripts

Make a directory, like ~/.h2, and put the following files in it.

  • ~/.h2/lib/h2-*.jar: Get the latest h2-*.jar file from http://www.h2database.com/.
  • ~/.h2/bin/h2-server: org.h2.tools.Server
  • ~/.h2/bin/h2-shell: org.h2.tools.Shell
  • ~/.h2/db/ : H2 data files *.mv.db

You may add the path ~/.h2/bin to your env $PATH.

@virtualadrian
virtualadrian / keycloak-compose.yml
Created October 26, 2017 01:13 — forked from jmkgreen/keycloak-compose.yml
KeyCloak docker-compose file for swarm stack launch purposes
version: '3.3'
services:
keycloak:
image: jboss/keycloak-mysql
environment:
- constraint:serverclass==gateway
- PROXY_ADDRESS_FORWARDING=true
- MYSQL_USER=keycloak

Apply JAVA S2I to CDK 2.4

#ssh to CDK
$vagrant ssh

$ oc login 10.1.2.2:8443
#login as admin/admin

#apply Java S2I Template to CDK 2.4
@virtualadrian
virtualadrian / awxinstalleronopenshift.sh
Created October 20, 2017 17:56 — forked from erbrito/awxinstalleronopenshift.sh
Deploy of AWX (Ansible Tower) on OpenShift
mkdir Tower
cd Tower/
git clone https://github.com/ansible/awx.git
cd awx
cd installer/
#vi inventory
-# openshift_host=127.0.0.1:8443
-# awx_openshift_project=awx
-# openshift_user=developer
{
"kind":"ImageStream",
"apiVersion":"v1",
"metadata":{
"name":"redhat-openjdk18-openshift"
},
"spec":{
"dockerImageRepository":"registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift",
"tags":[
{
@virtualadrian
virtualadrian / monitor_usage.py
Created October 7, 2017 10:50 — forked from nathants/monitor-usage.py
simple server usage monitoring, writing json to stdout. depends on psutil and python3.4, but should work with any python version with minor modifications.
#!/usr/bin/env python3.4
"""
simple server usage monitoring, writing json to stdout. depends on
psutil and python3.4, but should work with any python version with
minor modifications.
to add usage to your log: $ nohup python3.4 usage.py 3 >> /var/log/your_normal_app_log.log &