Skip to content

Instantly share code, notes, and snippets.

@joshdvir
joshdvir / query_mssql.sql
Last active May 16, 2023 05:06
DiggerX exercise

In this exercise we are going to run DiggerX, connect it to 4 different databases

  • Oracle
  • Postgres
  • MSSQL
  • MySQL And run queries against any of these databases
  1. Create a new folder on your computer
  2. Download and extract Digger into that folder
  3. Create a config.yaml configuration file for DiggerX

Candidate must have an IDE like Visual Studio Code installed, Docker Desktop or Podman set up locally, and the ability to share their screen over Google Meet.

  1. Create a simple Sinatra application, Gemfile, config.ru, etc...
  2. Add a healthcheck endpoint to the application
  3. Add a /google endpoint - this endpoint should get the body from google.com and save it to a local file
  4. Dockerize it
  5. Run it locally through Docker Confirm it works by visiting http://localhost
  6. Add Sidekiq to the appliation
> Candidate must have an IDE like Visual Studio Code installed, Docker Desktop set up locally, and the ability to share their screen over Google Meet.
1. Create a new API service with:
a. An endpoint that receive an Email address, verify the email address and return a JSON response
2. Run locally and visit on http://localhost:8080
3. Dockerize it
4. Run it locally through Docker
Confirm it works by visiting http://localhost:8082
@joshdvir
joshdvir / Deploy-a-minimal-Kubernetes-workload.md
Last active June 25, 2022 20:41
Deploy-a-minimal-Kubernetes-workload.md

Candidate must have an IDE like Visual Studio Code installed, Minikube or Docker Desktop & Kubernetes set up locally, and the ability to share their screen over Zoom.

  1. Start from a single file Python 3 mini HTTP server The source code is located here: https://gist.github.com/eredo/1547873c189ed5ced7353d6217cfeb42
  2. Run locally and visit on http://localhost
  3. Dockerize it
  4. Run it locally through Docker Confirm it works by visiting http://localhost
  5. Deploy to k8s with a regular "deployment"
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="file" xsi:type="File"
fileName="OhmGraphite.log"
archiveFileName="log-archives/OhmGraphite.{#}.log"
archiveEvery="Day"
archiveNumbering="Rolling"
maxArchiveFiles="7"
keepFileOpen="false"
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="type" value="prometheus" />
<add key="prometheus_host" value="*" />
<add key="prometheus_port" value="4445" />
</appSettings>
</configuration>
#!/bin/bash
url="rtmp://localhost/live/pi"
fifo="live.fifo.h264"
rm -f "$fifo"
mkfifo "$fifo"
raspivid \
-w 1280 -h 720 -fps 25 -g 100 \
@joshdvir
joshdvir / gist:4cc2b72b10b63f140798d64341e6460e
Created February 6, 2018 15:52
example terraform http remote state
terraform {
backend "http" {
address = "https://tf.tfstate.com/"
lock_address = "https://tf.tfstate.com/"
unlock_address = "https://tf.tfstate.com/"
username = "exampleUser"
password = "examplePassword"
}
}

Livestreaming via PS4 / Xbox to a local RTMP server

Live stream from your PS4 / Xbox to a local computer running an RTMP server by intercepting the twitch.tv stream.

Requirements

  • DD-WRT enabled Router (or router with iptables compatibility)
  • nix Envirment
  • nginx with the nginx-rtmp-module
@joshdvir
joshdvir / vault-get.py
Created September 1, 2017 12:55
Get a value from Vault
import sys
import hvac
import os
if(len(sys.argv) > 2 or len(sys.argv) == 1):
print("Error only key should be an argument")
quit()
var = sys.argv[1]