Skip to content

Instantly share code, notes, and snippets.


JJ Asghar jjasghar

View GitHub Profile


cribbed from

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


# Namespace for classes and modules that handle serving documentation over HTTP
View windows.rb
# 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
View bottles.rb
class Bottles
def verse(number)
case number
when 1
orig_bottles = "bottle"
new_bottles = "no more bottles"
space = ""
one = "it"
View Winrm_setup.ps1
# 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 /
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
jjasghar /
Created Sep 13, 2016 — forked from swalberg/
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 /
Created Jul 18, 2016 — forked from donniebishop/
i3-blocklet for checking Pokemon Go status
#!/usr/bin/env python3
from bs4 import BeautifulSoup
import requests
'Online!': 0,
'Unstable!': 1,
'Offline!': 2,
jjasghar / Rakefile
Created Jun 13, 2016 — forked from burtlo/Rakefile
Using ERB
View Rakefile
namespace :gsub do
desc 'populate a configuration'
task :populate do
content ='config.yml')
puts content
jjasghar / yas-company-helm.el
Last active Sep 28, 2018 — 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 / breaktime.el
Last active Aug 26, 2015 — forked from camdez/breaktime.el
/u/joeheyming's Emacs break timer (modified)
View breaktime.el
;;; See:
(defvar breaktime-timer nil
"Holds the running break timer (if any).")
(defvar breaktime-interval (* 3 60 60)
"How often to take a break, in seconds.")
(defun breaktime--take-a-break ()
(switch-to-buffer (get-buffer-create "*breaktime*"))
(let ((inhibit-read-only t))