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
curl = lambda r: "curl -i -X {method} -H {headers} -d '{data}' '{uri}'".format(method=r.request.method, headers=" -H ".join(['"{0}: {1}"'.format(k, v) for k, v in r.request.headers.items()]), data=r.request.body if r.request.body else '', uri=r.request.url) |
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/env python | |
# coding: utf-8 | |
from __future__ import print_function | |
from re import compile | |
from glob import glob | |
from os import path, rename | |
from datetime import datetime | |
# Parâmetros de execução do script |
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 | |
# input = Vídeo com um audio | |
# audio.aac = Audio extra | |
# subtitile1 = Arquivo .srt com uma legenda | |
# subtitile2 = Arquivo .srt com outra legenda | |
# por = portuguese | |
# eng = english | |
ffmpeg -i input.mkv -i audio.aac -i subtitile1.srt -i subtitle2.srt -map 0:v -map 0:a -map 1:a -c copy -map 2 -c copy -map 3 -c copy -metadata title="{{title}}" -metadata:s:a:0 language={{audio1-language}} -metadata:s:a:1 language={{audio2-language}} -metadata:s:3 language={{subtitle1-language}} -metadata:s:4 language={{subtitle2-language}} output.mkv |
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 | |
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip --no-cache install mysqlclient |
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
# coding=utf-8 | |
from sys import argv | |
from math import ceil | |
from re import compile | |
from subprocess import Popen, PIPE | |
class FfmpegHelper(object): | |
def __init__(self, file_path): | |
self.file_path = file_path |
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 | |
import sys | |
print sys.argv #Todos os argumentos | |
print sys.argv[2:] #Do item 2 até o final | |
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 | |
# -*- coding: utf-8 -*- | |
import subprocess | |
#Obtem o RETURN CODE de um programa, no caso o pwd | |
value = subprocess.call('pwd') | |
print value | |
#Obtem a saída normal (stdout) de um programa, no caso o pwd |
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 | |
a = range(1, 11) | |
b = range(2, 12) | |
max = 100 | |
#Versao for | |
total = 0 | |
for x, y in zip(a, b): | |
total += x * y |
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 BeautifulSoup import BeautifulSoup as bs | |
s = '''<div class="pages"> | |
<div class="navigation"><span>1</span> <a href="http://www.redcouch.me/filmes/page/2/">2</a> <a href="http://www.redcouch.me/filmes/page/3/">3</a> <a href="http://www.redcouch.me/filmes/page/4/">4</a> <a href="http://www.redcouch.me/filmes/page/5/">5</a> <a href="http://www.redcouch.me/filmes/page/6/">6</a> <a href="http://www.redcouch.me/filmes/page/7/">7</a> <a href="http://www.redcouch.me/filmes/page/8/">8</a> <a href="http://www.redcouch.me/filmes/page/9/">9</a> <a href="http://www.redcouch.me/filmes/page/10/">10</a> <span class="nav_ext">...</span> <a href="http://www.redcouch.me/filmes/page/40/">40</a></div> | |
<div class="nextprev"> | |
<span><span class="pprev">Anterior</span></span> | |
<a href="http://www.redcouch.me/filmes/page/2/"><span class="pnext">Seguinte</span></a> | |
</div> | |
<div class="clear"></div> | |
</div> |
NewerOlder