Skip to content

Instantly share code, notes, and snippets.

Ivan Pereira balsagoth

Block or report user

Report or block balsagoth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:d5e86c14f2f44e4265dae7a451397ead
#To Get List of Hardware
sudo networksetup -listallhardwareports
#To Disable IPv6 on Wifi Adapter
sudo networksetup -setv6off wi-fi
#To Disable IPv6 on Built-in Ethernet Adapter
sudo networksetup -setv6off Ethernet
@balsagoth
balsagoth / mypy-cheatsheet.rst
Created Mar 19, 2019
Type hints in python cheat sheet
View mypy-cheatsheet.rst

Type hints cheat sheet (Python 3)

This document is a quick cheat sheet showing how the PEP 484 type annotation notation represents various common types in Python 3.

@balsagoth
balsagoth / Contributing.md
Created Oct 6, 2018 — forked from MarcDiethelm/Contributing.md
How to contribute to a project on Github
View Contributing.md

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@balsagoth
balsagoth / findkeys.sh
Created Mar 20, 2018 — forked from patrickhulce/findkeys.sh
Find all keys without a TTL in Redis
View findkeys.sh
#!/bin/sh
redis-cli keys "*" | head -n $1 > keys.txt
cat keys.txt | xargs -n 1 -L 1 redis-cli ttl > ttl.txt
paste -d " " keys.txt ttl.txt | grep .*-1$ | cut -d " " -f 1 | redis-cli del
@balsagoth
balsagoth / supervisord.service
Created Apr 7, 2017 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
View supervisord.service
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@balsagoth
balsagoth / supervisord.service
Created Apr 7, 2017 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
View supervisord.service
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@balsagoth
balsagoth / supervisord.service
Created Apr 7, 2017 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
View supervisord.service
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
View ex1.py
final = aux = ""
counter = 0
for letter in s:
if aux == "":
aux = letter
if letter != aux:
final += str(counter) + aux
aux = letter
counter = 0
counter +=1
@balsagoth
balsagoth / 0_reuse_code.js
Created Jun 22, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@balsagoth
balsagoth / b64tojson.py
Created May 16, 2016
Converts base64 application/x-python-serialize in rabbitmq to human readable json for easier debug
View b64tojson.py
import click
import base64
import pickle
import pprint
@click.command()
@click.argument('b64body')
@click.option('--indent', default=2, type=int)
def unserialize(b64body, indent):
You can’t perform that action at this time.