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
[root@CentOS-71-64-minimal ~]# iptables-save | |
# Generated by iptables-save v1.4.21 on Thu Sep 24 14:31:51 2015 | |
*filter | |
:INPUT ACCEPT [4576:497904] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [4378:499230] | |
-A INPUT -i virbr0 -p udp -m udp --dport 53 -j ACCEPT | |
-A INPUT -i virbr0 -p tcp -m tcp --dport 53 -j ACCEPT | |
-A INPUT -i virbr0 -p udp -m udp --dport 67 -j ACCEPT | |
-A INPUT -i virbr0 -p tcp -m tcp --dport 67 -j ACCEPT |
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 random import random | |
from collections import Counter | |
def randbits(n, p): | |
i = 0 | |
while i<n: | |
yield random() < p | |
i += 1 | |
def mc_hothand(trials, p): |
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 test_it(iter): | |
s = 0 | |
for i in xrange(0,iter): | |
p = sum([randint(0,10000000) for i in xrange(0,iter)]) | |
s += p | |
print s | |
### methodology: | |
""" | |
beltiras@BigWizard:~$ source pypyenv/bin/activate | |
(pypyenv)beltiras@BigWizard:~$ ipython |
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
import datetime | |
def percentage_of_first_trump_term_remaining(): | |
return (datetime.datetime.now() - datetime.datetime(year=2017, month=1, day=20))/(datetime.datetime(year=2021, month=1, day=20) - datetime.datetime(year=2017, month=1, day=20)) |
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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCV+A4IbJdxJmM9kLPo/RD+5OsU3W+Uapmbb1cZt2EqQY1jWlaCx/dwmHv68lg8IZkr5bUvz0ivPviY5xCvKUI6C44acUkr5rxUlRxIJ/Ig4YO6RCxZwSiW1ohMR7hf1KYqoH6xhbSn8fDhx88R6u0eLquWrGDGGHOX0lJW6AHyu12HVfdEuxLJ+9H3K/1MHQt1bq/UunxfpFDogowvJc6w7qoDy5Vum4qpADrCFpIn1SWqkOYuwBcq8MceNDxjhVyZezJHf9bWGgc8/S7fWtjpybrJw5f8CWlx3zdki5X42YP8tS73KdSEU0K5zLKhD5+HhdzYDuTpJQOKXxGci7a7 [email protected] |
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 random import shuffle, choice, randint | |
key = {} | |
key['a'] = 11.68 | |
key['b'] = 4.43 | |
key['c'] = 5.24 | |
key['d'] = 3.17 | |
key['e'] = 2.80 | |
key['f'] = 4.03 |
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 | |
if [ "$#" -eq 0 ] | |
then | |
ls | sort | run-parts ${BASH_SOURCE[0]} | |
fi | |
if [ $1 ! 1 ] | |
then |
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
start = int(input("Input a position between 1 and 10:")) | |
position = start | |
if start > 10 or start < 1: | |
exit() | |
print("l - for moving left") | |
print("r - for moving right") | |
print("Any other letter for quitting") | |
while True: | |
move = input("Input your choice:") | |
if move not in "lr": |
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 fractions import Fraction | |
def integer(first): | |
try: | |
i = int(first) | |
except: | |
return False | |
return True |
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 fractions import Fraction | |
# shares price | |
def sharesXprice(stock,valiue): | |
result = stock*valiue | |
divide = valiue % 1 | |
dollar = int(valiue) | |
print("{0} shares with market price {1} {2} have valiue ${3}".format(shares,dollar,divide,result)) |
OlderNewer