Skip to content

Instantly share code, notes, and snippets.

View apocsantos's full-sized avatar

António Santos apocsantos

  • Viana do Castelo
View GitHub Profile
#Sleep Deprived Loon (The real one)
#06/02/2018 GTM +0 22:03 @undisclosed location
#For PROGRAMAR, thanks for the oportunity to work with you guys!
#
#SoftEther VPN Connection Creator for Windows Power Shell Under Windows 8.x and above
#Rev0.0.2 (auto switch execution policies to run script and avoid security issues, prompt user for parameters)
#
#SleepDeprivedLoon 2108 (Dont waste time! Live! Cause life is to short to be wasted!"
#The fault in our stars!
#
'Imperial March
'"We shall never surrender!" (Churchill) Remenber this when you grow old!
'We are "kings"! And some day... Code will be life!
'Apocsantos
'main code
'calls all subs
CALL Trooper
CALL yoda
#prevents root certificate instalation, normaly used for exploits
#vars area
$registryPath = "HKLM:\Software\Policies\Microsoft\SystemCertificates\Root\ProtectedRoots\"
$Name = "Flags"
$value = "1"
##########
function Test-RegistryValue {
param (
#REQUIRES -Version 2.0
<#
.SYNOPSIS
Add's a proxy entry from localhost (217.0.0.1) of a certain port, to another host, same port or another host another port
.DESCRIPTION
Add's a proxy entry from localhost (217.0.0.1) of a certain port, to another host, same port or another host another port
.NOTES
File Name : WinPortProxy.ps1
Author : acposantos ()
#include <stdio.h>
#include <unistd.h>
int main ()
{
int pid;
printf("Hello World \n");
pid = fork();
if(pid != 0)
printf("Dont bother me! Just fork off you %d",pid);
Sub changeTextColor()
' A great developer is a lazy developer! As we do magic in a few lines of code!
' Why dont you buy me a coffe ?
' http://sdllabs.pt/
Dim sld As Slide
Dim shp As Shape
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
Write-host" ~ ~"
Write-host" * * * *"
Write-host" * *"
Write-host" ~ * * ~ *"
Write-host" * ~ * * ~"
Write-host" ) ( ) *"
Write-host" * ~ ) (_) ( (_) ) (_) ( *"
Write-host" * (_) # ) (_) ) # ( (_) ( # (_) *"
Write-host" _#.-#(_)-#-(_)#(_)-#-(_)#-.#_"
Write-host" * .' # # # # # # # # # # # `. ~ *"
#!/bin/bash
apt-get install usbmount
apt-get install snapd
snap install omxplayer-pi
cd /home/pi
wget https://raw.githubusercontent.com/apocsantos/RPi-MediaLooper/master/videoloop.sh
cp ./videoloop.sh ./cortexloop.sh
chmod +x cortexloop.sh
sudo echo "@/home/pi/cortexloop.sh" >> /etc/xdg/lxsession/LXDE/autostart
@apocsantos
apocsantos / home-server.md
Created December 13, 2020 18:17 — forked from nileshtrivedi/home-server.md
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

@apocsantos
apocsantos / cloudwatch_to_logstash.py
Created January 14, 2021 18:20 — forked from shortstack/cloudwatch_to_logstash.py
Python lambda to ship logs from Cloudwatch to Logstash
#!/usr/bin/env python3
import socket
import sys
import json
import zlib
import copy
import base64
import re
import ssl
import logging