This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pfreixes, 2012-07-27 | |
# Add to /etc/bash_completion.d/supervisorctl | |
_supervisor() | |
{ | |
local cur prev opts base | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.hashers import BasePasswordHasher | |
class TestPasswordHasher(BasePasswordHasher): | |
""" | |
Just for testing propuses to be used in test environments | |
and avoid CPU BOUND operations by current installed | |
pasword hashers. | |
""" | |
algorithm = "test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /render?target=x | |
^ | |
| | | |
| | | |
| | | |
+--|---------------------------+ | |
| | | | | |
| | +--------------+ | | |
| | | consolidation| | | |
| | +--------------+ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whisper data base format | |
------------------------ | |
Byte Map of whisper file format | |
+------------------+ | |
| Aggregation func | 4 bytes - Type of allocate strategies for file | |
+------------------+ * Use of fallocate if it is available, book the disk space | |
| Max time | * Use of sparse, fragmented, if it is configured. | |
| retention | 4 bytes * Booking whole space writing zeros over there |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Whisper example of update value | |
------------------------------- | |
Have a look to Whisper data format map to learn how it is https://gist.github.com/pfreixes/1b4c9f0cf1c2bd19edf9 | |
Network packets : ts value | |
+------------------+ | |
| 1401614544 10.0 | packet 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Programs not ported to Python 3 that they are using specific | |
operations with strings could raise undesirable bugs""" | |
>>> title = "Open binary file with python 3" | |
>>> fd = open("/tmp/wut.png", "rb") | |
>>> b = fd.read() | |
>>> type(b) | |
<class 'bytes'> | |
>>> b[0] == "\x89" | |
False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List of available events and their topics used by | |
rabbitmq-event-exchange. | |
queue.* | |
consumer.* | |
user.* | |
permission.* | |
channel.* | |
policy.* | |
vhost.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.test.find().count() | |
13 | |
> db.test.find() | |
{ "_id" : "01-02" } | |
{ "_id" : "01-01" } | |
{ "_id" : "01-03" } | |
{ "_id" : "02-01" } | |
{ "_id" : "02-02" } | |
{ "_id" : "02-03" } | |
{ "_id" : "03-01" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Boolean are integers, integers are immutable and immutable objects are shared along the life cycle of your programm. Then it comes true | |
>>> False is False | |
True | |
>>> 123 is 123 | |
True | |
>>> [1] is [1] | |
False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
UPPER_ITERATIONS = 10000000 | |
def fac(n): | |
if n == 0: | |
return 1 | |
return n * fac(n - 1) | |
OlderNewer