Skip to content

Instantly share code, notes, and snippets.

View 524c's full-sized avatar

Roger 524c

  • Brazil
  • 06:57 (UTC -03:00)
  • X @0x524c
View GitHub Profile
@524c
524c / javascript-prototype-pollution.md
Created April 7, 2023 15:13 — forked from sttk/javascript-prototype-pollution.md
Javascript Prototype Pollution

Javascript Prototype Pollution

Javascript prototype specification

// Not only Object but also other types. (Function, Array, String, Number, ...)
Object.prototype.prop1 = 1;
Object.prototype.func1 = () => 'Hello!';                                        

const obj1 = {};
@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
<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:

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
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
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
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

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.

@524c
524c / RASPBERRY_PI_4.md
Created November 2, 2022 18:22 — forked from lucaguada/RASPBERRY_PI_4.md
Steps to fully install Ubuntu Server and MiniKube on Raspberry Pi 4 (wip)

How to install Ubuntu Server and Minikube on Raspberry Pi 4 4GB+ (recommended)

Disclaimer: this step-by-step GIST has been created with no guarantees, I may have missed some steps because of distraction or chiptune improvised on-chair-dancing, so be patient and let me know if I must add or fix something.

This is the way for living long and prospering!

Download Raspberry Pi Imager

Download and install Raspberry Imager: https://www.raspberrypi.org/software/

@524c
524c / hooks.js
Created October 4, 2022 14:21 — forked from acoyfellow/hooks.js
hooks.js CSP example
// https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
// https://scotthelme.co.uk/content-security-policy-an-introduction/
// scanner: https://securityheaders.com/
const rootDomain = `your-domain.com`; // or your server IP for dev
const directives = {
'img-src': [
"*",
"'self'",
@524c
524c / semantic-commit-messages.md
Created October 4, 2022 01:09 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example