Skip to content

Instantly share code, notes, and snippets.

# The best distro for LXC right now is ubuntu since you'll have almost no config to get LXC networking working
# All LXC commands have to be run as root (or sudo)
# 1. DO IT once on the host
# 1.1 install lxc
apt-get install lxc
# 1.2 enable nat on iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
@jerry42
jerry42 / convertDateMoment.js
Last active September 8, 2020 11:09
ES6 script to update MySQL DATETIME to local ( Lang & Timezone ) date in HTML on document ready
# HTML example <span class="dateTZ">2020-09-08 13:07:42</span>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.27.0/moment-with-locales.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.31/moment-timezone-with-data.min.js"></script>
<script>
function updateDateLocalTZ(classID)
{
$(`.${classID}`).html(moment.tz(moment.utc($(`.${classID}`).html()), moment.tz.guess(true)).format('llll'))
}
$( document ).ready(function() {