Skip to content

Instantly share code, notes, and snippets.

@ariscop
ariscop / raptor-httpd.sh
Created March 20, 2012 03:01
raptor-httpd, you will be eaten by raptors if you ever use this
#!/bin/bash
http-accept() {
read -r REQ <&3
REQ=`echo "$REQ" | tr '\r\n' ' '`
#read -r LINE <&3
#while [ -n "$LINE" ]; do
# read -r LINE <&3
@ariscop
ariscop / gist:3825731
Created October 3, 2012 08:03
Php fun
class a {
protected $foo = "foo";
function foo() {
print($this->foo);
}
function a() {
$this->foo = "bar";
$this->foo();
}
};
[andrew@andrews-laptop tmp]$ cat test.cpp
#include <string>
using namespace std;
int main(int argc, char *argv[]) {
string *str = new string("test");
}
[andrew@andrews-laptop tmp]$ g++ -nostdlib test.cpp
/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400144
@ariscop
ariscop / main.c
Created May 23, 2013 07:09
subreaper, sets PR_SET_CHILD_SUBREAPER so you can have a nice looking process tree in htop
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/wait.h>
#include <sys/prctl.h>
int main(int argc, char *argv[]) {
if(argc < 2) {
puts("Insufficent parameters");
#!/bin/bash
url="[url]"
stream="[key]"
vb=200
ab=128
width=640
height=480
threads=4
@ariscop
ariscop / dump.py
Created June 14, 2014 05:34
Quick script for extracting the firmware of an Hi351C based ip camera
import struct
import binascii
with open("firmware_HI3518C-V5-ONVIF-V2.5.0.6_20140126124709.bin", "rb") as f:
print(" Magic:", f.read(8))
print(" Unknown:", binascii.hexlify(f.read(4)))
length = struct.unpack("<L", f.read(4))[0]
print(" Length:", length)
print(" Flags?:", struct.unpack("<L", f.read(4))[0])
hdr_len = struct.unpack("<L", f.read(4))[0]
@ariscop
ariscop / blocklist.de.php
Created July 6, 2014 01:33
Apply blocklist.de to shorewall, intended for use as a cron script
<?php
$url = 'http://api.blocklist.de/getlast.php?time=';
$cachefile = '/tmp/blocklist.de.cache';
$cachetime = 0 + @filemtime($cachefile);
$url = $url . $cachetime;
$result = file_get_contents($url);
if (is_string($result)) {
file_put_contents($cachefile, $result, FILE_APPEND);
$arr = explode("\n", $result);
@ariscop
ariscop / isTerminal.c
Created July 19, 2014 08:09
Function to check if a program was launched from cmd/powershell/so on
/* Detect if we're launched outside of cmd by checking for other processes on our console */
BOOL isTerminal(void) {
DWORD pid;
return GetConsoleProcessList(&pid, 1) != 1;
}
@ariscop
ariscop / metroid_record.lua
Created July 22, 2014 11:22
Vba script for metroid fusion, pauses avi recording with the in game timer
prevframes = 0
recording = false
while 1 do
minutes = memory.readbyte(0x3000139)
seconds = memory.readbyte(0x300013A)
frames = memory.readbyte(0x300013B)
if prevframes ~= frames then
avi.resume()
if recording == true then

Keybase proof

I hereby claim:

  • I am ariscop on github.
  • I am ariscop (https://keybase.io/ariscop) on keybase.
  • I have a public key whose fingerprint is BDC0 7E53 3055 BFCF 57EC 2914 F812 A837 9BC0 EE2F

To claim this, I am signing this object: