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
#!/bin/bash | |
# Wonder Shaper | |
# please read the README before filling out these values | |
# | |
# Speed/Rate syntax: tcng vs. tc | |
# source: http://www.faqs.org/docs/Linux-HOWTO/Traffic-Control-tcng-HTB-HOWTO.html | |
# | |
# tcng English tc | |
# ---------------------------------------------- | |
# bps bit(s) per second bit |
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
[diff] | |
tool = pycharm | |
[difftool "pycharm"] | |
cmd = /usr/local/bin/pycharm diff "$LOCAL" "$REMOTE" && echo "Press enter to continue..." && read | |
[merge] | |
tool = pycharm | |
keepBackup = false | |
[mergetool "pycharm"] | |
cmd = /usr/local/bin/pycharm merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED" |
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
def validate_account_number(value): | |
checksum = sum(int(value[i]) * (8-i) for i in range(7)) % 11 | |
last_digit = int(value[-1]) | |
if checksum in [0, 10]: | |
c = 1 | |
elif checksum == 1: | |
c = 0 | |
else: | |
c = 11 - checksum |
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
def note_error(self, *msg): | |
if self.strict: | |
raise PermError(*msg) | |
# if lax mode, note error and continue | |
if not self.perm_error: | |
try: | |
raise PermError(*msg) | |
except PermError as x: | |
# FIXME: keep a list of errors for even friendlier diagnostics. | |
self.perm_error = x |
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
#!/bin/bash | |
# CONFIGURATION | |
openssl_config_file=$(openssl ca 2>&1 | grep "Using configuration from" | sed 's/Using configuration from //g') | |
################################################################################ | |
txtgrn='\e[0;32m' | |
txtred='\e[0;31m' | |
txtrst='\e[0m' | |
config_tempfile=$(mktemp --suffix openssl) |
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
#!/bin/bash | |
number=$RANDOM | |
let "number %= 10" | |
if [[ $number -gt 8 ]] | |
then | |
echo "Success" | |
exit 0 | |
fi |
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
def _convert_to_iban(self, account): | |
""" | |
Convert czech account number to IBAN | |
""" | |
acc = self.RE_ACCOUNT.match(account) | |
iban = 'CZ00{b}{ba:0>6}{a:0>10}'.format( | |
ba=acc.group('ba') or 0, | |
a=acc.group('a'), | |
b=acc.group('b'), | |
) |
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
viktor@haree-nb /tmp/test/greenlet (git)-[master] % ./run-tests.py | |
running build_ext | |
Linking /tmp/test/greenlet/build/lib.linux-x86_64-2.7/greenlet.so to /tmp/test/greenlet/greenlet.so | |
python 2.7.4 (64 bit) using greenlet 0.4.0 from /tmp/test/greenlet/greenlet.so | |
test_dead_weakref (tests.test_weakref.WeakRefTests) ... ok | |
test_dealloc_weakref (tests.test_weakref.WeakRefTests) ... ok | |
test_inactive_weakref (tests.test_weakref.WeakRefTests) ... ok | |
test_version (tests.test_version.VersionTests) ... ok | |
test_exception_disables_tracing (tests.test_tracing.TracingTests) ... ok | |
test_greenlet_tracing (tests.test_tracing.TracingTests) ... ok |
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
# 1 "greenlet.c" | |
# 1 "<command-line>" | |
# 1 "/usr/include/stdc-predef.h" 1 3 4 | |
# 1 "<command-line>" 2 | |
# 1 "greenlet.c" | |
# 1 "greenlet.h" 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
.file "greenlet.c" | |
.text | |
.p2align 4,,15 | |
.type green_is_gc, @function | |
green_is_gc: | |
.LFB142: | |
.cfi_startproc | |
cmpq $-1, 24(%rdi) | |
je .L3 | |
xorl %eax, %eax |
NewerOlder