Skip to content

Instantly share code, notes, and snippets.


JJ Asghar jjasghar

View GitHub Profile

channel operator quick reference

direct discussion about administrative action away from the main channel and into #reddit-diabetes-ops to minimise disruption. our -ops channel is the place where users should come to ask for our help. examples:

  • any sort of operator request or discussion of channel administration in the main channel
  • PMs asking why a ban was set
  • reports of harassment (unless the user is confiding in you)
  • any request for operator action

changing channel access permissions

jjasghar /
Last active Jan 17, 2022 — forked from coderanger/
Coderanger's incident report template

[My company] Incidents

This repository contains incident reports for all [my company] products and services.

How to document an incident?

Copy the file to a new file named, eg. Make sure the date is correct for UTC rather than your local time zone, for California staff this might mean the incident happened "tomorrow". Then fill in all the fields in the template and create a Pull Request. The [my team] team will review and merge it.

What counts as an incident?

jjasghar /
Created Jan 8, 2022 — forked from cloudnull/
Install the latest static tmate and start a session
TMATE_FILE=$($(command -v python3 || command -v python) <<EOC
import requests
r = requests.get(
releases = r.json()
amd64_releases = [
i for i in releases['assets']
if 'amd64' in i['name'] and not 'dbg' in i['name']
jjasghar / yas-company-helm.el
Last active Dec 13, 2021 — forked from fletch/yas-company-helm.el
Yasnippet + company + helm
View yas-company-helm.el
;; Add yasnippet support for all company backends
(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)))
(append (if (consp backend) backend (list backend))
jjasghar /
Created May 18, 2020 — forked from timroster/
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!


  • 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

Making a Reddit Upvote Notifier

The Arduino Yún's ability to connect to the Internet introduces many new possibilities to traditional Arduino development, such as capturing data from the web and making use of it inside of a sketch.

This project will demonstrate this ability by monitoring the number of upvotes accrued by a Reddit comment thread and alerting the user when new upvotes are added.

Many companies offer application programming interfaces (APIs, for short) that allow third-party programs to access their data. Reddit, for example, provides an API that gives detailed information and statistics for posts, comment threads, and users.

This project uses a Python script on the Yun's Linux side to read the current upvote count from a comment thread using Reddit's API. A skech running on the Arduino side will track this number and display a notification message on an LED matrix every time a new vote is added.


Create private networks with libvirt

I assume that you have a running debian wheezy host with libvirt and qemu/kvm installed. You need two guest VMs for this. The first guest will get the IP and the second will get All following commands must be run with sudo or under root.

Internal Network

We create a new network named internal with libvirt and use it with the IP

View simple-journal-with-vim.adoc

Simple journal with vim

So how would you use your text editor to make a day notes?

For vim I end up using simple approach:

  • have a ~/docs/journal/ directory where I keep yearly journals in asciidoc format (one can use markdown of course).

  • have a mapping to quickly open a journal ready to enter you thoughts, notes or a todos for a day.

jjasghar /
Created Sep 22, 2016
basic nat setup with iptables with default OpenVPN network
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD DROP
export LAN=ens160 #change to your nic
export WAN=ens192 #change to your nic