Skip to content

Instantly share code, notes, and snippets.

View drio's full-sized avatar
🐢
I don't know

David Rio Deiros drio

🐢
I don't know
View GitHub Profile
type = ""
split_name.each { |s| type = s if s =~ /csfasta|ftc|txr|cy5|cy3|qual/ }
puts type
type = ""
split_name.each { |s| type = s if s =~ /csfasta|ftc|txr|cy5|cy3|qual/ }
puts type
@drio
drio / disable_mailman_montly_reminder.sh
Created April 7, 2014 18:23
Disable all the monthly reminders for all mailman mailing lists
#!/bin/bash
# vim: ts=2 et:
#
bin=/usr/local/cpanel/3rdparty/mailman/bin
for l in $($bin/list_lists -b)
do
# send_reminders = 0
echo $l
$bin/config_list -o - $l > /tmp/mm.config.$l # backup just in case
### Keybase proof
I hereby claim:
* I am drio on github.
* I am drio (https://keybase.io/drio) on keybase.
* I have a public key whose fingerprint is 3D44 E56A C375 3208 7D97 9345 C0CE DAC1 5033 FCC8
To claim this, I am signing this object:
@drio
drio / foo.py
Created September 10, 2014 20:09
class Solution(object):
def __init__(self):
"""
h_items is a hash (key = item, value = number of items purchased (counts))
items_sorted is the list of items sorted by the counts
space cost: O(n*n) ~ O(n)
"""
self.h_items = {}
self.items_sorted = []
@drio
drio / -
Created November 10, 2014 21:26
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
113-128-99-163-128-114-147-115-71-97-147
128-99-163-128-114-147-115-71-97-147-113
128-99-163-128-114-147-115-71-97-147-113
@drio
drio / -
Created November 10, 2014 21:28
LQVYQNFDAPF 113-128-99-163-128-114-147-115-71-97-147
LQVYKNFDAPF 113-128-99-163-128-114-147-115-71-97-147
LKVYQNFDAPF 113-128-99-163-128-114-147-115-71-97-147
LKVYKNFDAPF 113-128-99-163-128-114-147-115-71-97-147
IQVYQNFDAPF 113-128-99-163-128-114-147-115-71-97-147
IQVYKNFDAPF 113-128-99-163-128-114-147-115-71-97-147
IKVYQNFDAPF 113-128-99-163-128-114-147-115-71-97-147
IKVYKNFDAPF 113-128-99-163-128-114-147-115-71-97-147
QVYQNFDAPFI 128-99-163-128-114-147-115-71-97-147-113
QVYQNFDAPFL 128-99-163-128-114-147-115-71-97-147-113
@drio
drio / min_squid.txt
Created December 10, 2014 17:18
Mininal squid config
$ cd dev
$ wget squid ...
$ tar zxvf ...
$ cd squid-...
$ ./configure -prefix=$HOME/local && make && make install
$ cat squid.conf
auth_param digest program /home/drio/dev/squid-3.4.10/helpers/digest_auth/file/digest_file_auth -c /home/drio/dev/squid-3.4.10/passwords
auth_param digest realm proxy
acl authenticated proxy_auth REQUIRED
@drio
drio / foo.py
Created December 11, 2014 15:04
#!/usr/bin/env python
# vim: set ts=4 sw=4 et foldmethod=indent paste:
#
# ---
people = [{'name': 'Mary', 'height': 160},
{'name': 'Isla', 'height': 80},
{'name': 'Sam'}]
hs = map(lambda o: o['height'], filter(lambda o: 'height' in o, people))
#!/usr/bin/env python
# vim: set ts=4 sw=4 et foldmethod=indent:
#
import random
from itertools import chain
import sys
_DEBUG = 0