Skip to content

Instantly share code, notes, and snippets.

View kanazux's full-sized avatar
🏠
Working from home

Silvio Giunge a.k.a kanazuchi kanazux

🏠
Working from home
View GitHub Profile
@kanazux
kanazux / parse_csv.py
Last active August 29, 2015 13:56
An parse to content in txt file to csv file
#!/usr/local/bin python
# -*- coding: iso-8859-1 -*-
# autor: Silvio Giunge (kanazuchi)
# export content in txt file to csv file
import re
import os
import sys
from string import digits
from subprocess import check_output
@kanazux
kanazux / consumer.c
Last active August 29, 2015 13:56
consumer em c
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <curl/curl.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#define MAX_STRING_LEN 6000002
#define NUMT 4
@kanazux
kanazux / newconsumer.c
Created February 17, 2014 19:35
newconsumer.c
#include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#define MAX_STRING_LEN 6000002
size_t read_data (char *bufptr, size_t size, size_t nitems, void *userp)
def findserie(serie,season,srange,frange):
import os
nserie = serie.replace(" ","_")
os.system("firefox -P default &")
for x in range(srange,frange):
os.system("firefox -p default --new-tab http://thepiratebay.se/search/%s\ s%se%s\/0\/7\/0" % (nserie,"{:02d}".format(season),"{:02d}".format(x)))
@kanazux
kanazux / getchar_to_op.c
Last active August 29, 2015 13:57
escolha a operação através de uma letra
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char letra;
float numb1, numb2, result;
printf("Digite o primeiro numero da operacao:");
@kanazux
kanazux / search_pkts.py
Last active August 29, 2015 13:57
Get packets from url with list of packets for freebsd or another unix distro
#!/usr/local/bin/env python
#
# written by kanazuchi
#
import re
import sys
from urllib2 import urlopen
def search_pkts(url, pkt):
@kanazux
kanazux / def_defaultdict.py
Created April 2, 2014 12:37
Default dict on python collections module
from collections import defaultdict
dicionario = defaultdict(list)
fox1982 = {"ano" : "2008", "cor" : "branco", "revisao" : "ok"}
fox8219 = {"ano" : "2009", "cor" : "branco", "revisao" : "not ok"}
dicionario['carros'].append(fox1982)
dicionario['carros'].append(fox8219)
@kanazux
kanazux / gabriel.c
Created April 15, 2014 13:08
Gabriel
#include "stdlib.h"
#include "stdio.h"
int main(){
int x=0,y;
while(x<=20){
printf("Digite um numero\n");
@kanazux
kanazux / get_iface_ip.py
Created May 12, 2014 17:58
get iface inet
#!/usr/bin/env/python
# -*- coding: utf-8 -*-
import re
from subprocess import check_output as ck
get_ifaces = ck(['/sbin/ifconfig'], shell=1).split()
if_ips = []
for item in [re.sub('addr:','',item) for item in get_ifaces if re.match(r'eth[0-9](:[0-9])?|addr:[0-9]',item)]:
@kanazux
kanazux / vimrc
Last active August 29, 2015 14:01
vimrc
"*****************************************************************************
"" NeoBundle core
"*****************************************************************************
if has('vim_starting')
set nocompatible " Be iMproved
" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif