Skip to content

Instantly share code, notes, and snippets.

View miquelramirez's full-sized avatar

Miquel Ramírez miquelramirez

View GitHub Profile
@miquelramirez
miquelramirez / wsl2_ciscoanyconnect_workaround.md
Created March 16, 2023 08:57 — forked from balmeida-nokia/wsl2_ciscoanyconnect_workaround.md
WSL 2 Cisco AnyConnect Networking Workaround

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Acknowledges

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist.

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@miquelramirez
miquelramirez / voronoi.tex
Created October 20, 2020 11:15
Draw Voronoi graph with Tikz and xinttools
\documentclass[preview, border=7mm]{standalone}
\usepackage{xinttools} % for the \xintFor***
\usepackage{tikz}
\usetikzlibrary{calc}
\def\biglen{20cm} % playing role of infinity (should be < .25\maxdimen)
% define the "half plane" to be clipped (#1 = half the distance between cells)
\tikzset{
half plane/.style={ to path={
@miquelramirez
miquelramirez / wildlife-preserve_01_mdp.rddl
Last active February 21, 2020 06:10
Wildlife Preserve, instance #1 of benchmark suite in the IPPC-18
/////////////////////////////////////////////////////////////////////////////////
// //
// //
// RDDL MDP version without interm-fluents of the IPC 2018 Wildlife Preserve //
// domain for instance 01. //
// //
// //
// Created for the probabilistic tracks of IPC 2018 by //
// //
// Fei Fang (feifang [at] cmu.edu), //
ExternalProject_Add(
Boost
PREFIX "${CMAKE_BINARY_DIR}/extern"
GIT_REPOSITORY "https://github.com/boostorg/boost.git"
GIT_TAG "boost-1.68.0"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
BUILD_IN_SOURCE TRUE
CONFIGURE_COMMAND
<SOURCE_DIR>/bootstrap.sh
@miquelramirez
miquelramirez / combinations.cxx
Created March 26, 2019 12:42
Fast Combinations in C++
#include <algorithm>
#include <iostream>
#include <vector>
// Another incredible bit of C++ code
// https://stackoverflow.com/a/28698654/338107
//
// change std::vector<bool> for std::array<bool, N> to
// make your compiler work hard
@miquelramirez
miquelramirez / gen_tuple_n_size.cxx
Created March 26, 2019 12:12
C++ generate tuple of arbitrary size initialised with default constructor
#include <algorithm>
#include <tuple>
#include <iostream>
// That was an amazing display
//https://stackoverflow.com/a/37094024/338107
template<size_t, class T>
using T_ = T;
@miquelramirez
miquelramirez / running_man.html
Created January 21, 2019 01:51
Cool ASCII Art for missing content
<pre style="line-height: 1.25; white-space: pre;">
\ SORRY /
\ /
\ This page does /
] not exist yet. [ ,'|
] [ / |
]___ ___[ ,' |
] ]\ /[ [ |: |
] ] \ / [ [ |: |
@miquelramirez
miquelramirez / technical_writing.md
Last active January 17, 2019 04:18
Useful Resources for Technical Writing
@miquelramirez
miquelramirez / setup.py
Created January 15, 2019 12:14
Ammended ```setup.py``` for SCIP-interface/PySCIPOpt
from setuptools import setup, Extension, find_packages
import os, platform, sys, re
# look for environment variable that specifies path to SCIP Opt lib and headers
scipoptdir = os.environ.get('SCIPOPTDIR', '').strip('"')
includedir = os.path.abspath(os.path.join(scipoptdir, 'include'))
libdir = os.path.abspath(os.path.join(scipoptdir, 'lib'))
libname = 'scip'
cythonize = True