Skip to content

Instantly share code, notes, and snippets.

View gubatron's full-sized avatar

Angel Leon gubatron

View GitHub Profile
@gubatron
gubatron / Diferenciadores de ADA.md
Created February 27, 2021 04:33
Diferenciadores de ADA

Diferenciadores ADA:

Increíblemente descentralizado y probado matemáticamente tan seguro como Bitcoin. Para cuando llegue el 31 de marzo, toda la red estará completamente operada y será propiedad de la comunidad y el 100% de toda la producción de bloques será manejada por grupos de interés comunitarios.

Rápida, robusta, construida a escala, democracia líquida mediante votación en cadena, abierta a todos. Permite que todo el protocolo sea impulsado por la comunidad y pueda tomar decisiones de una manera más sólida en comparación con el estándar de la industria.

La mejor implementación de metadatos de pila de red en la industria. El modelo Extended-UTXO ofrece a Cardano la capacidad de ejecutar contratos inteligentes de forma segura mientras mantiene la capacidad de escalabilidad.

La tecnología Hard Fork Combinator ofrece actualizaciones / hardforks sin problemas. No hay bifurcaciones obtusas o engorrosas con ADA a diferencia de otras cadenas de bloques que obligan a los usuarios finales a "reclamar" to

@gubatron
gubatron / pascal.hs
Last active January 27, 2021 05:17
Pascal triangle row generator in Haskell
-- Gubatron's method
-- n=3 [1, 2, 1]
-- copy the list and append a 0 on the left of the first
-- and append a 0 at the end of the second
-- [0, 1, 2, 1]
-- [1, 2, 1, 0]
-- add them up!
-- n=4 [1, 3, 3, 1]
--
-- append 0s to both sides and add them up
@gubatron
gubatron / pascal.py
Last active January 27, 2021 16:30
Pascal Triangle Generator in Python
def pascal(n):
if n == 1:
return [ 1 ]
if n == 2:
return [ 1, 1 ]
prev = pascal(n-1)
results = []
for i in range(n):
if i == 0:
continue
@gubatron
gubatron / symlink_all_exes.sh
Created January 14, 2021 17:56
sed: create symlinks to all .exe in a folder
@gubatron
gubatron / Google Sheets - Days of a month
Created November 1, 2020 21:59
Calculate the number of days in a month in Google Sheet.
If cell `B1` had a date indicating the first of the month as in: `=11/1/2020`
To get the number of days of that month you do:
`=DAYS(EOMONTH(B1,0),B1)+1`
@gubatron
gubatron / Entitlements.plist
Last active October 16, 2024 02:00
An example Entitlements.plist file to allow a desktop app to run a Java Runtime Environment on a signed .app
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
@gubatron
gubatron / startSSHAgent.sh
Last active February 17, 2020 15:17
startSSHAgent bash function - checks for SSH_AGENT_PID in env, then for ssh-agent PID (pgrep), if not found, starts new ssh-agent, adds your keys
startSSHAgent() {
if [[ -z "$SSH_AGENT_PID" ]]; then
if [[ $(pgrep ssh-agent) ]]; then
export SSH_AGENT_PID=$(pgrep ssh-agent)
echo "Found existing ssh-agent PID, SSH_AGENT_PID=${SSH_AGENT_PID}"
else
echo "Starting fresh ssh agent"
eval `ssh-agent`
fi
fi
@gubatron
gubatron / kill_old_ssh_agents
Last active November 21, 2022 17:49
Linux command (script) to kill old ssh-agent processes, (could be parametrized to change the process name)
#!/usr/bin/env python
# Author: @gubatron
# License: MIT License, Copyright 2019
import os
import sys
if __name__ == '__main__':
cmd_get_process_list = 'ps -ef --sort=start_time | grep ssh-agent | grep -v grep'
output = os.popen(cmd_get_process_list)
lines = output.read().split("\n")
@gubatron
gubatron / lighttpd_server_conf_served_from_url_subdirectory.conf
Last active November 14, 2019 17:32
Configuration of a wordpress site served from a URL's directory (not the root) on LIGHTTPD
$HTTP["host"] =~ "^gubatron.com$|^www.gubatron.com$" {
server.document-root="/media/ebs/data/websites/gubatron.com/"
$HTTP["url"] =~ "\.git" {
url.access-deny = ("")
}
url.rewrite = (
"^/blog/wp-admin/(.*)" => "$0",
"^/blog/(.*)\.(.+)$" => "$0",
@gubatron
gubatron / nginx_server_conf_served_from_url_subdirectory.conf
Last active November 14, 2019 17:34
Configuration of a wordpress site served from a URL's directory (not the root) on NGINX
server {
server_name www.gubatron.com;
listen 80;
listen [::]:80;
root /media/ebs/data/websites/gubatron.com/;
index index.php index.html index.htm;
# wordpress lives at gubatron.com/blog/...
rewrite ^/blog/wp-admin/(.*) /blog/wp-admin/$1;
#search redirect