Skip to content

Instantly share code, notes, and snippets.

@bzon
bzon / GLUSTER_FS_CENTOS_AWS_TUTORIAL.md
Last active September 27, 2016 12:36
GlusterFS Documentation draft

Sypnosis

What is GlusterFS? Read [here] (https://gluster.readthedocs.io/en/latest/Administrator%20Guide/GlusterFS%20Introduction/) :)

The main purpose of this documentation is to easily setup GlusterFS, a Network Attached Storage system across multiple servers without having to go thru complicated implementation.

This guide is meant for audiences that has minimal knowledge of Linux filesystem and GlusterFS.

References

@bzon
bzon / INSTALL_OPENSHIFT_CLOUD.md
Last active February 5, 2018 21:42
OpenShift Origins on CLOUD

Issue 1 - ADCFGCLONE completes for Application Server but Autoconfig fails

Problem

Sample errors that can be found at the bottom of $INST_TOP/admin/log/ApplyAppsTier_xxxx.log

[AutoConfig Error Report]
The following report lists errors AutoConfig encountered during each
phase of its execution.  Errors are grouped by directory and phase.
The report format is:
@bzon
bzon / VIMRC.md
Created October 16, 2016 07:25
.vimrc configuration

Create the file $HOME/.vimrc with this content.

set paste

filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
@bzon
bzon / GIT_HACKS.md
Last active July 19, 2023 22:28
GIT_HACKS

Common Git hacks

Rebasing develop branch from the latest changes of master branch.

git clone http://projectA.git -b develop
git pull --rebase origin master
# Resolve merge conflicts
git add <the resolved files>
git rebase --continue
git commit -m "Merged from master branch" # or git commit --amend -m "Overwriting the current commit"
@bzon
bzon / chatserver.js
Created February 18, 2017 17:56
NodeJS Chat Server
const net = require('net');
const sockets = [];
const server = net.Server((socket) => {
sockets.push(socket);
socket.on('data', (data) => {
for (let i=0; i < sockets.length; i++) {
sockets[i].write(data);
}
@bzon
bzon / OPENSHIFT_HACKS.md
Last active July 17, 2017 15:20
Openshift Notes and Hacks

General User Management and Security

Add anyuid privilege to a service account

oc adm policy add-scc-to-user anyuid -z serviceAccountName -n namespaceName

Enable a serviceAccount from destinationProject to pull images from sourceProject

oc policy add-role-to-user system:image-puller system:serviceaccount:destinationProject:serviceAccount --namespace=sourceProject

Networking

Expose an app Port using NodePort

In this example, we are exposing the oracle-xe deployment config containerPort 1521 to nodePort 30401.

@bzon
bzon / NFS_GUIDE.md
Last active August 13, 2017 11:36
NFS Storage Guide

Only proven to work on CentOS and Rhel servers.

  1. Attach a storage device in the server. In this scenario, it's /dev/sdb. lsblk

    DEVICE_NAME="/dev/sdb"
    NFS_DIR="/nfs-dir"
    FS_TYPE="xfs"
    #FS_TYPE="ext4" #I recommend for AWS EBS
@bzon
bzon / JENKINS_GROOVY_HACKS.md
Last active April 4, 2023 15:41
JENKINS GROOVY HACKS
@bzon
bzon / LIFERAY_ALIAS.md
Last active November 2, 2017 07:50
LIFERAY_ALIAS.md
alias clear-dns-cache='sudo killall -HUP mDNSResponder;sudo killall mDNSResponderHelper;sudo dscacheutil -flushcache;say MacOS DNS cache has been cleared, Sir JB'

# Liferay Hacks
export LR_DATE=${LR_DATE:-$(date +%Y-%m-%d)}
export LR_HOME=/Users/john.bryan.j.sazon/Servers/liferay/liferay-dxp-digital-enterprise-7.0-sp4
export LR_TOMCAT_HOME=/Users/john.bryan.j.sazon/Servers/liferay/liferay-dxp-digital-enterprise-7.0-sp4/tomcat-8.0.32