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 / disable.sh
Last active November 21, 2023 18:15
Remove/Disable Ubuntu SystemD Daily.Timers
# References:
#
# https://cinhtau.net/2016/12/09/disable-apt-auto-update-and-upgrade/
# https://unix.stackexchange.com/questions/315502/how-to-disable-apt-daily-service-on-ubuntu-cloud-vm-image
# https://askubuntu.com/questions/824718/ubuntu-16-04-unattended-upgrades-runs-at-random-times/831206
apt-get -y purge update-notifier-common ubuntu-release-upgrader-core landscape-common unattended-upgrades
systemctl kill --kill-who=all apt-daily.service
systemctl kill --kill-who=all apt-daily-upgrade.service
@posilva
posilva / context.ex
Created March 31, 2018 23:07 — forked from ericstumper/context.ex
Guardian Authentication with Absinthe GraphQL in Elixir
defmodule Languafy.Web.Context do
@behaviour Plug
import Plug.Conn
alias Languafy.User
def init(opts), do: opts
def call(conn, _) do
case build_context(conn) do
{:ok, context} ->
@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 / Unreal_Buildgraph.sh
Last active May 17, 2023 23:16
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 \
@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 / 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 / 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
])