Skip to content

Instantly share code, notes, and snippets.

View darrensapalo's full-sized avatar

Darren darrensapalo

View GitHub Profile
@darrensapalo
darrensapalo / docker-cleanup.sh
Created August 18, 2020 03:59
Clean up docker images with <none>
#! /bin/sh
IMAGE_IDS=$(docker image ls | grep '<none>' | sed -r 's/.*([a-f0-9]{12}).*/\1/g')
echo "Deleting $IMAGE_IDS"
docker image rm $IMAGE_IDS
@darrensapalo
darrensapalo / restart-docker-service.sh
Created August 21, 2020 03:45
I'll usually need to do this if there were port issues that cause the containers to not be able to restart.
#! /bin/sh
# This restarts the whole docker service.
#
# I'll usually need to do this if there were port issues that cause the containers to not be able to restart.
service docker restart
@darrensapalo
darrensapalo / tasks.json
Created September 16, 2020 05:28
task json for building golang handlers for hasura services
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Download dependencies",
"type": "shell",
"command": "${env:GOROOT}/bin/go",
"args": [
@darrensapalo
darrensapalo / GW360 Update.md
Created October 15, 2020 06:05
Planning for deployment by Oct 19, 2020

Meeting

Thursday, October 15, 11:30AM-1:00PM (PHT)

  • Seth
  • Darren
  • Baron
  • Drew

Expected Timeline

@darrensapalo
darrensapalo / gw360 generate kpi
Created October 17, 2020 06:11
generating kpi from employee data from omnivore
Attaching to gw360-backend_gw360-backend_1
gw360-backend_1 | Successfully parsed whitelist. Found:
gw360-backend_1 | - http://localhost:8080
gw360-backend_1 | App running on port 3000.
gw360-backend_1 | session id -> HFL7kr7lyeUaneyC5k8J28S8HoBtdCFW
gw360-backend_1 | rememberMe: true
gw360-backend_1 | login success -> [email protected]
gw360-backend_1 | session restaurant ID -> 39
gw360-backend_1 | Processed a total of 0 employees for restaurant [1].
@darrensapalo
darrensapalo / process-gps-logs.fish
Last active January 8, 2021 03:01
Process log data from paper trail
#! /usr/bin/fish
# Step 1: Copy paste log file from paper trail
# Step 2: Save data into file, where each line looks like the following:
# Dec 20 22:22:11 staging[delivery-service-hasura-58f69d58f6-2cxhl {"type":"query-log","timestamp":"2020-12-21T06:22:11.043+0000","level":"info","detail":{"request_id":"616a3367629d8b436e3b0e79ba14f401","generated_sql":null,"query":{"variables":{"driver_id":"ea078cc9-28b8-40d6-8647-3141450fd683","location_details":{"uuid":"98ce4b1b-dfaa-4916-883e-a22724e48f05","is_moving":true,"odometer":6073.2,"activity":{"confidence":100,"type":"still"},"battery":{"is_charging":true,"level":0.99},"timestamp":"2020-12-21T06:22:10.410Z","coords":{"heading_accuracy":-1,"speed_accuracy":-1,"heading":-1,"latitude":26.1890645,"speed":-1,"altitude_accuracy":-1,"accuracy":1602,"altitude":-1,"longitude":50.5934393},"sample":true,"extras":{}}},"operationName":"UpdateDriverLocation","query":"mutation UpdateDriverLocation($driver_id: uuid!, $location_details: jsonb) {\n update_drivers(\n where:
@darrensapalo
darrensapalo / akp-no-complete.md
Last active February 20, 2021 06:16
Tinkering with Faith

Context

Faith: the gist is I wanted to send a response (just to test) when everything completed, but it no longer did subscription 'complete' callback after I added graphql mutations/queries. the queries/mutations work and reflect in the DB. do i be missing somethin like am I using the apollo functions wrong?

Code snippet

  const process$ = of(configuration).pipe(
      tap((config) => (configuration = config)),
@darrensapalo
darrensapalo / Leverage, from Idea to Application - thoughts.md
Last active February 23, 2021 07:01
Leverage, growth, knowledge

@darrensapalo (Twitter)

On understanding leverage from the fog of war of inexperience

Sahil mentioned a while ago 20 year olds who say "I want to be a VC..." and he was like, "What are you doing?"

Lookign back at what a person went through to get to where they are (VCs, entrepreneurs, etc), it makes a lot of sense in hindsight. How might we look at it from a different perspective?

I think a better framing of a question, in line with leverage, is: what should I be doing at a certain time?

@darrensapalo
darrensapalo / contribute.md
Created March 10, 2021 15:00
How do I contribute to Sinigang Valley?

How do I contribute?

My experience was involvement in RapidPass, and contributing to building the QR Pass... pandemic tech.

Building an openness framework

My thoughts are that we need an openness framework that allows us to interoperate... enabling people (tech, business, students anything) to contribute. To be part of the story.

Ang daming gustong tumulong, pero hindi lang alam kung paano.

CI/CD Devops tasks

The following is a checklist to make sure deployments work on our microservice deployments.

  • On Gitlab CI/CD values, fix host URLs to follow format SERVICENAME.<env>.bayanipay.us;
  • Cross check Gitlab CI/CD values to match the values.yaml fixes below:
    • On values.yaml, fix cluster issuer acme challenges from http01 to dns01
    • On values.yaml, fix image.hasura.tag to v1.3.3
    • On values.yaml, fix ingress.tls.hosts.secretName to SERVICENAME-tls
    • On values.yaml, fix ingress.hosts.host to SERVICENAME.dev.bayanipay.us