Skip to content

Instantly share code, notes, and snippets.

Avatar

Steven Tobias stobias123

View GitHub Profile
@stobias123
stobias123 / bash_colors
Created Jun 28, 2021
Some bash colors so I don't have to keep writing this.
View bash_colors
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
View gist:9b22235e5e797402f56156e72b547e40
2020/09/08 13:24:14 [INFO] Terraform version: 0.12.24
2020/09/08 13:24:14 [INFO] Go runtime version: go1.12.13
2020/09/08 13:24:14 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/2.0.0/versions/0.12.24/terraform", "apply"}
2020/09/08 13:24:14 [DEBUG] Attempting to open CLI config file: /Users/userbar/.terraformrc
2020/09/08 13:24:14 Loading CLI configuration from /Users/userbar/.terraformrc
2020/09/08 13:24:14 [DEBUG] checking for credentials in "/Users/userbar/.terraform.d/plugins"
2020/09/08 13:24:14 [DEBUG] checking for credentials in "/Users/userbar/.terraform.d/plugins/darwin_amd64"
2020/09/08 13:24:14 [INFO] CLI command args: []string{"apply"}
2020/09/08 13:24:14 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2020/09/08 13:24:14 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
@stobias123
stobias123 / git aliases
Created Aug 10, 2020
Pretty git aliases.
View git aliases
[alias]
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
View tensorforce_agent.py
## tensorforce_agent.py
# This code breaks immediately here with "Unknown Gym Environment"
env = gym.make("my_gm:level-v0")
environment = Environment.create(environment='gym', level=env, max_episode_timesteps=1000)
## it works fine as shown int his file. :/
class RandomAgent(object):
"""The world's simplest agent!"""
def __init__(self, action_space):
@stobias123
stobias123 / govc
Last active Apr 3, 2020
Command line autocompletion for `govc`
View govc
#compdef govc
_govc () {
local line
local -a top_level_cmds
top_level_cmds=$(_govc_top_level_commands)
_arguments -C \
'1: :_govc_top_level_commands' \
"*::arg:->args"
@stobias123
stobias123 / wavefront.py
Created Apr 1, 2020
Ansible Callback for wavefront.
View wavefront.py
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import time
from wavefront_api_client.rest import ApiException
from pprint import pprint
from os.path import basename
import wavefront_api_client as wave_api
@stobias123
stobias123 / wavefront callback
Created Apr 1, 2020
Ansible Callback for wavefront.
View wavefront callback
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import time
from wavefront_api_client.rest import ApiException
from pprint import pprint
from os.path import basename
import wavefront_api_client as wave_api
View gist:78a839d13b2386098aedd875802ee7bb
reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0x000000FF
@stobias123
stobias123 / asm_policy_export.py
Created Mar 5, 2019
Exports all policies from an F5 Server
View asm_policy_export.py
from f5.bigip import ManagementRoot
from time import sleep
def task_checker(task):
while True:
task.refresh()
if task.status in ['COMPLETED', 'FAILURE']:
break
sleep(1)
assert task.status == 'COMPLETED' # this will raise assertion error if export task fails
@stobias123
stobias123 / Utils-vagrant-box
Last active Jan 30, 2019
Vagrant box for dev
View Utils-vagrant-box
Vagrant.configure("2") do |config|
config.vm.define "dev_box" do |machine|
machine.vm.box = "centos/7"
machine.vm.hostname = "local-dev-box"
machine.vm.box_download_insecure = true
machine.vm.provision "shell", inline: <<-SCRIPT
echo "sslverify=false" >> /etc/yum.conf
yum install -y epel-release && yum -y upgrade
yum install -y yum-utils vim \