Skip to content

Instantly share code, notes, and snippets.

View AdamMagaluk's full-sized avatar
🚀

Adam Magaluk AdamMagaluk

🚀
View GitHub Profile
@AdamMagaluk
AdamMagaluk / primer.md
Created September 17, 2013 14:42
Git Windows Primer
@AdamMagaluk
AdamMagaluk / test.js
Last active November 17, 2022 14:04
Node.js aes 128 ecb encryption issue
var key = new Buffer('E8E9EAEBEDEEEFF0F2F3F4F5F7F8F9FA','hex');
var text = '6743C3D1519AB4F2CD9A78AB09A511BD';
var decipher = crypto.createDecipheriv('AES-128-ECB',key,'');
//decipher.setAutoPadding(false); this makes it work?
var k1 = decipher.update(text,'hex','hex'); // Why is this ''???
var k2 = decipher.update(text,'hex','hex');
console.log("de k1:" + k1) // is equal to '' but should be 014baf2278a69d331d5180103643e99a
console.log("de k2:" + k2) // is equal to 014baf2278a69d331d5180103643e99a
@AdamMagaluk
AdamMagaluk / memlog.sh
Created November 25, 2013 17:28
Memory log script
#!/bin/bash
rm mem.log
while true; do
t=`date +%s`
data=`ps -C lt-v3node -o pid=,rss=,vsz=`
echo $t $data >> mem.log
echo $t $data
#gnuplot gnuplot.script
@AdamMagaluk
AdamMagaluk / gw-monit-check
Created November 26, 2013 00:39
Monit config for gw.
check host GW-lans-1 address 166.250.67.37
if failed port 9191 type tcp
with timeout 10 seconds for 3 cycles
then alert
if failed port 2222 type tcp
with timeout 10 seconds for 3 cycles
then alert
@AdamMagaluk
AdamMagaluk / setup_jennic.sh
Created November 29, 2013 21:14
Little bash script to setup development of Jennic 5148 modules on Linux using Wine.
#/bin/bash
#Check if script is in Jennic Dir
if [ ! -d "Stack" ]; then
echo "Script does not appear to be ran in Jennic directory."
exit 2
fi
# Check if wine is installed
command -v wine >/dev/null 2>&1 || { echo >&2 "Please install wine. Aborting."; exit 1; }
@AdamMagaluk
AdamMagaluk / AircrackSetup.md
Created December 6, 2013 16:27
Rasberry Pi Setup

Raspberry Aircrack Setup

# Install libssl-dev
sudo apt-get -y install libssl-dev

# Download and install aircrack
wget http://download.aircrack-ng.org/aircrack-ng-1.2-beta1.tar.gz
tar -zxvf aircrack-ng-1.2-beta1.tar.gz
cd aircrack-ng-1.2-beta1
#include <Adafruit_CC3000.h>
#include <SPI.h>
#include "utility/debug.h"
#include "utility/socket.h"
// These are the interrupt and control pins
#define ADAFRUIT_CC3000_IRQ 3 // MUST be an interrupt pin!
// These can be any two pins
#define ADAFRUIT_CC3000_VBAT 5
@AdamMagaluk
AdamMagaluk / EchoServer.ino
Created January 6, 2014 20:56
Sketch for bug report for CC3000 lib
/***************************************************
Adafruit CC3000 Breakout/Shield TCP Echo Server
This is a simple implementation of the echo
protocol, RFC 862 http://tools.ietf.org/html/rfc862 ,
for the Arduino platform and Adafruit CC3000 breakout
or shield. This sketch will create a TCP server that
listens by default on port 7 and echos back any data
received. Up to 3 clients can be connected concurrently
@AdamMagaluk
AdamMagaluk / install-mdb.sh
Created January 26, 2014 00:31
Install mdb tools on Mac
brew install glib gettext automake
brew link --force gettext
git clone it://gitorious.org/mdbtools/mainline.git
cd mdbtools
./autogen.sh --enable-sql --disable-gmdb2 --disable-glibtest
make
make install
var http = require('http');
var net = require('net');
var async = require('async');
var websocket = require('websocket-stream');
var Parser = require('./parser.js');
var multiplexer = new Parser();
function proxyws(id,callback){