Skip to content

Instantly share code, notes, and snippets.

# Based on simple-wireless.tcl
# ======================================================================
# Options
# ======================================================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# containment.py
# use shingling technique to compute text containment
#
# {ikalantzis,vrachnis}@ceid.upatras.gr
#
import sys
#!/usr/bin/python
def euclidExtended(a, b):
if b == 0:
return a, 1, 0
dd, xx, yy = euclidExtended(b, a % b)
d, x, y = dd, yy, xx - int(a / b) * yy
# print a, b, d, x, y
return d, x, y
#!/bin/bash
#
# The script to sync a local mirror of the Arch Linux repositories and ISOs
#
# Copyright (C) 2007 Woody Gilk <woody@archlinux.org>
# Modifications by Dale Blount <dale@archlinux.org>
# and Roman Kyrylych <roman@archlinux.org>
# Licensed under the GNU GPL (version 2)
# Filesystem locations for the sync operations
void my_barrier_wait()
{
pthread_mutex_lock(mutex_var);
arrived++;
if (arrived == total) {
arrived = 0;
pthread_cond_broadcast(cond_var);
} else {
pthread_cond_wait(cond_var, mutex_var);
}
class User:
def __init__(self, name, surname, age):
self.name = name
self.surname = surname
self.age = age
def __getitem__(self, key):
return getattr(self, key)
#include <stdio.h>
#include <string.h>
int main (int argc, char const *argv[])
{
static char upcase[] =
"\0______________________________"
"_________________0123456789_____"
"__ABCDEFGHIJKLMNOPQRSTUVWXYZ____"
"__ABCDEFGHIJKLMNOPQRSTUVWXYZ____"
#
# netgrowl-notify.py
# Weechat plugin for remote Growl notifications.
#
# Based on the gnotify plugin (http://www.weechat.org/scripts/source/stable/gnotify.py)
# and netgrowl (http://the.taoofmac.com/space/projects/netgrowl)
#
import weechat
from netgrowl import *
#!/usr/bin/python
"""
client.py
simple port knocking client
Usage: ./client.py <server address> <udp_port1> <udp_port2> ... <tcp_port>
{ikalantzis, vrachnis}@ceid.upatras.gr
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import eventlet
from eventlet.green import urllib2
from BeautifulSoup import BeautifulSoup as bs
import urlparse
class Crawler(object):