Skip to content

Instantly share code, notes, and snippets.

@hermanocabral
hermanocabral / Program.cs
Created January 28, 2012 16:45
RavenDB embedded test
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using Raven.Client;
using Raven.Client.Embedded;
using Raven.Database.Plugins;
@hermanocabral
hermanocabral / gist:6276660
Created August 20, 2013 03:03
Error installing Geddy on Windows 7
PS C:\Users\HCN> npm install -g geddy
npm http GET https://registry.npmjs.org/geddy
npm http 304 https://registry.npmjs.org/geddy
npm http GET https://registry.npmjs.org/barista
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/utilities
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/model
npm http GET https://registry.npmjs.org/jake
npm http 304 https://registry.npmjs.org/socket.io
@hermanocabral
hermanocabral / DDSImageParser.cs
Created October 19, 2015 07:03 — forked from soeminnminn/DDSImageParser.cs
Read DDS image in C# way.
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
namespace S16.Drawing
{
public class DDSImage
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
namespace S16.Drawing
{
public class DDSImage
@hermanocabral
hermanocabral / Program.cs
Created June 1, 2016 17:34 — forked from ovrmrw/Program.cs
Topshelf + OWIN Self-Host + ASP.NET WebAPI + Ninject
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Tracing;
using System.Reflection;
using Owin;

Keybase proof

I hereby claim:

  • I am hermanocabral on github.
  • I am hermanocabral (https://keybase.io/hermanocabral) on keybase.
  • I have a public key whose fingerprint is 47E7 E2AD 61EC 71FB A804 95A7 E7A9 A7A3 5444 3C22

To claim this, I am signing this object:

@hermanocabral
hermanocabral / fields.py
Created April 12, 2017 00:57 — forked from yprez/fields.py
Django rest framework - Base64 image field
import base64
from django.core.files.base import ContentFile
from rest_framework import serializers
class Base64ImageField(serializers.ImageField):
def from_native(self, data):
if isinstance(data, basestring) and data.startswith('data:image'):
# base64 encoded image - decode
774f 4646 0001 0000 0000 3d54 000e 0000
0000 5940 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 4646 544d
0000 3d38 0000 001c 0000 001c 5f7e 70ab
4744 4546 0000 3d14 0000 0022 0000 0028
0096 0024 4f53 2f32 0000 01b8 0000 0047
0000 0056 85b4 f225 636d 6170 0000 0364
0000 00b6 0000 015a b15a f47a 6376 7420
0000 041c 0000 0004 0000 0004 0021 0279
6761 7370 0000 3d0c 0000 0008 0000 0008
@hermanocabral
hermanocabral / CreateGhidraApp.sh
Created February 28, 2023 08:18 — forked from saagarjha/CreateGhidraApp.sh
Creates a Ghidra.app bundle for macOS
#!/bin/sh
set -eu
create_iconset() {
mkdir -p Ghidra.iconset
cat << EOF > Ghidra.iconset/Contents.json
{
"images":
[
@hermanocabral
hermanocabral / ao_dissector.lua
Created May 8, 2023 10:33 — forked from Green-Sky/ao_dissector.lua
albion online wireshark dissector (some photon stuff only atm)
-- albion online wireshark dissector.... or at least a beginning
-- used as ref: https://github.com/rafalfigura/AO-Radar/blob/master/AlbionRadaro/PhotonPacketHandler/PhotonPacketHandler.cs
-- (c) Green Sky
photon_protocol = Proto("Photon", "Photon Protocol")
peer_id = ProtoField.uint16("photon.peer_id", "peer_id", base.DEC)
crc_enabled = ProtoField.bool( "photon.crc_enabled", "crc_enabled")
command_count = ProtoField.uint8( "photon.command_count", "command_count", base.DEC)
time_stamp = ProtoField.int32( "photon.time_stamp", "time_stamp", base.DEC)