Skip to content

Instantly share code, notes, and snippets.

View LeoAdamek's full-sized avatar

Leo Adamek LeoAdamek

View GitHub Profile
@LeoAdamek
LeoAdamek / IPv6 Lister.c
Last active September 25, 2015 00:37
List All IPv6 Addresses in teh world using Inseption for loops.
#include <cstdlib>
#include <cstdio>
int main(int argc, char* argv[])
{
int a,b,c,d,e,f,g,h;
FILE* fp;
fp = fopen("ipv6.txt","w");
@LeoAdamek
LeoAdamek / PortCheckerClientThingy.cs
Last active September 25, 2015 00:38
Some scripy cody thing to check open / forwarded ports.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;
using System.Windows.Forms;
@LeoAdamek
LeoAdamek / Port Checker Client
Created February 19, 2011 18:42
Client for checking open ports
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
@LeoAdamek
LeoAdamek / code_collate.sh
Created October 17, 2011 17:56
A "Simple" Script to take all text files in a directory and put them into one collated file, usefull if you have an assignment with requires it
#!/bin/bash
for filename in $(find . -type f)
do
f_type=$(file -b $filename)
if [ "${f_type##* }" == "text" ]
then
echo "###################### FILE: ${filename} #######################" >> collated_code.txt
cat ${filename} >> collated_code.txt
echo "###################### END FILE ${filename} ####################" >> collated_code.txt
@LeoAdamek
LeoAdamek / users.case.php
Created October 24, 2011 23:51
Test Case for Users
<?php
/* User Test cases generated on: 2011-10-20 19:08:19 : 1319134099*/
App::import('Model', 'User');
class UserTestCase extends CakeTestCase {
var $fixtures = array('app.user');
function startTest() {
$this->User =& ClassRegistry::init('User');
}
#!/bin/bash
# CONFIG
# DEBUG: Set this to 1 if you want debug info
debug=1
lines=0
@LeoAdamek
LeoAdamek / daemon.py
Created January 20, 2012 15:17
Base of the HTTP Handler for GamePy CP
"""
GamePy CP Daemon
(CC-BY) Leo Adamek 2012
"""
__author__ = 'Leo Adamek'
import BaseHTTPServer
from socket import gethostbyname, gethostname
import sys
@LeoAdamek
LeoAdamek / bogosort.by
Created January 22, 2012 17:35
Bogosort - The world's least efficient sorting algorithm ever. Best O(n), average O(n * n!), worst O(infinity)
from random import randint as r
from random import shuffle
from time import time
from datetime import timedelta
def bogosort(d):
sorted = checkOrder(d)
while not sorted:
shuffle(d)
@LeoAdamek
LeoAdamek / NumberGame.py
Created January 30, 2012 17:49
Simplist numbergame
# NumberGame.py - Most simple program
from random import randint
number_to_guess = randint(1,100)
guess = input('Enter a number between 1 and 100: ')
while not guess == number_to_guess:
if guess > number_to_guess:
print "Too High."
@LeoAdamek
LeoAdamek / NumberGame_improved.py
Created January 30, 2012 17:54
Improved Number Game
# NumberGame.py - Improved Program
from random import randint
def get_guess():
proper_input = False
while not proper_input:
guess_input = raw_input('Enter a number between 1 and 100: ')
try:
guess = int(guess_input)