My local Ubuntu 20.04 WSL2 setup.
From Windows, as admin:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
More recent resolution: | |
1. cd ~/../../etc (go to etc folder in WSL). | |
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line). | |
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line). | |
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian). | |
5. cd ~/../../etc (go to etc folder in WSL). | |
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file). | |
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and | |
secondary. |
"""Asynchronous requests in Flask with gevent""" | |
from time import time | |
from flask import Flask, Response | |
from gevent.pywsgi import WSGIServer | |
from gevent import monkey | |
import requests |
#!/usr/bin/env bash | |
# fresh-chrome | |
# | |
# Use this script on OS X to launch a new instance of Google Chrome | |
# with its own empty cache, cookies, and user configuration. | |
# | |
# The first time you run this script, it will launch a new Google | |
# Chrome instance with a permanent user-data directory, which you can | |
# customize below. Perform any initial setup you want to keep on every |
// Long Polling (Recommened Technique - Creates An Open Connection To Server ∴ Fast) | |
(function poll(){ | |
$.ajax({ url: "server", success: function(data){ | |
//Update your dashboard gauge | |
salesGauge.setValue(data.value); | |
}, dataType: "json", complete: poll, timeout: 30000 }); | |
})(); |
# User ssh configuration file ~/.ssh/config | |
# Gist https://gist.github.com/terrywang/3997931 | |
# man ssh_config for more information | |
# Inspired by the blog post below to fight the NSA | |
# https://stribika.github.io/2015/01/04/secure-secure-shell.html | |
# Outside of the firewall, with HTTPS proxy | |
# Package connect-proxy is required. | |
# Amazon EC2 |
module Test | |
def catcher | |
begin | |
pp Foo.bar | |
rescue Exception | |
pp "errored" | |
end | |
end | |
end |
git submodule foreach git submodule init && git submodule update --recursive |
# coding:utf-8 | |
# Copyright 2011 litl, LLC. All Rights Reserved. | |
import httplib | |
import re | |
import urllib | |
import urlparse | |
from flask import Blueprint, request, Response, url_for | |
from werkzeug.datastructures import Headers |