Skip to content

Instantly share code, notes, and snippets.

Avatar
🐌

David Rio Deiros drio

🐌
View GitHub Profile
View gist:1299
type = ""
split_name.each { |s| type = s if s =~ /csfasta|ftc|txr|cy5|cy3|qual/ }
puts type
View gist:1300
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 Apr 7, 2014
Disable all the monthly reminders for all mailman mailing lists
View disable_mailman_montly_reminder.sh
#!/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
View gist:11265337
### 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:
View foo.py
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 = []
View -
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
View -
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 Dec 10, 2014
Mininal squid config
View min_squid.txt
$ 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
View foo.py
#!/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))
View graphs.py
#!/usr/bin/env python
# vim: set ts=4 sw=4 et foldmethod=indent:
#
import random
from itertools import chain
import sys
_DEBUG = 0