Skip to content

Instantly share code, notes, and snippets.

View Orfeous's full-sized avatar
💭
I may be slow to respond.

Gabor Racz Orfeous

💭
I may be slow to respond.
  • R.S. Ltd
  • Dublin
View GitHub Profile
@ZacharyPatten
ZacharyPatten / readme.md
Last active February 3, 2023 15:58
GitHub Repository Checklist (C#)

GitHub Repository Checklist (C#)

Have a repository on GitHub? Planning on making a repository on GitHub? This checklist is intended to introduce you to various features that may help you make the most of your GitHub repository with specific recommendations for C# repositories.

Checklist

These are only suggestions.
They may not be appropriate for all repositories.
They are in no particular order.
Click each item to expand for more information.

@kekru
kekru / 01nginx-tls-sni.md
Last active May 27, 2024 21:49
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@mrpeardotnet
mrpeardotnet / PVE-postinstall-5x.md
Last active March 20, 2024 10:43
PVE-postinstall-6.x

Proxmox PVE 6.x Post Installation Steps

This cheatsheet helps to set up your Proxmox Virtual Environment (PVE) host after fresh installation. Designed and tested on PVE version 6.x.

Note about sudo

I do not prepend sudo command to any of commands listed here, but keep in mind that nearly all commands requires su privileges, so use sudo if your account happen to not have root access.

How to edit config files

The simplest way to edit config file is to use vim.tiny editor, for example to edit vzdump.conf file use this command:

@squidpickles
squidpickles / README.md
Last active June 8, 2024 05:18
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.

Steps

Follow the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for setting up the master node. I've been using Weave Net as the network plugin; it see

@KeithYeh
KeithYeh / Self-Signed SSL with SAN.md
Created October 14, 2017 13:12
Create self-signed SSL certificate with SubjectAltName(SAN)

How to create a self-signed SSL Certificate with SubjectAltName(SAN)

After Chrome 58, self-signed certificate without SAN is not valid anymore.

Step 1: Generate a Private Key

openssl genrsa -des3 -out example.com.key 2048

Step 2: Generate a CSR (Certificate Signing Request)

@Orfeous
Orfeous / index.php
Created August 12, 2016 09:58 — forked from ziadoz/index.php
Simple PHP / jQuery CSRF Protection
<?php
// See: http://blog.ircmaxell.com/2013/02/preventing-csrf-attacks.html
// Start a session (which should use cookies over HTTP only).
session_start();
// Create a new CSRF token.
if (! isset($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = base64_encode(openssl_random_pseudo_bytes(32));
}
@wenzhixin
wenzhixin / redmine-3.0.2-on-ubuntu-14.04
Last active November 15, 2017 09:30
redmine 3.0.2 installer on ubuntu 14.04(new installtion) with nginx, mysql and puma
# set cache proxy
sudo vi /etc/apt/apt.conf << EOT
Acquire::http::Proxy "http://192.168.88.10:3142";
Acquire::HTTP::Proxy::192.168.88.10 "DIRECT";
EOT
sudo apt-get update
sudo apt-get upgrade
@R2D221
R2D221 / SortedDictionaryExtensions.cs
Created November 16, 2014 23:54
SortedDictionary extensions to mimic behaviour from Java NavigableMap
using System.Linq;
namespace System.Collections.Generic
{
// based on http://stackoverflow.com/a/3486820/1858296
public static class SortedDictionaryExtensions
{
private static Tuple<int, int> GetPossibleIndices<TKey, TValue>(SortedDictionary<TKey, TValue> dictionary, TKey key, bool strictlyDifferent, out List<TKey> list)
{
list = dictionary.Keys.ToList();
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@springmeyer
springmeyer / install-mapnik-amazon-ami.sh
Last active January 6, 2024 15:06
Mapnik on Amazon Linux AMI (Fedora)
# http://aws.amazon.com/amazon-linux-ami/
# http://aws.amazon.com/amazon-linux-ami/faqs/
# Boot up a machine with at least 1.5 to 2 GB Ram
# login
chmod 600 key.pem
ssh -i key.pem ec2-user@ec2...compute.amazonaws.com
# update