Skip to content

Instantly share code, notes, and snippets.

View joe-oli's full-sized avatar
💭
what the flock? no status to report, i am not a facebook junkie.

joe-oli

💭
what the flock? no status to report, i am not a facebook junkie.
View GitHub Profile

Windows 10 version 2004 - Installing Node.js on Windows Subsystem for Linux (WSL/WSL2)

UPDATE (Fall 2020): This gist is an updated version to the Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL) guide, I usually just keep here notes, configuration or short guides for personal use, it was nice to know it also helps other ppl, I hope this one too.

Windows updated windows subsystem for linux to version 2, as the F.A.Q stated you can still use WSL version 1 side by side with version 2. I'm not sure about existing WSL machines surviving the upgrade process, but as always backup and 🤞. NOTE: WSL version 1 is not replace/deprecated, and there ar

@joe-oli
joe-oli / Barebones-Express-Server.js
Created April 15, 2021 11:41
Barebones Express Server
var express = require('express');
var app = express.createServer();
app.configure(function() {
var pub = __dirname + "./public";
pub = require("path").normalize(pub);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
});
@joe-oli
joe-oli / Barebones-node-server.js
Created April 15, 2021 11:39
Basic Barebones "Raw" node.js server
//definitely barebones -- using node's native http.createServer
require('http').createServer((req, res) => {
let statusCode = 404
let data = {status: 404}
const chunks = []
req.on('error', (err) => {
console.error(err);
})
@joe-oli
joe-oli / Check-Ports-Netstat.txt
Created April 14, 2021 06:04
Check PORTS on Win 10 PC - Netstat
>netstat
>e.g. netstat -ab
Example output:
---
>netstat -ab
Active Connections
Proto Local Address Foreign Address State
@joe-oli
joe-oli / RegEdit_RDP_PortNumber.txt
Created April 12, 2021 14:10
RDP PortNumber entry HKLM
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
PortNumber = 3389 (Default)
@joe-oli
joe-oli / Windows-Firewall-Cmd.txt
Created April 12, 2021 14:02
Allow Ping (AKA ICMP Echo) through Windows Firewall
* Run as Admin, then enter: (for IPv4)
>netsh advfirewall firewall add rule name="ZCustom ICMP Allow inbound V4 Echo (Ping) request" protocol=icmpv4:8,any dir=in action=allow
Ok.
(For IPv6)
>netsh advfirewall firewall add rule name="ZCustom ICMP Allow inbound V6 Echo (Ping) request" protocol=icmpv6:8,any dir=in action=allow
@joe-oli
joe-oli / Howto_format_json.txt
Created March 14, 2021 10:24
Markdown Editor, how to prettify / format json
Use as follows
```json
Put your json object here
```
@joe-oli
joe-oli / LinkedListHelper.cs
Created January 10, 2021 05:03 — forked from mrshridhara/LinkedListHelper.cs
LinkedList manipulations.
public class LinkedListNode
{
public int val;
public LinkedListNode next;
}
public class LinkedListHelper
{
public static LinkedListNode MergeLinkedLists(LinkedListNode head1, LinkedListNode head2)
{
@joe-oli
joe-oli / RedisStorageErrorLog.cs
Created January 10, 2021 05:03 — forked from mrshridhara/RedisStorageErrorLog.cs
Provides storage using Redis for ELMAH error logging.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Elmah;
using ServiceStack.Redis;
/// <summary>
/// Provides storage for error logging using Redis.
@joe-oli
joe-oli / Minimal-HTML5-template.html
Created December 13, 2020 07:44
Minimal HTML 5 template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My TItle</title>
<link rel="stylesheet" href="css/style.css">
<style>
html {
background-color:yellow;