Skip to content

Instantly share code, notes, and snippets.

View YakDriver's full-sized avatar
🕳️
🌑

Dirk Avery YakDriver

🕳️
🌑
View GitHub Profile
@YakDriver
YakDriver / generate_test_script.sh
Created November 8, 2018 22:34
Get names of Terraform tests from a test file
#!/bin/bash
awk '/^func Test/' aws/structure_test.go | sed "s/func \(Test[a-zA-Z0-9_]*\)(.*$/make testacc TESTARGS='-run=\1'/" > tests.sh
@YakDriver
YakDriver / sg-issue-terraform.log
Created October 1, 2018 18:22
Related to terraform bug
2018/10/01 13:41:49 [INFO] Terraform version: 0.11.8 7a5c1d221ac209bbac66947c369815cd9ca70ed5
2018/10/01 13:41:49 [INFO] Go runtime version: go1.10.1
2018/10/01 13:41:49 [INFO] CLI args: []string{"/usr/local/bin/terraform", "init", "-input=false"}
2018/10/01 13:41:49 [DEBUG] Attempting to open CLI config file: /Users/yakdriver/.terraformrc
2018/10/01 13:41:49 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/10/01 13:41:49 [INFO] CLI command args: []string{"init", "-input=false"}
2018/10/01 13:41:49 [DEBUG] command: loading backend config file: /Users/yakdriver/dev/fardvag/sg_bug
2018/10/01 13:41:49 [INFO] command: empty terraform config, returning nil
2018/10/01 13:41:49 [DEBUG] command: no data state file found for backend config
2018/10/01 13:41:49 [DEBUG] New state was assigned lineage "44b3fe01-e94a-ab5c-dde8-904093ff412d"
@YakDriver
YakDriver / sync.md
Last active March 15, 2023 12:15
Re-sync a fork with the upstream repo

First, you want to make sure that your upstream is setup. Here origin is your fork and upstream is the forked repo.

$ git remote -v
origin	https://github.com/YakDriver/watchmaker.git (fetch)
origin	https://github.com/YakDriver/watchmaker.git (push)
upstream	https://github.com/plus3it/watchmaker.git (fetch)
upstream	https://github.com/plus3it/watchmaker.git (push)
@YakDriver
YakDriver / install_docker_centos.sh
Last active July 3, 2018 18:44
Install docker on CentOS
sudo su
yum install epel-release
yum --enablerepo=epel install docker-io
# centos 7
systemctl start docker
# centos 6
service docker start
@YakDriver
YakDriver / get_sha_hash.sh
Created May 16, 2018 16:42
SHA256 hash on posix
shasum -a 256 filename.txt
@YakDriver
YakDriver / Filesize.rst
Created May 9, 2018 21:38
Possible differences in file sizes

$ du -h filename # shows the size in kiB/MiB/GiB (1024 increments) $ du -h --si filename # shows the size in kB/MB/GB (1000 increments)

@YakDriver
YakDriver / list_files.py
Created April 26, 2018 19:49
List all files in pythonpath, sys.path, search path
import sys
import os
import glob
for path in sys.path:
for afile in glob.glob(os.path.join(path, '*')):
print(os.path.join(path, afile))
@YakDriver
YakDriver / query_operation.graphql
Last active April 20, 2018 13:27
GraphQL GitHub API examples, using operations
# named operation
query GetRelease($owner: String!, $repo: String!, $tag: String!) {
repository(
owner: $owner,
name: $repo
) {
release(tagName: $tag) {
name
id
releaseAssets(first:10) {
@YakDriver
YakDriver / github_release.qraphql
Last active April 20, 2018 13:12
GraphQL GitHub API Examples (Query Releases)
query {
repository(
owner: "YakDriver",
name: "pyppyn"
) {
release(tagName: "0.2.3") {
name
id
releaseAssets(first:10) {
nodes {
@YakDriver
YakDriver / create_test_file.ps1
Created March 23, 2018 11:36
Creates a file filled with null for testing
$f = new-object System.IO.FileStream C:\Temp\test.dat, Create, ReadWrite
$f.SetLength(40MB)
$f.Close()