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 / 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

@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"}'
@jjasghar
jjasghar / vmware_chef.md
Created September 13, 2016 22:26 — forked from swalberg/vmware_chef.md
VMware and Chef Tools

VMware and Chef tools

Chef and VMware are a natural pairing and there are several tools available to enhance the integration.

Knife is a command-line tool that provides an interface between a local chef-repo and the Chef server and allows you to manipulate objects on the Chef server. Knife plugin allows your computer to talk to a 3rd party systems like vSphere or vRA. A plugin can create a VM in vSphere and then bootstrap it with Chef, for example, or it can expose your vRa catalog to your workstation so you don't need to use a GUI.

The following are the main interfaces with VMware and Chef our "knife" plugins.

@jjasghar
jjasghar / pokestat.py
Created July 18, 2016 21:31 — forked from donniebishop/pokestat.py
i3-blocklet for checking Pokemon Go status
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
POKEURL = 'http://cmmcd.com/PokemonGo/'
STATUSES = {
'Online!': 0,
'Unstable!': 1,
'Offline!': 2,
@jjasghar
jjasghar / Rakefile
Created June 13, 2016 20:49 — forked from burtlo/Rakefile
Using ERB
namespace :gsub do
desc 'populate a configuration'
task :populate do
content = File.read('config.yml')
content.gsub!('REPLACE_ME_KEY','REAL_KEY')
content.gsub!('REPLACE_ME_ID','REAL_ID')
puts content
end
@jjasghar
jjasghar / yas-company-helm.el
Last active December 13, 2021 16:19 — forked from fletch/yas-company-helm.el
Yasnippet + company + helm
;; http://emacs.stackexchange.com/questions/10431/get-company-to-show-suggestions-for-yasnippet-names
;; Add yasnippet support for all company backends
;; https://github.com/syl20bnr/spacemacs/pull/179
(defvar company-mode/enable-yas t
"Enable yasnippet for all backends.")
(defun company-mode/backend-with-yas (backend)
(if (or (not company-mode/enable-yas) (and (listp backend) (member 'company-yasnippet backend)))
backend
(append (if (consp backend) backend (list backend))