Skip to content

Instantly share code, notes, and snippets.

Nick Glynn 17twenty

Block or report user

Report or block 17twenty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
17twenty / eclipse.desktop
Created Feb 6, 2014
Downloaded eclipse for Android but doesn't appear in Gnome Shell fix - you will need to save this into a file /usr/share/applications/eclipse.desktop
View eclipse.desktop
[Desktop Entry]
Name=eclipse | Android Developer Tools
GenericName=Integrated Development Environment for Android
Comment=A powerful IDE
17twenty / pythonrc
Created Mar 13, 2014
Python autocomplete
View pythonrc
#!/usr/bin/env python
Set the PYTHONSTARTUP environment variable in our .bashrc (or .bash_profile if you're using that). If the PYTHONSTARTUP variable is set to a readable file, then the contents of that file will be run before anything else when the interactive interpreter is run
echo "export PYTHONSTARTUP=~/.pythonrc" >> .bashrc
import rlcompleter, readline
17twenty /
Created Mar 18, 2014
Got asked about a Binary Search Tree so this is my lazy implementation
#!/usr/bin/env python
class BST():
value = None
left = None
right = None
def __init__(self, value=None):
self.value = value
17twenty / gist:9661270
Last active Aug 29, 2015
Force Python to compile to pyc
View gist:9661270
python -m compileall
# You could also do this programatically
# >>> import py_compile
# >>> py_compile.compile('')
# Note that you need to use Python to run the pyc file as it's not an executable
# The dis module would even let you pull the resultant bytecode back out again!
View shellCodeShell.c
/* Shellcode from
* 17twenty/Nick Glynn
#include <stdio.h>
#include <string.h>
#if __x86_64__
* ;rdi 0x4005c4 0x4005c4
17twenty / gist:10890267
Created Apr 16, 2014
A walkthrough of how to get a shell on Level 4 of Stripes CTF 1.0
View gist:10890267
We're going to use the code from Stripe's Capture the Flag 1.0:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void fun(char *str)
char buf[1024];
17twenty / ethercomm.c
Created Apr 20, 2014
Backdoors... backdoors everywhere!
View ethercomm.c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_arp.h>
#include <arpa/inet.h>
17twenty / output.log
Created May 20, 2014
Output from level10 of smashthestack
View output.log
level10@io:~$ python /tmp/
/levels/level10: relocation error: /levels/level10: symbol _gmon_start__, version GLIBC_2.1 not defined in file with link time reference
/levels/level10: relocation error: /levels/level10: symbol _start__, version GLIBC_2.1 not defined in file with link time reference
/levels/level10: symbol lookup error: /levels/level10: undefined symbol: strcmp, version GLIBC_2.2.4
Inconsistency detected by dl-runtime.c: 87: _dl_fixup: Assertion `((reloc->r_info) & 0xff) == 7' failed!
*** glibc detected *** /levels/level10: double free or corruption (!prev): 0x0804a008 ***
======= Backtrace: =========
17twenty / learn_something_new.c
Created May 23, 2014
Learn something new about passing arrays, and how awful the syntax can be :D
View learn_something_new.c
/* gcc -std=c99 due to loop initialiser - stupid GCC defaulting to C89 :( */
#include <stdio.h>
#define ARRAY_SIZE(x) \
((sizeof(x) / sizeof(x[0])))
void count_and_process_items(unsigned int (*array)[10])
for (int i = 0; i < ARRAY_SIZE(*array); ++i) {
printf("Item %d = %d\n", i, (*array)[i]);
17twenty /
Created Jun 13, 2014
Quick Suffix rename script
# Replace the .sh and .txt in the next line with the current and future file suffixes
for i in $(find . -iname *\.sh -print;) ; do mv "$i" "$(dirname $i)/$(basename -s .sh $i).txt"; done
You can’t perform that action at this time.