Skip to content

Instantly share code, notes, and snippets.

Avatar

Roger Lucas 524c

View GitHub Profile
@524c
524c / esmodules.md
Created September 14, 2023 14:58 — forked from danpetitt/esmodules.md
Typescript, Jest and ECMAScript Modules
View esmodules.md
@524c
524c / libevent-example.c
Created August 16, 2023 12:42 — forked from ajhwb/libevent-example.c
Asynchronous network I/O using libevent
View libevent-example.c
/*
* Libevent is a high-performance and portable asynchronous networking I/O library (http://libevent.org)
* This is small program to demonstrate the basic of libevent programming
*
* Copyright (C) 2012, Ardhan Madras <ardhan@rocksis.net>
*/
#include <event.h>
#include <arpa/inet.h>
#include <netinet/in.h>
@524c
524c / saga-sample.js
Created April 27, 2023 15:43 — forked from icebob/saga-sample.js
Saga middleware PoC for Moleculer
View saga-sample.js
"use strict";
const _ = require("lodash");
const chalk = require("chalk");
const Promise = require("bluebird");
const ServiceBroker = require("../src/service-broker");
const { MoleculerError } = require("../src/errors");
// --- SAGA MIDDLEWARE ---
const SagaMiddleware = function() {
@524c
524c / javascript-prototype-pollution.md
Created April 7, 2023 15:13 — forked from sttk/javascript-prototype-pollution.md
Javascript Prototype Pollution
View javascript-prototype-pollution.md
@524c
524c / mime.html
Created April 5, 2023 15:38 — forked from ilmoralito/mime.html
How to check real mime type of image in javascript
View mime.html
<html>
<head>
<script type="text/javascript" src="/jquery.min.js"></script>
<title>Mime type checker</title>
<script>
$(function () {
var result = $('div#result');
if (window.FileReader && window.Blob) {
$('span#submit').click(function () {
var files = $('input#file').get(0).files;
@524c
524c / DockerfileForSvelteKit.md
Created March 13, 2023 18:03 — forked from aradalvand/DockerfileForSvelteKit.md
Dockerfile and .dockerignore for SvelteKit:
View DockerfileForSvelteKit.md

This Dockerfile is intended for SvelteKit applications that use adapter-node.

Dockerfile:

FROM node:16-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
@524c
524c / configmap.yaml
Created February 24, 2023 19:55 — forked from tuananh/configmap.yaml
Pi-hole on Kubernetes
View configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: pihole-config
data:
WEBPASSWORD: pihole
TZ: 'Asia/Ho_Chi_Minh'
DNS1: 1.1.1.1
DNS2: 1.0.0.1
@524c
524c / ubuntu-sleep.yaml
Created January 28, 2023 21:14 — forked from tcdowney/ubuntu-sleep.yaml
Ubuntu Sleep Pod
View ubuntu-sleep.yaml
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
containers:
- image: ubuntu
command:
@524c
524c / kubectl-delete_all
Created January 28, 2023 14:00 — forked from superbrothers/kubectl-delete_all
Kubernetes: Delete all objects in the namespace
View kubectl-delete_all
kubectl delete "$(kubectl api-resources --namespaced=true --verbs=delete -o name | tr "\n" "," | sed -e 's/,$//')" --all
@524c
524c / k3s-cluster.md
Created January 27, 2023 02:18 — forked from kopwei/k3s-cluster.md
K3s and Rancher on Raspberry Pi 4 Cluster
View k3s-cluster.md

Deploy K3s and Rancher on Raspberry Pi 4 cluster

Today I tried to setup a small Kubernetes cluster on top of 3 Raspberry Pi 4 (4GB Memory). Here is the steps to install the cluster.

IMG_3817

Preparation

I have 3 Raspberry Pi 4 stacked with PoE headers and connected to a PoE switch at home. The are connected to Internet through a home router. All Pis are equipped with a 64GB Samsung SDXC card flushed with Ubuntu 20.04 image.