Skip to content

Instantly share code, notes, and snippets.

View posilva's full-sized avatar
💭
I may be slow to respond.

Pedro Marques da Silva posilva

💭
I may be slow to respond.
View GitHub Profile
@posilva
posilva / erlang-elixir-on-amazon-linux.md
Created May 29, 2023 20:23 — forked from techgaun/erlang-elixir-on-amazon-linux.md
Running elixir 1.8.1 on amazon linux

Script

#!/bin/bash

yum install ncurses-devel openssl-devel -y
yum groupinstall "Development Tools" -y

cd /tmp
wget "http://erlang.org/download/otp_src_21.3.tar.gz" -O otp21.tar.gz
@posilva
posilva / finger.sh
Created February 21, 2022 11:13
AWS Key FingerPrint
openssl pkcs8 -in mykey.pem -nocrypt -topk8 -outform DER | openssl sha1 -c
@posilva
posilva / http_server_debug.py
Created December 16, 2021 00:04
Very simple HTTP server in python for logging requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./http_server_debug.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@posilva
posilva / build_tvos.sh
Created March 25, 2021 21:17
Compile protobuf to TVOS
mkdir build_protobuf
cd build_protobuf
git clone git@github.com:leetal/ios-cmake.git
git clone --recurse-submodules -j8 -b v3.15.6 https://github.com/protocolbuffers/protobuf.git
cd protobuf
mkdir -p cmake/build/release
cd cmake/build/release
cmake -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_PROTOC_BINARIES=OFF -DCMAKE_TOOLCHAIN_FILE=../../../../ios-cmake/ios.toolchain.cmake -DPLATFORM=TVOS ../..
mkdir install
make -j18
@posilva
posilva / .gitignore
Created March 22, 2021 14:46 — forked from BennettSmith/.gitignore
Google Protobuf v2.6.0 Build Script for iOS
protobuf
protobuf-2.6.0
protobuf-2.6.1
protobuf-master
@posilva
posilva / my_app.ex
Created March 7, 2021 22:03 — forked from alanpeabody/my_app.ex
Websockets in Elixir with Cowboy and Plug
defmodule MyApp do
use Application
def start(_type, _args) do
import Supervisor.Spec, warn: false
children = [
Plug.Adapters.Cowboy.child_spec(:http, MyApp.Router, [], [
dispatch: dispatch
])
@posilva
posilva / server.py
Created March 5, 2021 15:46 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@posilva
posilva / add_to_authorized_keys.sh
Created March 2, 2021 11:17
Add pub key to remote host from Pem
ssh-keygen -f my_key.pem -y | ssh user@host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
@posilva
posilva / cli.py
Last active June 1, 2021 12:12
Python Cli Template
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This console application description
EXAMPLE:
python3 {}
""".format(__file__)
@posilva
posilva / Unreal_Buildgraph.sh
Last active August 30, 2024 06:44
Unreal Notes using BuildGraph
# List the existing targets in the installed engine build
./Engine/Build/BatchFiles/RunUAT.command BuildGraph -Script=Engine/Build/InstalledEngineBuild.xml -ListOnly
# Build Editor
./Engine/Build/BatchFiles/RunUAT.command BuildGraph -Script=Engine/Build/InstalledEngineBuild.xml -Target="Editor Mac"
# Build the editor but remove the Android and other options
./Engine/Build/BatchFiles/RunUAT.command BuildGraph \
-Script=Engine/Build/InstalledEngineBuild.xml \
-Target="Make Installed Build Mac" \
-set:WithMac=true \