Skip to content

Instantly share code, notes, and snippets.

@gsilos
gsilos / iss.txt
Last active October 3, 2023 19:58
TLE ISS
ISS-01
1 25544C 98067A 23272.77886488 .00077550 00000+0 13753-2 0 10
2 25544 51.6409 170.4693 0005109 58.9488 0.4939 15.49566286 12
ISS-02
1 25544C 98067A 23273.02886488 -.00040107 00000+0 -71101-3 0 22
2 25544 51.6400 169.2345 0005361 57.2111 317.7738 15.49603510 11
ISS-03
1 25544C 98067A 23273.28020833 .00071849 00000+0 12734-2 0 36
2 25544 51.6401 167.9906 0005380 56.6142 281.4233 15.49582138 17
@gsilos
gsilos / openssl-messenger.md
Last active September 10, 2023 19:28
secure communication

Why?

Since it is not possible to rely on the encryption that is provided for us in our daily applications (email, chat, etc), so, I decide to create this method as an alternative to quickly send sensitive data through current chat applications, email, etc.

How?

Using openssl in both sides (the sender and the receiver) is possible to exchange encrypted messages using our preffered chat application. In this process, I tied receiver's github account with his SSH public key, that way we can believe a little bit more if the receiver is who we think he is.

Before starting

@gsilos
gsilos / bash-oauth1.sh
Created May 4, 2019 12:21
OAuth1 in bash
#!/bin/bash
# oauth1 simulator http://lti.tools/oauth/
urlencode () {
[ -n "$1" ] \
&& echo -n "$1" | perl -p -e 's/([^A-Za-z0-9-._~])/sprintf("%%%02X", ord($1))/seg'
}
#oauth1 vars
@gsilos
gsilos / setup.sql
Last active January 3, 2019 19:34
postgresql user db table setup
CREATE USER meuusuario WITH PASSWORD 'a';
CREATE DATABASE meudatabase;
GRANT ALL PRIVILEGES ON DATABASE meudatabase TO meuusuario;
\connect meudatabase
CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
CREATE TABLE minhatabela (
tabela_a bigint NOT NULL,
@gsilos
gsilos / split-input.py
Last active September 17, 2018 19:27
#!/usr/bin/python
#
# As I demonstred here https://gist.github.com/gsilos/879c28279761cd8d38301f7a54bed78a
# openssl smime can't decrypt file with more than 2GB.
#
# This script is a workaround to handle the openssl decrypt limit. It will split the input
# stream into chunks of customized size. the splitted chunk will be used as input for openssl
# smime encryption.
# The outcome of this script will be a tar package with all the chunks in it.
#
#!/usr/bin/env bash
#
# Test smime encryption/decryption limits.
#
# There is something in smime design break it when decrypting files that have more than 2GB in size.
# By playing with ulimit max virtual memory and the size of the message that will be encrypted/decrypted
# I found the maximum size in bytes a original message can have before decrypt throwns an error.
#
# This is a test script that make easier talk about this problem with people.
#
@gsilos
gsilos / gist:a1c05bdb6f2e5c9bda5dffaca35ad061
Last active September 4, 2018 14:16
talk to people in bash
#!/bin/bash
# Be paranoid about what is going on...
PS4='${FUNCNAME[0]} (${LINENO}): '
set -x
trap "error_report \$? \$LINENO " ERR
RRCount=0
declare -A ERRHash
# Functions
look the comentary of this gist :D
(moleculev2-env) cowsaw $ molecule list
Instance Name Driver Name Provisioner Name Scenario Name Created Converged
--------------- ------------- ------------------ --------------- --------- -----------
instance Docker Ansible default True True
(moleculev2-env) cowsaw $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES