Skip to content

Instantly share code, notes, and snippets.

View gin1314's full-sized avatar

Eugene Santos gin1314

  • SmartCharts
  • Philippines
View GitHub Profile
#!/usr/bin/env bash
# ==============================================================================
# Ubuntu System & Runtime Assessment Script (HTML Report Generator)
# Executes diagnostic commands and outputs a self-contained, responsive HTML report.
#
# Usage:
# ./assessment.sh # Generates system_report.html
# ./assessment.sh --markdown (or -m) # Generates system_report.md
# ./assessment.sh --markdown > rep.md # Streams Markdown to stdout
# curl -fsSL <URL> | bash -s -- -m # Execute remotely with Markdown output
#!/usr/bin/env bash
# ==============================================================================
# Ubuntu System & Runtime Assessment Script (HTML Report Generator)
# Executes diagnostic commands and outputs a self-contained, responsive HTML report.
#
# Usage:
# ./assessment.sh > report.html
# curl -fsSL https://.../assessment.sh | bash > report.html
# ./assessment.sh # Automatically generates system_report.html
# ==============================================================================
@gin1314
gin1314 / next_nginx.md
Created March 6, 2021 17:13 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

package main
import "fmt"
import "strconv"
const (
MAX_X = 20
MAX_Y = 20
)
#!/bin/bash
for i in {1..10}
do
rand=$(( ( RANDOM % 4000 ) + 6000 ))
curl -X GET "http://localhost:8000/broadcast/test/$rand" &2> /dev/null
echo -e "$rand"
sleep 3
done
@gin1314
gin1314 / simulate_watch.sh
Created March 18, 2017 08:50
bash: simulate `watch` command
#!/bin/bash
while true; do; ls -la . | tr -d '\r\n'; echo -n "\r"; sleep 5; done
#!/usr/bin/env python
# @author: eugene.santos13@gmail.com
# this will generate json structure for .shuttle.json
import json
import sys, getopt
def parse_opt(argv):
cert_path = ''
@gin1314
gin1314 / iterm2-solarized.md
Created June 3, 2016 06:44 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@gin1314
gin1314 / gist:acdb5c937bfcc75ab8cc
Created August 3, 2015 10:28
linux: example of enabling IP forwarding and redirection
sysctl -w net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8080
@gin1314
gin1314 / gist:a7d78fb318264c109137
Created July 30, 2015 11:47
ffmpeg recipe for mobile video
“Standard” web video (480p at 500kbit/s):
ffmpeg -i input_file.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k output_file.mp4
360p video for older mobile phones (360p at 250kbit/s in baseline profile):
ffmpeg -i inputfile.avi -vcodec libx264 -vprofile baseline -preset slow -b:v 250k -maxrate 250k -bufsize 500k -vf scale=-1:360 -threads 0
-acodec libvo_aacenc -ab 96k output.mp4
480p video for iPads and tablets (480p at 400kbit/s in main profile):