Skip to content

Instantly share code, notes, and snippets.

View aelkz's full-sized avatar
πŸ‘½
working hard

Raphael Abreu aelkz

πŸ‘½
working hard
View GitHub Profile
@aelkz
aelkz / openshift-cheatsheet.md
Created November 17, 2018 19:10 — forked from rafaeltuelho/openshift-cheatsheet.md
My Openshift Cheatsheet

My Openshift Cheatsheet

Examine the cluster quota defined for the environment:

$ oc describe AppliedClusterResourceQuota

Install paks using yum in a Dockerfile

@aelkz
aelkz / namecheap-ddns
Created November 15, 2018 23:13
Simple Namecheap Dynamic DNS client
#!/bin/sh
set -eu
FETCH="fetch -qo -"
# or for curl:
#FETCH="curl -s"
# $1: your domain
# $2: subdomain to update use @ for TLD
# $3: the password given to you by Namecheap's web interface
#
# Rerun this script every 5 minutes. Crontab entry (not as root):
@aelkz
aelkz / qemu
Created November 11, 2018 11:43 — forked from fcicq/qemu
/etc/libvirt/hooks/qemu backup, kvm+libvirt port range forwarding (iptables hooks)
#!/bin/sh
# this is /etc/libvirt/hooks/qemu
# see also http://wiki.libvirt.org/page/Networking#Forwarding_Incoming_Connections
HOST_PORT="17000:17030"
GUEST_IP="192.168.122.2"
COMMAND_1="iptables -t nat -D PREROUTING -p tcp --dport ${HOST_PORT} -j DNAT --to ${GUEST_IP}"
COMMAND_2="`echo \"${COMMAND_1}\" | sed -e \"s/tcp/udp/\"`"
COMMAND_3="iptables -D FORWARD -p tcp -d ${GUEST_IP}/32 -m state --state NEW -m tcp --dport ${HOST_PORT} -j ACCEPT"
COMMAND_4="iptables -D FORWARD -p udp -d ${GUEST_IP}/32 -m udp --dport ${HOST_PORT} -j ACCEPT"
@aelkz
aelkz / gist:34c4718555952187d9c3d52795c43cf4
Created November 11, 2018 01:43 — forked from komuw/gist:076231fd9b10bb73e40f
Shell script to generate server cert, key and client certs (all self-signed)
#! /usr/bin/env bash
# Create the CA Key and Certificate for signing Client Certs
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
# Create the Server Key, CSR, and Certificate
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
@aelkz
aelkz / gist:abcb17f74e5ceb2d0239d56287741539
Created November 8, 2018 15:15 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@aelkz
aelkz / virt-addr.sh
Created November 6, 2018 00:31 — forked from tensorfields/virt-addr.sh
Get a KVM guest's IP address
#!/bin/bash
# Returns the IP address of a running KVM guest VM
# Assumes a working KVM/libvirt environment
#
# Install:
# Add this bash function to your ~/.bashrc and `source ~/.bashrc`.
# Usage:
# $ virt-addr vm-name
# 192.0.2.16
#
@aelkz
aelkz / oracle-on-minishift.md
Created September 5, 2018 12:15 — forked from ejlp12/oracle-on-minishift.md
minishift, openshift, OCP, oracle database

This is a journey how I can finally run Oracle database (Xpress Edition) on Openshift.

Download oracle-xe-11.2.0-1.0.x86_64.rpm.zip from oracle website

git clone https://github.com/ejlp12/docker-oracle-xe.git
cd docker-oracle-xe
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
mv Disk1/oracle-xe-11.2.0-1.0.x86_64.rpm rpm/
@aelkz
aelkz / reclaimWindows10.ps1
Created August 21, 2018 01:11 — forked from alirobe/reclaimWindows10.ps1
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <[email protected]>
# Modified by: alirobe <[email protected]> based on my personal preferences.
# Version: 2.20.1, 2018-07-23
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@aelkz
aelkz / jwtRS256.sh
Last active November 9, 2018 16:03 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
# ##################################################
# don't add passphrase
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# generate private and public keys