Skip to content

Instantly share code, notes, and snippets.

View hasusuf's full-sized avatar

Hassan Youssef hasusuf

View GitHub Profile
@miry
miry / 01_extract_crt.rb
Last active September 3, 2023 06:32
Extract certificate from the kubernetes config.
require 'optparse'
require 'yaml'
require 'base64'
options = {
config_path: File.join(ENV['HOME'], '.kube', 'config'),
write_dir: File.join(ENV['HOME'], '.kube')
}
OptionParser.new do |opts|
@max-mapper
max-mapper / index.sh
Last active November 2, 2023 10:13
generate ES512 and RS256 elliptic curve keypairs for JWT JWK (JSON Web Token JSON Web Key) using openssl
# RS256
# private key
openssl genrsa -out rs256-4096-private.rsa 4096
# public key
openssl rsa -in rs256-4096-private.rsa -pubout > rs256-4096-public.pem
# ES512
# private key
openssl ecparam -genkey -name secp521r1 -noout -out ecdsa-p521-private.pem
# public key
@taylorotwell
taylorotwell / alert.php
Created November 11, 2016 22:39
Components And Slots
<div class="alert">
{{ $slot }}
</div>
@int128
int128 / gist:14255ff1b1ed11ce1f661a7d35954c2b
Created October 26, 2016 10:18
How to execute a remote command on the Jenkins Script Console
import hudson.util.RemotingDiagnostics;
def node = 'node-name'
def command = 'uname -a'
println RemotingDiagnostics.executeGroovy("""
def p = '$command'.execute()
p.waitFor()
println p.in.text

Installing h2load on Your Dev Machine

Included are the steps for macOS and Ubuntu/Debian. I didn't do Windows because I don't have or use Windows. 😕

@kevin-smets
kevin-smets / 1_kubernetes_on_macOS.md
Last active May 5, 2024 10:12
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@bmaupin
bmaupin / install-openjdk-6-ubuntu-16.sh
Last active December 22, 2023 12:11
Install openjdk-6-jdk on Ubuntu/Xubuntu 16.04
# NOTE: This is a hack and will downgrade the tzdata package.
# Better alternatives:
# - Use Azul Zulu build of OpenJDK 6 (https://www.azul.com/downloads/zulu/zulu-linux/ - make sure you enable the box labeled Older Zulu versions)
# - Install Java 6 directly from Oracle and install it manually (https://gist.github.com/bmaupin/16855ce1b2484c459f41ad836a7d3f2f)
wget http://launchpadlibrarian.net/235298493/openjdk-6-jdk_6b38-1.13.10-1_amd64.deb
wget http://launchpadlibrarian.net/235298496/openjdk-6-jre_6b38-1.13.10-1_amd64.deb
wget http://launchpadlibrarian.net/235298494/openjdk-6-jre-headless_6b38-1.13.10-1_amd64.deb
wget http://launchpadlibrarian.net/235298487/openjdk-6-jre-lib_6b38-1.13.10-1_all.deb
wget http://launchpadlibrarian.net/250277191/tzdata_2016c-0ubuntu1_all.deb
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@vluzrmos
vluzrmos / paginate.php
Created July 20, 2016 14:31
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@psanford
psanford / meraki_strongswan_notes.md
Last active February 20, 2024 06:52
connect to meraki client vpn from strongswan (ubuntu 16.04 edition)

These are my notes for connecting to a meraki client vpn from ubuntu 16.04. This configuration assumes you are using a psk for the ipsec auth.

Install the following packages:

apt-get install -y strongswan xl2tpd

Configure strong swan