Skip to content

Instantly share code, notes, and snippets.

#ifndef DYNAMICARRAY_H
#define DYNAMICARRAY_H
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
template<typename T>
@landaire
landaire / led_tits.ino
Last active December 22, 2015 14:48
Sample arduino code
int ledSpeed = 1, buttonVal = 0, ledState = 0;
const int buttonPin = 7, buttonPressAcknowledgedPin = 11;//, allOnPin = 11, blinkingPin = 4;
const int ledPins[] =
{
2, // red
8, // yellow
12 // blue
};
@landaire
landaire / xval.go
Created July 11, 2013 04:55
A golang implementation of Redline99's x-value decryption code
package xval
import (
"bytes"
"crypto/des"
"crypto/hmac"
"crypto/sha1"
"encoding/binary"
"encoding/hex"
"errors"
@landaire
landaire / id3.go
Last active December 19, 2015 14:58
Code for modifying songs on the fly with Revel, go-taglib, and binarydist
package controllers
import (
"bitbucket.org/kardianos/osext"
"bluefish/app/models"
"bytes"
"crypto/sha1"
"errors"
"fmt"
"github.com/kr/binarydist"
@landaire
landaire / auth.go
Created July 10, 2013 06:44
HTTP Basic Auth for Revel
package controllers
import (
"encoding/base64"
"errors"
"github.com/robfig/revel"
"net/http"
"strings"
)
@landaire
landaire / Processbootsector.cs
Created June 17, 2013 23:03
Terrible party buffalo code
void ProcessBootSector()
{
Exception InvalidSectorsPerCluster = new Exception("FATX: found invalid sectors per cluster");
Exception InvalidBytesPerSector = new Exception("FATX: invalid bytes per cluster for growable file partition");
Exception TooSmallClusterSize = new Exception("FATX: found too small of cluster size");
Exception VolumeTooSmall = new Exception("FATX: volume too small to hold the FAT");
Exception TooManyClusters = new Exception("FATX: too many clusters");
// r31 = r3 + 0xa8
@landaire
landaire / music.rb
Last active December 16, 2015 05:38
Monitors a directory for new MP3 files and moves them to a different directory
require 'fileutils'
DOWNLOADS_PATH = '/Users/lander/Downloads'
while true
Dir.foreach(DOWNLOADS_PATH) do |entry|
next if !(entry =~ /.mp3$/i)
begin
FileUtils.mv(File.join(DOWNLOADS_PATH, entry), '/Users/lander/ext_music')
puts "Moved: #{File.join(DOWNLOADS_PATH, entry)}}"
@landaire
landaire / mountgamedir.cpp
Created July 25, 2012 22:32
Mount game directory
extern "C" char* ExLoadedImageName; // not sure if this actually works or not. If it doesn't do:
// XexGetProcedureAddress(KernelHandle, 431, &LoadedImageName); // ExLoadedImageName
typedef struct _AnsiString {
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
} AnsiString;
@landaire
landaire / xval.rb
Created July 22, 2012 21:19
Ruby implementation of Redline99's "X" value decryption code (Xbox 360)
# xval.rb - Ruby implementation of Redline99's "X" value decryption code for the Xbox 360 by CLK
# See https://gist.github.com/2669789 for Python code
require 'optparse'
require 'openssl'
# Define our constants
FLAG_SSB_NONE = 0x0000
FLAG_SSB_AUTH_EX_FAILURE = 0x0001
FLAG_SSB_AUTH_EX_NO_TABLE = 0x0002
FLAG_SSB_AUTH_EX_RESERVED = 0x0004
@landaire
landaire / xval.py
Created May 13, 2012 00:06
Decrypt XVal
# XVal.py By Redline99
# Decrpyts the "X:" Value from the Xbox 360 dashboard
# This can indicate if the console has been flagged
# for some types of security violations
# Originally posted at XboxHacker: http://www.xboxhacker.org/index.php?topic=16401.0
import sha, hmac, struct, sys
FLAG_SSB_NONE = 0x0000
FLAG_SSB_AUTH_EX_FAILURE = 0x0001
FLAG_SSB_AUTH_EX_NO_TABLE = 0x0002