Skip to content

Instantly share code, notes, and snippets.

View andisugandi's full-sized avatar

Andi Sugandi andisugandi

View GitHub Profile
@dmancloud
dmancloud / install-rancher-with-lets-encrypt-certificate.md
Last active January 8, 2025 03:32
Rancher With Cert-Manager & Lets Encrypt (Linux)

Install Rancher Manager With Lets Encrypt (Linux)

Infrastructure

  • Domain Name
  • Ability to make DNS Changes
  • Debian 11 Virtual Machine (Should work with Ubuntu)
  • Port 80 & 443 must be accessible for Let's Encrypt to verify and issue certificates

Pick a subdomain and create a DNS entry pointing to the IP Address that will be assigned to the Rancher Server

@defulmere
defulmere / gist:438b3cf94cc725c6a67e40888e1e280a
Last active November 19, 2024 21:30
colored bar graph of system load over time in terminal with atopsar
np=$( nproc ); atopsar -p | grep ":[0-9]\{2\}\s\+[0-9]" | awk '{printf("\n%s %6.2f ",$1, $5); for (i = 0; i<$5; i++) {if (i<'$np'*.7) {printf "\033[32m"} else if (i<'$np') {printf "\033[33m"} else {printf "\033[31m"}; printf("█")}; printf "\033[0m"}'; echo ""
import json
from flaskblog import db
from flaskblog.models import Post
array = '[{"title": "My Updated Post", "content": "My first updated post!\r\n\r\nThis is exciting!", "user_id": 1}, {"title": "A Second Post", "content": "This is a post from a different user...", "user_id": 2}, {"title": "Top 5 Programming Lanaguages", "content": "Te melius apeirian postulant cum, labitur admodum cu eos! Tollit equidem constituto ut has. Et per ponderum sadipscing, eu vero dolores recusabo nec! Eum quas epicuri at, eam albucius phaedrum ad, no eum probo fierent singulis. Dicat corrumpit definiebas id usu, in facete scripserit eam.\r\n\r\nVim ei exerci nusquam. Agam detraxit an quo? Quo et partem bonorum sensibus, mutat minimum est ad. In paulo essent signiferumque his, quaestio sadipscing theophrastus ad has. Ancillae appareat qualisque ei has, usu ne assum zril disputationi, sed at gloriatur persequeris.", "user_id": 1}, {"title": "Sublime Text Tips and Tricks", "content": "Ea vix dico modus voluptatibus, mel iudico sua
@shunchu
shunchu / convert-seconds-into-hh-mm-ss-in-ruby.rb
Created July 25, 2012 07:58
Convert seconds into HH:MM:SS in Ruby
t = 236 # seconds
Time.at(t).utc.strftime("%H:%M:%S")
=> "00:03:56"
# Reference
# http://stackoverflow.com/questions/3963930/ruby-rails-how-to-convert-seconds-to-time