Skip to content

Instantly share code, notes, and snippets.

View jtemporal's full-sized avatar
😎
Working from home

Jessica Temporal jtemporal

😎
Working from home
View GitHub Profile
sphinx
sphinx-autobuild
sphinx
sphinx-autobuild
sphinx_rtd_theme
$ sudo npm install -g dredd
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone -q https://[email protected]/josdejong/jsonlint.git /home/temporal/.npm/_cacache/tmp/git-clone-3302dd41
npm ERR! /home/temporal/.npm/_cacache/tmp/git-clone-3302dd41/.git: Permission denied
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /home/temporal/.npm/_logs/2018-03-19T19_45_14_228Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'dredd' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 0bdc2705a30075c3
5 silly install loadCurrentTree
@jtemporal
jtemporal / traceroute.txt
Created April 10, 2018 21:38
port 80 (http)
$ tcptraceroute -p 22 github.com
Selected device wlp2s0, address 192.168.1.107, port 22 for outgoing packets
Tracing the path to github.com (192.30.253.113) on TCP port 80 (http), 30 hops max
1 192.168.1.1 4.829 ms 5.447 ms 1.787 ms
2 192.168.0.1 2.512 ms 2.462 ms 2.466 ms
3 10.9.128.1 10.686 ms 10.444 ms 11.515 ms
4 bb7a7804.virtua.com.br (187.122.120.4) 11.987 ms 10.929 ms 11.977 ms
5 embratel-T0-3-0-6-uacc04.spomb.embratel.net.br (189.86.167.25) 12.439 ms 11.715 ms 11.979 ms
6 ebt-H1-0-0-0-tcore01.spolp.embratel.net.br (200.244.211.231) 15.207 ms 12.433 ms 15.193 ms
7 ebt-B11551-intl01.atl.embratel.net.br (200.230.230.40) 150.879 ms 159.614 ms 164.254 ms
@jtemporal
jtemporal / traceroute.txt
Created April 10, 2018 21:39
port 22 (ssh)
$ tcptraceroute github.com 22
Selected device wlp2s0, address 192.168.1.107, port 35523 for outgoing packets
Tracing the path to github.com (192.30.253.112) on TCP port 22 (ssh), 30 hops max
1 192.168.1.1 2.000 ms 1.773 ms 1.867 ms
2 192.168.0.1 5.256 ms 3.794 ms 5.173 ms
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
@jtemporal
jtemporal / img3base64.py
Created June 14, 2018 14:41
read image bytes and turn it into base64 string
import base64
with open('test_img.png', 'rb') as img_data:
img = img_data.read()
print(base64.encodebytes(img).decode())
@jtemporal
jtemporal / copa.py
Created June 16, 2018 13:32
pegar os resultados da copa
# créditos: https://twitter.com/Denommus/status/1007407580132585472 e @fmasanori
import requests
jogos = requests.get('http://worldcup.sfg.io/matches').json()
[print(j['home_team']['country'], j['home_team']['goals'], 'x', j['away_team']['country'], j['away_team']['goals'])
for j in jogos if j['status'] in ('completed', 'in progress')]
import time
def main():
jogadora1 = input('Jogadora 1 sua vez: ').lower()
jogadora2 = input('Jogadora 2 sua vez: ').lower()
if jogadora1 == 'pedra':
if jogadora2 == 'papel':
return 'Jogadora 2 ganhou!'
elif jogadora2 == 'tesoura':
@jtemporal
jtemporal / statistics.py
Last active July 19, 2018 12:27
Lesson 13: Variability - Quiz 32: SD social networkers
import math
# data (dados)
x = [38946, 43420, 49191, 50430, 50557, 52580, 53595, 54135, 60181, 62076]
# mean (média)
mean = sum(x)/len(x)
# Deviation from the mean (desvio da média)