Skip to content

Instantly share code, notes, and snippets.

#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#define MAX_BUF 1024
#define pipename "\\\\.\\pipe\\LogPipe"
int main()
{
HANDLE pipe = CreateFile(pipename, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
if (pipe == INVALID_HANDLE_VALUE)
@FedericoPonzi
FedericoPonzi / tmux-cheatsheet.markdown
Created October 8, 2015 13:10 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@FedericoPonzi
FedericoPonzi / FizzBuzzTest.java
Last active June 7, 2016 09:29
My solution for the fizzbuzz test, in java
public class FizzBuzzTest
{
public static void main(String[] args)
{
for (int i = 1; i <= 100; i++)
{
String toPrint;
if(i%3 == 0 && i%5 == 0)
toPrint = "FizzBuzz";
@FedericoPonzi
FedericoPonzi / FibonacciClosure.go
Created December 17, 2015 10:32
Fibonacci closure made in GOlang
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
nMeno1 := 0
nMeno2 := 1
return func() int {
@FedericoPonzi
FedericoPonzi / ArraySum.go
Created December 18, 2015 10:33
Sum of the elements of an array using multithreading and dividi et impera in Golang.
package main
import "fmt"
func dividiEtImpera( arr []int, low int, hi int, ch chan int){
if hi - low == 1{
// fmt.Println("low: ", low, " hi:", hi, " Caso hi-low==1, ritorno:",arr[hi-1], "+", arr[low]
ch <- arr[hi-1] + arr[low]
} else if hi-low == 0{
@FedericoPonzi
FedericoPonzi / md5cracker.go
Created December 23, 2015 20:05
A md5 bruteforce cracker multithreaded in go.
package main
import (
"fmt"
"io/ioutil"
"strings"
"sync"
"log"
"time"
"crypto/md5"
@FedericoPonzi
FedericoPonzi / wifikill.sh
Last active January 27, 2020 10:47
A Wifikill made in bash using nmap and arpspoof.
#!/bin/bash
#Federico Ponzi
#doylefermi
#chocolatkey
# GPLv2
usage()
{
echo "Usage: $0 [-all][-list][-i] xxx.xxx.xxx.xxx"
}
@FedericoPonzi
FedericoPonzi / church.sml
Created January 21, 2016 11:26
Church numbers in sml
(* numeri di Church *)
val zero = fn f => fn x => x;
val uno = fn f => fn x => f x;
val due = fn f => fn x => f (f x);
val tre = fn f => fn x => f (f (f x));
(* dato un naturale, si ottiene il corrispondente numero
di Church applicando la seguente funzione di codifica *)
import socket
import MergeSort
HOST = '192.168.1.1'
PORT = 50007
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
#Receives arraystring in chunks
# -*- coding: utf-8 -*-
"""Convert the Yelp Dataset Challenge dataset from json format to csv.
For more information on the Yelp Dataset Challenge please visit http://yelp.com/dataset_challenge
"""
import argparse
import collections
import csv
import simplejson as json