Skip to content

Instantly share code, notes, and snippets.

@miry
miry / raspi3-ubuntu-upgrade.tf
Last active July 11, 2022 15:45
Upgrade ubuntu on Raspberry Pi 3. `terraform apply -target=null_resource.upgrade-packages`
variable "server_ip" {
default = "10.0.0.2"
}
# Terraform documentation
# * Provisioner null_resource: https://www.terraform.io/docs/provisioners/null_resource.html
# * Provisioner Connections: https://www.terraform.io/docs/provisioners/null_resource.html
# Ubuntu issues:
# https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1652270
@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};