Skip to content

Instantly share code, notes, and snippets.

View jjasghar's full-sized avatar

JJ Asghar jjasghar

View GitHub Profile
@jjasghar
jjasghar / lets-encrypt-free-iks.md
Created May 18, 2020 20:42 — forked from timroster/lets-encrypt-free-iks.md
Creating Let's Encrypt certificates for IBM free Kubernetes clusters

Creating Let's Encrypt certificates for IBM free Kubernetes clusters

The IBM Kubernetes service free clusters consist of a single worker node with 2 CPU and 4 GB of memory for experimenting with Kubernetes. Unlike the fee-based service, these clusters do not include capabilities for application load balancing using ingress out-of-the-box. However, if you manage a DNS domain (any provider will suffice) and can add an A record, it's possible for you to configure your own ingress that can provide http and https session termination for your containerized applications. Getting a TLS-enabled website or simply an external REST API couldn't be easier!

Prerequisites

  • Free IBM Kubernetes Cluster (IKS) - upgrade your account from Lite plan to create one. In the example commands, we'll assume that this cluster is named mycluster
  • kubectl - match your cluster API version (as of 5/17/20 - this is ~1.16.9)
  • helm v3
  • DNS domain that you can edit to configure
@jjasghar
jjasghar / .zshrc
Created August 19, 2019 20:49 — forked from ahmadawais/.zshrc
Print status for all fail2ban jails.
# Print status for all fail2ban jails.
function f2bstall() {
JAILS=($(fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'))
for JAIL in ${JAILS[@]}
do
echo "--------------- 👀 JAIL STATUS: $JAIL ... ---------------"
fail2ban-client status $JAIL
echo "--------------- ... ---------------"
done
}
@jjasghar
jjasghar / gist:2aac4679bc00964eaf98f919d89c2f82
Created February 1, 2018 19:50 — 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:
@jjasghar
jjasghar / app.rb
Last active November 5, 2017 20:24
salute to service twitter.rb
require "net/http"
require "uri"
require 'twitter'
# Create an app.twitter.com fill these out
client = Twitter::REST::Client.new do |config|
config.consumer_key = "FAKE"
config.consumer_secret = "VERYFAKEz2eQsYnUNXVL7S0kF0Bzh"
config.access_token = "SOMENUMEBRE-66oauaoeu"
raise "Missing parameter 'CRED_PATH'. Please read docs at #{__FILE__}" \
unless ENV.key?('CRED_PATH')
my_project = "jj-test-kitchen"
gauth_credential 'mycred' do
action :serviceaccount
path ENV['CRED_PATH'] # e.g. '/path/to/my_account.json'
scopes [
'https://www.googleapis.com/auth/compute'
@jjasghar
jjasghar / secret.rb
Created April 26, 2017 17:12 — forked from sethvargo/secret.rb
Example Chef extension to extract secrets from HashiCorp's Vault
# Please see the following blog post for more information:
#
# https://www.hashicorp.com/blog/using-hashicorp-vault-with-chef.html
#
resource_name :vault_secret
property :path, String, name_property: true
property :destination, String
@jjasghar
jjasghar / yardoc_cheatsheet.md
Created December 27, 2016 17:40 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

#
# Cookbook Name:: sensu_client
# Recipe:: windows
#
# Copyright (c) 2016 The Authors, All Rights Reserved.
directory "C:\\tmp" do
rights :full_control, 'tirefi\\administrator'
action :create
end
class Bottles
def verse(number)
case number
when 1
orig_bottles = "bottle"
new_bottles = "no more bottles"
space = ""
one = "it"
@jjasghar
jjasghar / Winrm_setup.ps1
Created September 22, 2016 21:01 — forked from galenemery/Winrm_setup.ps1
WinRM config
# On the remote node/server:
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
# When NOT USING a domain-based authentication (i.e., from Linux/Unix to Windows node):
winrm set winrm/config/service/auth '@{Basic="true"}'