Skip to content

Instantly share code, notes, and snippets.

View stobias123's full-sized avatar

Steven Tobias stobias123

View GitHub Profile
package main
import (
"context"
"os"
"dagger.io/dagger"
log "github.com/sirupsen/logrus"
)
@stobias123
stobias123 / Dagger Test
Last active August 22, 2023 14:33
The touch command fails after I copy in a file. -- • Engine: 34af08e4c1b7 (version v0.8.4)
package main
import (
"context"
"fmt"
"os"
"dagger.io/dagger"
)
package todoapp
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
"universe.dagger.io/bash"
)
dagger.#Plan & {
client: {
@stobias123
stobias123 / spamvote
Last active December 14, 2021 20:41
vote on house.
## RUN THIS FIRST IN YOUR TERMINAL
## pip install selenium
import time
from selenium import webdriver
ntimes = YOUR_NUMBER_OF_VOTES
@stobias123
stobias123 / bash_colors
Created June 28, 2021 16:23
Some bash colors so I don't have to keep writing this.
# ----------------------------------
# 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'
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 August 10, 2020 21:52
Pretty 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
@stobias123
stobias123 / tensorforce_agent.py
Created June 29, 2020 02:45
Tensorforce Problems
## 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 April 3, 2020 08:13
Command line autocompletion for `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 April 1, 2020 16:39
Ansible Callback for wavefront.
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