Skip to content

Instantly share code, notes, and snippets.

View danlopez's full-sized avatar

Dan Lopez danlopez

  • SolarApp Foundation
  • Philadelphia, PA
View GitHub Profile
@danlopez
danlopez / checkip.sh
Created October 11, 2021 18:37
check if IP address matches last know IP, do something if it doesn't.
#!/bin/bash
# Get current IP
ip_address=$(curl icanhazip.com)
echo $ip_address
# Check if IP Address matches last known IP
FILE=/home/pi/scripts/ip.txt
/*
GET /sections/<sectionId>
*/
// Headers
Authentication: Bearer <accessToken> // Required for all OAuth Requests
// Response
/*
POST /organizations/<subOrgId>/sections
*/
// Headers
Authentication: Bearer <accessToken> // Required for all OAuth Requests
// Request Params
{
/*
POST /organizations/<AtiOrgId>/sub-organizations
*/
// Headers
Authentication: Bearer <accessToken> // Required for all OAuth Requests
// Request Params
{
/*
POST /oauth/access-token
*/
// Request Parameters
{
"clientId": "asdf123", // String
"clientSecret": "asdf123", // String
"username": "AtiMachineUser", // String; Org Admin Username within ApprenNet
"password": "Password123" // String; Org Admin Password
@danlopez
danlopez / gist:d473c8332e4e2c491467
Last active August 29, 2015 14:21
Potential Reviewers - GET /api/v2/meets/:meet_id/reviewers
{"users":[
{
"id":"4e663844e049bd3331000011",
"first_name":"User",
"last_name":"Number 7"
},
...
]
}
@danlopez
danlopez / gist:43a20bb519ffc1d0e7c6
Last active August 29, 2015 14:21
GET Reviewable Index
{
"reviewables": [
{
"user": {
"id": "4e4c05b8e049bd2e83000007",
"first_name": "User",
"last_name": "Number 3"
},
"mini_meet_id": "532895bd96ce8969e10001b1",
"submission_id": null,
@danlopez
danlopez / gist:48ebcc408e2663aca673
Created May 20, 2015 19:19
GET ReviewAssignments for a given context
// GET [api]org/:org_id/review_assignments/:context_id?context=meet&context_id=5321a678374c100b81000013
{
"review_assignment_contexts":
[
{
"id": "5321a678374c100b81000013",
"user_assigned": {
// User Serializer
},
"user": {
@danlopez
danlopez / gist:9a5d9e7ffe0064f667f2
Created January 19, 2015 17:20
Get Organizations
{
"organizations": [
{
"id": "5305f2e3105e12be5900003d",
"name": "Jason Blanchard",
"description": null,
"paid_status": true
},
{
"id": "5305f3cd105e12be59000061",
case $1 in
deploy)
docker run -it --rm -e "AWS_ACCESS_KEY_ID=$(printenv AWS_ACCESS_KEY_ID)" -e "AWS_SECRET_ACCESS_KEY=$(printenv AWS_SECRET_ACCESS_KEY)" -v ~/.ssh:/host-ssh apprennet/orchestrate /bin/bash -c \
"cp /host-ssh/* /root/.ssh/ && chmod 400 /root/.ssh/* && ruby tasks/trigger_deploy_pull.rb $2"
;;
status)
docker run -it --rm -e "AWS_ACCESS_KEY_ID=$(printenv AWS_ACCESS_KEY_ID)" -e "AWS_SECRET_ACCESS_KEY=$(printenv AWS_SECRET_ACCESS_KEY)" -v ~/.ssh:/host-ssh apprennet/orchestrate /bin/bash -c \
"watch -n 3 ruby tasks/container_status.rb $2"
;;
shell)