Skip to content

Instantly share code, notes, and snippets.

View latuminggi's full-sized avatar

Aprillio Latuminggi latuminggi

View GitHub Profile
@latuminggi
latuminggi / GMapsDECtoDMS.php
Last active February 10, 2022 13:45
Convert Decimal degrees (DEC) to Degrees, minutes, and seconds (DMS) for Google Maps (bonus Embed URL)
function GMapsDECtoDMS($latitude, $longitude) {
// $latitude and $longitude must be a float value
// e.g. National Monument (-6.175413294875829, 106.82718181252345)
$latitudeDirection = $latitude < 0 ? 'S': 'N';
$longitudeDirection = $longitude < 0 ? 'W': 'E';
$latitudeNotation = $latitude < 0 ? '': '';
$longitudeNotation = $longitude < 0 ? '': '';
@latuminggi
latuminggi / Informative Linux Terminal with Horizontal Separator
Last active November 4, 2023 03:51
Informative Linux Terminal with Horizontal Separator
### This bash script below has been tested on Oracle Linux 8
### Put these 3 lines in the bottom file of your ~/.bashrc
export SERVER_NAME="[MyServerName] "
export PS0='\[\e[1;33m\]└─ exec @ \D{%F %T%z} $(eval printf %.0s─ '{36..'"${COLUMNS:-$(tput cols)}"\}; echo)\[\e[m\]\n'
export PS1="\n\[\e[1;33m\]┌$(eval printf %.0s─ '{2..'"${COLUMNS:-$(tput cols)}"\}; echo)\n├─ \h ($(eval hostname -I|cut -f1 -d' ')) ${SERVER_NAME}@ \w\n├─ \[\e[1;36m\]\u \\$\[\e[m\] "
### Adjust env SERVER_NAME, save and execute command below
$ source ~/.bashrc
@latuminggi
latuminggi / Add a Disk to Expand Storage of Existing LVM
Last active November 20, 2024 03:59
Add a Disk to Expand Storage of Existing LVM
### This walkthrough has been tested on Ubuntu Linux 22.04 LTS for xfs filesystem
### Reference: https://www.cyberciti.biz/faq/howto-add-disk-to-lvm-volume-on-linux-to-increase-size-of-pool
# df -h | grep -v tmpfs
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VG_SERVER-LV_ROOT 45G 7.9G 38G 18% /
/dev/sda2 974M 374M 533M 42% /boot
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert