Skip to content

Instantly share code, notes, and snippets.

cvs -q up -Pd -A

mbsd murilobsd

cvs -q up -Pd -A
Block or report user

Report or block murilobsd

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
murilobsd / main.c
Created Aug 22, 2019 — forked from josephg/main.c
kqueue network & file example
View main.c
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/event.h>
#include <netdb.h>
#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>

DHT Walkthrough Notes

I've put together these notes as I read about DHT's in depth and then learned how the libtorrent implementation based on the Kademlia paper actually works.

What problem does this solve?

400,000,000,000 (400 billion stars), that's a 4 followed by 11 zeros. The number of atoms in the universe is estimated to be around 10^82. A DHT with keys of 160 bits, can have 2^160 possible numbers, which is around 10^48

murilobsd /
Created Jul 3, 2018
Telegram Bot example
#!/usr/bin/env python
from __future__ import print_function
import datetime
import os
import random
import re
import time
import telepot
"""Simples script para baixar imagens do captcha do portal TJSP.
Copyright (c) 2016, Murilo Ijanc
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
import asyncio
from bson import ObjectId
class MongoAuthPlugin(BaseAuthPlugin):
def __init__(self, context):
self._db = db
#!/usr/bin/env python
# coding=utf-8
import urllib2
import argparse
import facebook
import time
import random
import re
from lxml import html
murilobsd / consulta
Last active Aug 29, 2015
consulta juristec
View consulta
<?xml version="1.0" encoding="utf-8"?>
<!-- ***************************************************-->
<!-- *** Schema juristec XML ***-->
<!-- *** Lab804 ***-->
<!-- ***************************************************-->
class CyclePostTest(TestCase):
def setUp(self):
user = User.objects.create_user('murilo', '', 'murilo')
farm = Farm.objects.create(user=user, name='teste', full_area='123.45', uncultivated_area='0.00')
self.client.login(username='murilo', password='murilo')
data = dict(farm=farm, user=user, name='2014')
self.resp ='/ciclo/cadastrar/', data)
def test_post(self):
'Valid Post should redirect to /ciclo/1/.'
# encoding: utf-8
from django.test import TestCase
from django.contrib.auth.models import User
from django.test.client import Client
from django.template.defaultfilters import slugify
from django.test.client import RequestFactory
from fazenda.core.models import Fazenda
from fazenda.core.views import FazendaDetail
View upload.html
{% extends 'base.html' %}
{% load breadcrumbs %}
{% block breadcrumbs %}
{% breadcrumb 'Upload' %}
{% endblock %}
{% block css_especifico %}
<link rel="stylesheet" href="{{ STATIC_URL }}assets/css/dropzone.css">
{% endblock %}
{% block title %}Upload{% endblock %}
You can’t perform that action at this time.