Skip to content

Instantly share code, notes, and snippets.

View riy's full-sized avatar

Rias A. Sherzad riy

View GitHub Profile
#!/bin/bash
# This script is edited by Brice Dutheil
# See there in french http://blog.arkey.fr/2012/07/30/script-pour-installer-le-jdk-5-sur-macosx-lion/
# Translate button is broken for now, please use Google to translate this website.
#
# 2014/02/10 Updated the script to run on OSX 10.9 Maverick
#
# 2013/05/11 Added a few more guidance when Java Preferences is not available anymore
# Added a simple example of a JDK switch function.
@riy
riy / generate_docker_keys.sh
Last active January 16, 2016 20:01
Create Docker Certificate Authority, Server and Client Certificates
#!/bin/bash
HOST_IP=`ifconfig eth0| awk '/inet addr/{print substr($2,6)}'`
mkdir docker-ca
chmod 0700 docker-ca
cd docker-ca
openssl genrsa -aes256 -out ca-key.pem 2048
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem
openssl genrsa -out server-key.pem 2048
openssl req -subj "/CN=${HOST_IP}" -new -key server-key.pem -out server.csr
@riy
riy / woo-orderdetails-on-thankyou-page.php
Last active July 13, 2017 23:49
WooCommerce Plugin: Order Details on "Thank You" Page As Global JavaScript variables
<?php
/**
* Plugin Name: Order Details on Thank You Page
* Version: 1.0
* Author: Rias A. Sherzad
* Description: This plugin will export some order details on the thank you page as global JavaScript variables, e.g. for accessing them from Google Tag Manager
*/
if (!defined('ABSPATH'))
{
exit;
@riy
riy / generate_docker_cert.sh
Created February 13, 2018 13:54 — forked from bradrydzewski/generate_docker_cert.sh
Generate trusted CA certificates for running Docker with HTTPS
#!/bin/bash
#
# Generates client and server certificates used to enable HTTPS
# remote authentication to a Docker daemon.
#
# See http://docs.docker.com/articles/https/
#
# To start the Docker Daemon:
#
# sudo docker -d \
## Useful Commands
Get kubectl version
kubectl version
Get cluster info:
@riy
riy / jenkins-plugins-batch-install.md
Created May 3, 2018 13:34 — forked from hgomez/jenkins-plugins-batch-install.md
Mass install/update of Jenkins Plugins

Scripted Jenkins Plugins install

Jenkins has a very rich catalog of plugins and it's quite easy to install and update them via UI. BTW, when you want to add tons of plugin via UI, it's a fairly long and boring procedure.

Hopefully, mass installation (or update) could be easy using a simple bash script (curl/python required) :

Create a file containing plugins to be installed (or updated), ie iplugins :

@riy
riy / stop-old-containers.sh
Created June 6, 2018 11:04 — forked from ewjoachim/stop-old-containers.sh
Stop docker containers older than 1 day old
#!/bin/bash -eux
yesterday=$(date -d yesterday +%s)
# dnsdock should not be stopped : we limit to the containers created after it
docker ps --filter since=dnsdock -q --format "{{.ID}} {{.CreatedAt}}" | while read line
do
# line looks like:
# 123456789abcdef 2017-01-01 00:00:00 +02:00 CEST
set $line
id=$1
ant.copy(todir: '/copy/to/dir', encoding: 'UTF-8', outputEncoding: 'Windows-31J') {
fileset(dir: '/copy/from/dir')
}
@riy
riy / install-rabbitmq.sh
Created July 4, 2018 11:57 — forked from yetanotherchris/install-rabbitmq.sh
RabbitMQ on Docker with admin UI
# AWS specific install of Docker
sudo yum update -y
sudo yum install -y docker
sudo service docker start
sudo usermod -a -G docker ec2-user
# exit the SSH session, login again
# Docker
docker run -d --hostname my-rabbit --name some-rabbit -p 4369:4369 -p 5671:5671 -p 5672:5672 -p 15672:15672 rabbitmq
@riy
riy / README.md
Created August 3, 2018 10:11 — forked from mmasashi/README.md
Install Oracle instant client (sqlplus) v12.1 on MacOSX

Install Oracle instant client (sqlplus) on MacOSX

  1. Get Oracle instant client for MacOSX
  1. Unarchive downloaded zip files into a same directory
  • ex: $HOME/Downloads/instantclient_12_1
  1. Create install.sh and copy the following code and past it on that file.