Skip to content

Instantly share code, notes, and snippets.

View deependhulla's full-sized avatar

Deepen Dhulla deependhulla

View GitHub Profile
@deependhulla
deependhulla / wireguard_layer2.md
Created July 15, 2023 10:18 — forked from zOrg1331/wireguard_layer2.md
wireguard, wireguard layer 2, wireguard over TCP

Intro

This note describes how to connect two networks/devices/VMs over public network using Wireguard with Layer 2 support (ARP, IPv6 link-local, etc).

This can also be achieved using SSH and its "tap" tunnel, however, it does not provide the same level of latency and bandwidth as full-blown VPN such as Wireguard.

In addition, this note describes how to tunnel Wireguard over TCP connection. This may be of use if you encounter firewall in-between so, for instance, you can use TCP port 443 only.

Objective

@deependhulla
deependhulla / LDAP-to-MySQL-Connector.md
Created May 3, 2023 08:41 — forked from bekce/README.md
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql
@deependhulla
deependhulla / Proxmox - SPICE client setup for MacOS.md
Last active March 30, 2023 08:13 — forked from tomdaley92/README.md
Proxmox - SPICE Client setup for MacOS

Proxmox - SPICE client setup for MacOS

  1. Install a working (and compiled) version of virt-viewer. You may view the homebrew package's upstream source on GitHub.

    brew tap jeffreywildman/homebrew-virt-manager
    brew install virt-viewer
  2. Once that's installed should be able make a call remote-viewer with a pve-spice.vv file downloaded from proxmox web interface

@deependhulla
deependhulla / Ceph-PGCal-Tool pgcalc.sh
Last active May 3, 2023 08:43 — forked from mingfang/pgcalc.sh
script to calculate ceph pg number
#!/bin/bash
#Computes the suggested PG count similar to this http://ceph.com/pgcalc/
#Reguirements:
# - must run on ceph admin
# - depends on awk, wc and bc commands
#Limitations:
# - Assumes same OSD# for all pools
@deependhulla
deependhulla / rbd-replication.md
Created September 17, 2020 13:06 — forked from jbernard/rbd-replication.md
Cinder RBD Replication Guide

Replication Notes

Assumption: You have two clusters, access to both, and a pool that exists in both clustsers and you wish to replicate some or all images in that pool to the other cluster.

Mirroring in both directions is required for Cinder to properly implement failover and failback.

Make sure you have the rbd-mirror package installed.

@deependhulla
deependhulla / update-openfire.sh
Created April 17, 2020 11:19 — forked from fabiomontefuscolo/update-openfire.sh
Update openfire keystore with Letsencrypt stuff
#!/bin/bash
#
# @author https://github.com/guusdk
#
# Checks for a known location where Let's Encrypt keys/certificates will be spontaneously exist.
# When files are detected, they're used to generate a new keystore, which is then used
# to replace the Openfire keystore.
set -e
@deependhulla
deependhulla / gist:03f8fdf92dafc3b5f5c6a7cf882c8f7a
Created November 18, 2018 05:50 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@deependhulla
deependhulla / encode_decode.php
Created January 13, 2018 12:03 — forked from LogIN-/encode_decode.php
PHP custom encode decode functions
<?php
function encode($string,$key) {
$key = sha1($key);
$strLen = strlen($string);
$keyLen = strlen($key);
for ($i = 0; $i < $strLen; $i++) {
$ordStr = ord(substr($string,$i,1));
if ($j == $keyLen) { $j = 0; }
$ordKey = ord(substr($key,$j,1));
$j++;