Skip to content

Instantly share code, notes, and snippets.

View dalion619's full-sized avatar

LioneL Christopher Chetty dalion619

View GitHub Profile
@dalion619
dalion619 / config.yml
Created April 2, 2024 21:10
Cloudflare Access bastion host/jump server/jump box config
tunnel: 1ba1811b-3315-4e11-8ef1-de51136084df
credentials-file: C:\Users\lionelchetty\.cloudflared\1ba1811b-3315-4e11-8ef1-de51136084df.json
ingress:
# This service inherits all configuration from the root-level config, i.e.
# it will use a connectTimeout of 30 seconds.
- hostname: jump.lionelchetty.dev
service: bastion
# Some built-in services (like `http_status`) don't use any config.
- service: http_status:404
logfile: C:\Users\lionelchetty\.cloudflared\cloudflared.log
@dalion619
dalion619 / cf-es256.js
Created August 1, 2023 05:36
Cloudflare Worker ECDSA ES256 Signing
import { Buffer } from "buffer";
import * as rs from 'jsrsasign';
addEventListener('fetch', event => {
try {
event.respondWith(generateSignature(event.request));
} catch (e) {
return event.respondWith(new Response('Error thrown ' + e.message));
}
})
@dalion619
dalion619 / map-kit-access-token.txt
Created November 7, 2021 18:00
Apple MapKit JS Access Token Structure
//Header
{
"typ": "JWT",
"alg": "HS512"
}
//Payload
{
"iss": "mapsapi",
"tid": "Your TeamID",
@dalion619
dalion619 / map-kit-jwt.txt
Last active November 7, 2021 17:55
Apple MapKit JS JWT Structure
//Header
{
"alg": "ES256",
"typ": "JWT",
"kid": "Your KeyID"
}
//Payload
{
"iss": "Your TeamID",
@dalion619
dalion619 / cloudflare-warp-reg.json
Created March 29, 2020 05:02
Cloudflare WARP Reg Response
"account": {
"id": "6b1bbed0-abcd-1234-1b2b-a3f9dd22cc77",
"account_type": "unlimited",
"created": "2020-01-18T18:50:00.205279Z",
"updated": "2020-03-28T17:12:01.381614Z",
"premium_data": 0,
"quota": 0,
"warp_plus": true,
"referral_count": 0,
"referral_renewal_countdown": 0,
@dalion619
dalion619 / cloudflare-warp.conf
Created March 29, 2020 04:29
TunSafe Cloudflare WARP Config
[Interface]
PrivateKey = M5B//9eKFF8yEE1VLKDr666X7/sgBk/NxXoqQgsJPT1=
DNS = 1.1.1.1
Address = 172.16.0.2/32
Address = fd01:5ca1:ab1e:885c:53ad:ff3d:ed23:6ade/128
[Peer]
PublicKey = bzXOD+E2ExENF1eyiK3H6/1SUuuH1JoVo90h8mPtgyv=
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<boolean name="is_service_running" value="true" />
<string name="app_mode">WARP</string>
<string name="warp_token">fd88819b-7d1b-21ec-3334-22cccd441fb7</string>
<string name="warp_public_key">7dWdEk/ocN1YuUSDtnnkr1YAFQKkMHikQgyV9RbQvww=</string>
<string name="warp_private_key">M5B//9eKFF8yEE1VLKDr666X7/sgBk/NxXoqQgsJPT1=</string>
<boolean name="onboardingstatus" value="true" />
<string name="warp_registration_id">f2301r2a-303a-153c-d145-76ccb9sb74bg</string>
<string name="terms_acceptance_date">2020-01-19T01:48:45.789+08:00</string>
@dalion619
dalion619 / Code_Analysis.ps1
Created February 2, 2020 20:24
ReSharper Command Line Tools PowerShell Script
<#
.Synopsis
Performs code analysis using the ReSharper CLT, InspectCode & DupFinder.
.DESCRIPTION
Takes file path to solution file, output directory for reports and excluded file extensions as parameters, and then exports HTML report of code analysis for the solution.
.EXAMPLE
. .\Code_Analysis.ps1 -SolutionFilePath "..\WebApp.sln" -ExcludedExtensions "js,css,html"; DupFinder-Analysis
.EXAMPLE
@dalion619
dalion619 / DynamicDatabaseMappingReference
Created September 4, 2018 08:36
Dynamic Database Mapping Reference
<Reference Include="Example.DynamicMapping.DynamicDatabaseMapping">
<HintPath Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">..\Example.DynamicMapping.ModuleBuilder\bin\Release\Example.DynamicMapping.DynamicDatabaseMapping.dll</HintPath>
<HintPath Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">..\Example.DynamicMapping.ModuleBuilder\bin\Debug\Example.DynamicMapping.DynamicDatabaseMapping.dll</HintPath>
</Reference>
@dalion619
dalion619 / CreateDynamicDatabaseModelModule
Created September 4, 2018 07:57
Create Dynamic Database Model Module
// Get tables and their columns
var databaseTableInfo = GetDatabaseTableInfo();
AppDomain domain = AppDomain.CurrentDomain;
AssemblyName aName = new AssemblyName("Example.DynamicMapping.DynamicDatabaseMapping");
AssemblyBuilder ab = domain.DefineDynamicAssembly(aName, AssemblyBuilderAccess.Save);
System.Reflection.Emit.ModuleBuilder mb = ab.DefineDynamicModule(aName.Name, aName.Name + ".dll");
// Define mapping static class of the database
TypeBuilder typeDatabaseModel = mb.DefineType("Example.DynamicMapping.DynamicDatabaseMapping.DatabaseModels.DatabaseMapping", TypeAttributes.Public | TypeAttributes.Abstract | TypeAttributes.Sealed);