Skip to content

Instantly share code, notes, and snippets.

View meena-erian's full-sized avatar
🎯
Focusing

Menas Erian meena-erian

🎯
Focusing
View GitHub Profile
@yuna0x0
yuna0x0 / pve_xtermjs_for_vm.txt
Last active November 6, 2025 17:59
Proxmox VE xterm.js (Serial Terminal) for VM (Tested on Ubuntu and Arch Linux)
1. Add a virtual serial port to the VM using PVE Web GUI and restart the VM
2. Enable and start the virtual serial port on VM, change tty number as needed (Reference: https://askubuntu.com/a/621209/838946)
$ sudo systemctl enable serial-getty@ttyS0.service
$ sudo systemctl start serial-getty@ttyS0.service
3. Done! You can now select xterm.js in the PVE Web GUI
@UltraSimplified
UltraSimplified / relative-time.php
Last active November 26, 2024 16:42 — forked from mtttmpl/relative-time.php
Get Relative Time in PHP (e.g. '1 hour ago', 'yesterday', 'tomorrow', 'in 2 weeks')
<?php
function time2str($ts) {
if(!ctype_digit($ts)) {
$ts = strtotime($ts);
}
$diff = time() - $ts;
if($diff == 0) {
return 'now';
} elseif($diff > 0) {
$day_diff = floor($diff / 86400);
@maephisto
maephisto / Javascript ISO country code to country name conversion
Last active November 6, 2025 09:27
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',
@zspine
zspine / countries.csv
Last active October 14, 2025 11:57
Country Code, ISO and Nationality ( Please use https://mledoze.github.io/countries/ )
CCA2 Name CCA3 Nationality
AD Andorra AND Andorran
AE United Arab Emirates ARE Emirati
AF Afghanistan AFG Afghan
AG Antigua and Barbuda ATG Antiguan, Barbudan
AI Anguilla AIA Anguillian
AL Albania ALB Albanian
AM Armenia ARM Armenian
AN Netherlands Antilles ANT Dutch
AO Angola AGO Angolan