Skip to content

Instantly share code, notes, and snippets.

View flouthoc's full-sized avatar
🌱

flouthoc

🌱
View GitHub Profile
@flouthoc
flouthoc / helm-useful.sh
Last active May 15, 2024 00:52
helm-useful-commands
#debugging a chart on local
helm template --dry-run --debug . --generate-name --values values-stage.yaml
@flouthoc
flouthoc / velero_az_replace.sh
Created October 12, 2020 04:55
velero_az_replace.sh
export PROJECT_NAME=yourvalueshere
export BACKUP_NAME=yourvalueshere
export BUCKET_NAME=yourvalueshere
export OLD_REGION=yourvalueshere
export OLD_ZONE=yourvalueshere
export NEW_REGION=yourvalueshere
export NEW_ZONE=yourvalueshere
gcloud config set project "$PROJECT_NAME"
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: SamplePodMonitor
labels:
team: infra
release: prom-op
spec:
selector:
@flouthoc
flouthoc / Makefile
Created June 27, 2020 07:28
Generic Makefile
#
# TODO: Move `libmongoclient.a` to /usr/local/lib so this can work on production servers
#
CC := g++ # This is the main compiler
# CC := clang --analyze # and comment out the linker last line for sanity
SRCDIR := src
BUILDDIR := build
TARGET := bin/runner
@flouthoc
flouthoc / Dockerfile
Created February 25, 2019 12:35
Test
FROM golang:alpine AS builder
RUN mkdir /server
ADD /server /server
WORKDIR /server
RUN go build -o server .
RUN chmod 777 server
FROM alpine
COPY --from=builder server server
RUN chmod 777 server
CMD ["./server"]
@flouthoc
flouthoc / frame.c
Created February 20, 2019 17:33
Please don't look
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <arpa/inet.h>
#include <sys/epoll.h>
#include <fcntl.h>
@flouthoc
flouthoc / run.cpp
Created December 29, 2018 07:16
challenge
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;
@flouthoc
flouthoc / gist:09dd0a701f9fa5e1a12f
Created February 3, 2015 17:25
A simple Daytime Server in C from TextBook example
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <time.h>
#define MAXLINE 1024