Skip to content

Instantly share code, notes, and snippets.

@halfb00t
halfb00t / 0_register_planet.sql
Created June 25, 2021 11:49 — forked from mojodna/0_register_planet.sql
Sample OSM Athena queries
--
-- This will register the "planet" table within your AWS account
--
CREATE EXTERNAL TABLE planet (
id BIGINT,
type STRING,
tags MAP<STRING,STRING>,
lat DECIMAL(9,7),
lon DECIMAL(10,7),
nds ARRAY<STRUCT<ref: BIGINT>>,
@halfb00t
halfb00t / ssh_key.tf
Created March 10, 2020 17:45 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"

Keybase proof

I hereby claim:

  • I am halfb00t on github.
  • I am halfb00t (https://keybase.io/halfb00t) on keybase.
  • I have a public key ASA8IPG9exntY63MDv_WHwb_QfFHDsqLDJNU1yHL8dvZcAo

To claim this, I am signing this object:

@halfb00t
halfb00t / helm-cheatsheet.md
Created June 29, 2019 14:26 — forked from tuannvm/cka.md
#Helm #Kubernetes #cheatsheet, happy helming!

Погодное одностраничное веб-приложение

  • Данные можно взять с сайта openweathermap.org или с любого другого сервиса.
  • Обязательно использовать react.js и redux или любой другой продпочительный для вас аналог.

Приложение должно уметь:

  • Добавлять/удалять города
  • Сохранять локально данные
  • Автоматически запрашивать погоду по координатам пользователя - это город/место по умолчанию.
@halfb00t
halfb00t / upload_memcache_stats.py
Created August 4, 2018 06:41 — forked from andrewgross/upload_memcache_stats.py
Python Script to Upload Memcache Metrics to CloudWatch
import sys, time, subprocess, socket, telnetlib
from datetime import datetime
from collections import defaultdict
from boto.ec2.cloudwatch import CloudWatchConnection
MAPPINGS = {
# Memcached name: (AWS Name, AWS Metric Type, Calculation Method)
'uptime': ('Uptime', 'Count', 'gauge'),
@halfb00t
halfb00t / ecs-run
Created March 20, 2018 06:15 — forked from vcastellm/ecs-run
Run task and wait for result in AWS ECS
#!/usr/bin/env bash
set -e
function usage() {
set -e
cat <<EOM
##### ecs-run #####
Simple script for running tasks on Amazon Elastic Container Service
One of the following is required:
Required arguments:
@halfb00t
halfb00t / Jenkinsfile
Created February 19, 2018 12:03 — forked from ftclausen/Jenkinsfile
Jenkins pipeline - An approach to get all commits since the last successful build.
// -*- mode: groovy -*-
// vim: set filetype=groovy :
node( 'some_node' ) {
stage( "Phase 1" ) {
sshagent( credentials: [ 'some_creds' ] ) {
checkout scm
def lastSuccessfulCommit = getLastSuccessfulCommit()
def currentCommit = commitHashForBuild( currentBuild.rawBuild )
if (lastSuccessfulCommit) {
@halfb00t
halfb00t / batch-strace.sh
Created February 16, 2018 11:47 — forked from hydra35/batch-strace.sh
strace all the php-fpm worker processes
#!/bin/bash
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6)
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 &
kernel:
image: linuxkit/kernel:4.9.75
cmdline: "console=tty0 console=ttyS0 console=ttyAMA0"
init:
- linuxkit/init:5a577d070817b4f17821657823082651baafd4ed
- linuxkit/runc:abc3f292653e64a2fd488e9675ace19a55ec7023
- linuxkit/containerd:e58a382c33bb509ba3e0e8170dfaa5a100504c5b
- linuxkit/ca-certificates:de21b84d9b055ad9dcecc57965b654a7a24ef8e0
onboot:
- name: sysctl