Skip to content

Instantly share code, notes, and snippets.

View jpedro's full-sized avatar
🐤
"True courage is knowing you’re wrong but refusing to admit it"

Pedro Barbosa jpedro

🐤
"True courage is knowing you’re wrong but refusing to admit it"
View GitHub Profile
@jpedro
jpedro / status.sh
Last active March 30, 2024 12:59
Quick and dirty HTTP status check
#!/usr/bin/env bash
set -uo pipefail
STATUS_CHUNKS="${STATUS_CHUNKS:-10}"
URL="${1:-}"
if [[ "$URL" == "" ]]
then
echo >&2 "Usage: $0 URL"
exit 1
@jpedro
jpedro / HelloWorld.java
Created January 9, 2024 11:34 — forked from lolzballs/HelloWorld.java
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@jpedro
jpedro / tree.lua
Created December 13, 2023 11:44 — forked from rsc/tree.lua
tree comparison using lua coroutines
#!/usr/local/bin/lua
function T(l, v, r)
return {left = l, value = v, right = r}
end
function visit(t)
if t ~= nil then -- note: ~= is "not equal"
visit(t.left)
coroutine.yield(t.value)
@jpedro
jpedro / udpserv.go
Created August 12, 2023 01:02 — forked from miekg/udpserv.go
Simple udp server in Go
package main
import (
"log"
"net"
)
func main() {
// listen to incoming udp packets
pc, err := net.ListenPacket("udp", ":1053")
@jpedro
jpedro / ANSI.md
Created July 7, 2023 20:05 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@jpedro
jpedro / tor.md
Created July 4, 2023 04:33 — forked from maximousblk/tor.md
A super simple guide to starting up your own Tor hidden service

Host your own Tor hidden service!

A super simple guide to spinning up a Tor hidden service. [tl;dr]

Ubuntu 20.04 LTS was used for the making of this guide.

Install Tor

you can install Tor using the following command

@jpedro
jpedro / introrx.md
Created May 8, 2023 07:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@jpedro
jpedro / README.MD
Created March 10, 2023 23:19 — forked from Buckwich/README.MD
Sankey Diagram with Google Spreadsheets

Sankey Diagrams within Google Spreadsheets

This Gist is there to help you creating a Sankey Diagram from your Google Spreadsheets.

Fork of @njoerd114

Changes:

  • update usage instruction for new Apps Script IDE
  • does not need document Id (@steren)
  • supports named sheet (not default, see customization in code.gs)
@jpedro
jpedro / README.MD
Created March 10, 2023 13:46 — forked from njoerd114/README.MD
Sankey Diagram with Google Spreadsheets

Sankey Diagrams within Google Spreadsheets

This Gist is there to help you creating a Sankey Diagram from your Google Spreadsheets.

Installation

  • Open a spreadsheet
  • Click "Tools" -> "Scripts"
#! /bin/sh
GOOS=linux go build -o $2 "$1"
GOOS=linux go build -ldflags="-s -w" -o $2.-sw "$1"
upx -f --brute -o $2.upx $2
upx -f --brute -o $2.-sw.upx $2.-sw
GOOS=linux gotip build -o $2.tip "$1"
GOOS=linux gotip build -ldflags="-s -w" -o $2.tip.-sw "$1"
upx -f --brute -o $2.tip.upx $2.tip