Skip to content

Instantly share code, notes, and snippets.

Omar Trejo otrenav

Block or report user

Report or block otrenav

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 Blockstack verification
Verifying my Blockstack ID is secured with the address 1AFbU44CQZwijugcuFmnkmJPXGb43Nbtsa https://explorer.blockstack.org/address/1AFbU44CQZwijugcuFmnkmJPXGb43Nbtsa
View keybase.md

Keybase proof

I hereby claim:

  • I am otrenav on github.
  • I am omartrejo (https://keybase.io/omartrejo) on keybase.
  • I have a public key ASD8B_ddcSzrSgeXN6Sa1A1vkYFIUmX3IidkNAluD1uvvwo

To claim this, I am signing this object:

@otrenav
otrenav / lets-ecnrypt-certificates.sh
Last active May 21, 2018
Let's Encrypt Certificates
View lets-ecnrypt-certificates.sh
sudo certbot certonly --manual --preferred-challenges dns -d [DOMAIN] -d www.[DOMAIN]
sudo cat /etc/letsencrypt/live/[DOMAIN]/fullchain.pem
sudo cat /etc/letsencrypt/live/[DOMAIN]/privkey.pem
View docker-commands.sh
# Stop all containers
docker kill $(docker ps -q)
# Remove all containers
docker rm $(docker ps -a -q)
# Remove all docker images
@otrenav
otrenav / python-uml.sh
Created May 21, 2018
Python UML Diagrams
View python-uml.sh
# Setup
sudo apt install graphviz
pip install pylint
# Usage
pyreverse -A -f ALL -o png -p [PROJECT_NAME] ./**.py
View scheduling-on-ubuntu-server.sh
#
# Use indirection with bash script and change into working directory
#
# To gain root in Ubuntu
sudo su
# To see CRON logs after execution
grep -i cron /var/log/syslog
@otrenav
otrenav / non-ajax-post-submit.js
Last active May 2, 2018
Non-AJAX (HTTP) submit using JavaScript
View non-ajax-post-submit.js
// http://stackoverflow.com/questions/5524045/jquery-non-ajax-post
function submit(action, method, values) {
var form = $('<form/>', {
action: action,
method: method
});
$.each(values, function() {
form.append($('<input/>', {
@otrenav
otrenav / python-execution-with-stdout-and-stderr-logging.sh
Last active May 2, 2018
Execute Python and log both stdout and stderr to a file
View python-execution-with-stdout-and-stderr-logging.sh
#
# Print Python script output as well as save it to a file. The `-u`
# switch tells Python to avoid buffering `stderr` and `stdout`
# which is required by `tee` to save the output to the file.
#
python -u main.py | tee output.log
You can’t perform that action at this time.