Skip to content

Instantly share code, notes, and snippets.

JJ Asghar jjasghar

Block or report user

Report or block jjasghar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jjasghar
jjasghar / .zshrc
Created Aug 19, 2019 — forked from ahmadawais/.zshrc
Print status for all fail2ban jails.
View .zshrc
# 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 Feb 1, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:2aac4679bc00964eaf98f919d89c2f82

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 Nov 5, 2017
salute to service twitter.rb
View app.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"
View examples~instance.rb
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 Apr 26, 2017 — forked from sethvargo/secret.rb
Example Chef extension to extract secrets from HashiCorp's Vault
View secret.rb
# 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
View yardoc_cheatsheet.md

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
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
end
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
jjasghar / nat.sh
Created Sep 22, 2016
basic nat setup with iptables with default OpenVPN network
View nat.sh
#!/bin/bash
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
export LAN=ens160 #change to your nic
export WAN=ens192 #change to your nic
You can’t perform that action at this time.