Skip to content

Instantly share code, notes, and snippets.

@rohancme
rohancme / azure_vm_creation.md
Last active February 18, 2021 03:14
Create an Azure VM using the Python SDK

Setting up a VM on Azure using the Python SDK

After over a day of going through their documentation, reading GitHub issues, going through the SDK unit tests and shudder the second page of google results, here's how:

Create a private key and cert (pem file):

openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout id_rsa -out myCert.pem

(id_rsa is your private key, myCert.pem is your CSR)

Generate the public key from the private key:

@JeffJacobson
JeffJacobson / JavaScript Date value to .NET DateTimeOffset.cs
Last active February 13, 2017 18:24
Convert a JavaScript date expressed in milliseconds into a .NET DateTimeOffset.
/// <summary>
/// Converts from a JavaScript Date value in milliseconds to a <see cref="DateTimeOffset"/>.
/// </summary>
/// <param name="milliseconds">Number of milliseconds since 1970-1-1T00:00:00</param>
/// <returns>Returns the <see cref="DateTimeOffset"/> equivalent of <paramref name="milliseconds"/>.</returns>
public static DateTimeOffset FromJSDateToDateTimeOffset(this double milliseconds)
{
return new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero).AddMilliseconds(milliseconds * 1000);
}

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: