Skip to content

Instantly share code, notes, and snippets.

@offlinemark
offlinemark / librequests_test.txt
Created May 6, 2014 02:32
Simple test file for librequests' unit tests.
Simple test file for librequests.

Keybase proof

I hereby claim:

  • I am mossberg on github.
  • I am mossberg (https://keybase.io/mossberg) on keybase.
  • I have a public key whose fingerprint is 1ACB 9543 0E0A 878F B81D 312E 5B8E FE62 E76A E055

To claim this, I am signing this object:

@offlinemark
offlinemark / hacky_arrays.c
Created October 29, 2014 22:23
C Array Hax
#include <stdio.h>
int main(int argc, const char *argv[])
{
int arr[4] = {0, 1, 2, 3};
printf("%p\n", arr); // an array is a pointer
printf("%p\n", &arr); // pointer to array (equal to above)
printf("%p\n", &arr+1); // due to pointer arithmetic, address of one past end of arr
printf("%p\n", *(&arr+1)); // pointer to one past end of array (equal to above)
printf("%lu\n", *(&arr+1) - arr); // length of arr, due to pointer arithmetic
@offlinemark
offlinemark / pushgen.py
Last active January 25, 2023 17:23
Shellcode helper. Given a string, generate push instructions to push string onto stack.
#!/usr/bin/env python
'''
Tool for writing shellcode. Give it a string to push onto the stack and it
generates the corresponding push instructions.
'''
import sys
egrep '[^_.>a-zA-Z0-9](str(n?cpy|n?cat|xfrm|n?dup|str|pbrk|tok|_)|stpn?cpy|a?sn?printf|byte_)'
$ pandoc --from markdown --to html thing.md --standalone -c bootstrap.min.css > lol.html
========
<div class="container">
# thing
- this is a thing
https://help.ubuntu.com/community/BIND9ServerHowto#Configuring_BIND9
http://askubuntu.com/questions/330148/how-do-i-do-a-complete-bind9-dns-server-configuration-with-a-hostname
http://www.servermom.org/how-to-install-and-setup-bind9-on-ubuntu-server/136/
http://www.cyberciti.biz/faq/howto-enable-dns-linux-unix-server-logging/
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
https://www.digitalocean.com/community/tutorials/how-to-install-joomla-on-a-virtual-server-running-ubuntu-12-04
https://dev.virtuemart.net/projects/virtuemart/files
http://docs.virtuemart.net/tutorials/30-installation-migration-upgrade-vm-2/80-installation-of-virtuemart-2
https://www.gavick.com/documentation/supported-third-party-extensions-for-joomla/virtuemart-e-commerce-component/how-to-install-virtuemart
4.10 Warty Warthog 2.6.8
5.04 Hoary Hedgehog 2.6.10
5.10 Breezy Badger 2.6.12
6.06 Dapper Drake 2.6.15
6.10 Edgy Eft 2.6.17
7.04 Feisty Fawn 2.6.20
7.10 Gutsy Gibbon 2.6.22
8.04 Hardy Heron 2.6.24
8.10 Intrepid Ibex 2.6.27
9.04 Jaunty Jackalope 2.6.28
# set Ctrl-a as the default prefix key combination
# and unbind C-b to free it up
set -g prefix C-a
unbind C-b
# use send-prefix to pass C-a through to application
bind C-a send-prefix
# set window and pane index to 1 (0 by default)
@offlinemark
offlinemark / bin2ascii.py
Created March 3, 2015 16:16
Convert binary string to ascii pretty cleanly
import sys
def main():
if len(sys.argv) != 2:
print 'Usage: {} <binary string>'.format(sys.argv[0])
return
# get index of MSB of every byte
indices = range(0, len(sys.argv[1]), 8)