Skip to content

Instantly share code, notes, and snippets.

View ivanrvpereira's full-sized avatar

Ivan Pereira ivanrvpereira

  • Promptly Health Analytics
  • Portugal
View GitHub Profile
@ivanrvpereira
ivanrvpereira / Zero_knowledge_db.md
Created June 25, 2022 17:00 — forked from thiloplanz/Zero_knowledge_db.md
Zero-knowledge databases

Zero knowledge databases

The idea

The idea is to provide a database as a service to end users in such a way that no one except the user herself can access the data, not even the hosting provider or the database administrator.

Advantages

  • A privacy- and/or security-conscious user will have more trust in such a setup.
  • The service provider cannot be coerced to release the data they were trusted with, and he cannot be held responsible for the content he is storing.
@ivanrvpereira
ivanrvpereira / gist:d5e86c14f2f44e4265dae7a451397ead
Created April 6, 2019 12:19 — forked from mestizo/gist:9167834
Completely disable IPv6 on OSX
#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
@ivanrvpereira
ivanrvpereira / mypy-cheatsheet.rst
Created March 19, 2019 11:49
Type hints in python cheat sheet

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.

@ivanrvpereira
ivanrvpereira / Contributing.md
Created October 6, 2018 11:19 — forked from MarcDiethelm/Contributing.md
How to contribute to a project on Github

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.

@ivanrvpereira
ivanrvpereira / findkeys.sh
Created March 20, 2018 17:42 — forked from patrickhulce/findkeys.sh
Find all keys without a TTL in Redis
#!/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
@ivanrvpereira
ivanrvpereira / supervisord.service
Created April 7, 2017 09:58 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[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
@ivanrvpereira
ivanrvpereira / supervisord.service
Created April 7, 2017 09:58 — forked from mozillazg/supervisord.service
install and configure supervisord on centos 7.
[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
@ivanrvpereira
ivanrvpereira / supervisord.service
Created April 7, 2017 09:57 — forked from tonyseek/supervisord.service
Running supervisord with systemd.
[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
@ivanrvpereira
ivanrvpereira / ex1.py
Created August 10, 2016 21:15
Exercise
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
@ivanrvpereira
ivanrvpereira / 0_reuse_code.js
Created June 22, 2016 09:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console