Skip to content

Instantly share code, notes, and snippets.

View thisdougb's full-sized avatar

Doug Bridgens thisdougb

View GitHub Profile
@thisdougb
thisdougb / model_lat_lng.go
Created April 24, 2023 06:54
Modified model_lat_lng for strava v3 api
/*
* Strava API v3
*
* The [Swagger Playground](https://developers.strava.com/playground) is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with different endpoints depending on the authorization scope you receive from your athletes. To use the Playground, go to https://www.strava.com/settings/api and change your “Authorization Callback Domain” to developers.strava.com. Please note, we only support Swagger 2.0. There is a known issue where you can only select one scope at a time. For more information, please check the section “client code” at https://developers.strava.com/docs.
*
* API version: 3.0.0
* Generated by: Swagger Codegen (https://github.com/strava-api/strava-codegen.git)
*/
package strava
@thisdougb
thisdougb / vaultconnect_test.go
Last active December 13, 2020 11:44
Golang HashiCorp Vault dependency testing
// my app datastore using a hashi corp vault backend
package hashicorpvault
import (
"fmt"
kv "github.com/hashicorp/vault-plugin-secrets-kv"
"github.com/hashicorp/vault/api"
vaulthttp "github.com/hashicorp/vault/http"
"github.com/hashicorp/vault/sdk/helper/logging"
@thisdougb
thisdougb / AppleMagicPower.sh
Last active April 26, 2020 16:51
Simple alert to let you know when the device battery is low.
#!/usr/bin/env bash
#
# Pops up a window notification to let you know when your Magic devices are below THRESHOLD. OSX
# gives you a warning at about 2% battery (mouse and keyboard), which means you have to stop work
# when the battery dies. Threshold at 20% gives you a few days of power to fit charging in.
#
# eg:
# ---------------------------------------
# | |
# | Get a coffee and charge: |
@thisdougb
thisdougb / Zwift-to-CyclingAnalytics
Last active March 25, 2020 13:58
Javascript to inject clickable link to upload Zwift activities to Cycling Analytics.
/*
VERSION 2 : run this bookmarklet per activity.
Blog post here: https://far-oeuf.com/cycling/2020-03-25-zwift-to-cycling-analytics
General instructions for bookmarklets and CA here: https://www.cyclinganalytics.com/blog/2018/10/upload-rides-from-zwift
Though somethings not working with the generated code, so go here to actually create the bookmarklet code: https://bookmarklets.org/maker/
(remember to replace REPLACE_THIS_WITH_TOKEN with your token)
Go to your Zwift feed: https://zwift.com/feed
---
- hosts: localhost
vars:
mydomain: mytest.com
moons:
- moon
- deimos
- styx
@thisdougb
thisdougb / quick_dirty_add_vars.py
Last active December 23, 2017 14:21
adding section task vars to MindPointGroup/RHEL7-CIS (issue #26)
#!/usr/bin/env python
import re
vars_array = []
tasks = []
this_task = []
with open("original_section1.yml", "r") as file:
@thisdougb
thisdougb / tower-restore
Last active July 12, 2017 17:12
restore code for Tower
[root@ansible-tower ansible-tower-setup-3.1.4]# more restore.yml
---
- hosts: database
gather_facts: false
tasks:
- name: Temporarily grant createdb role
postgresql_user:
name: awx
role_attr_flags: CREATEDB
become: yes
[root@ansible-tower ansible-tower-setup-3.1.4]# more restore.yml
---
- hosts: database
gather_facts: false
tasks:
- name: Temporarily grant createdb role
postgresql_user:
name: awx
role_attr_flags: CREATEDB
become: yes