Skip to content

Instantly share code, notes, and snippets.

@sterin
sterin / README.md
Created April 22, 2025 22:47 — forked from QNimbus/README.md
SSH Agent forwarding WSL2

SSH Agent forwarding in WSL2

Download npiperelay

To communicate between WSL and the 1Password SSH agent, we'd need to use npiperelay. This tool allows WSL to communicate with Windows' named pipes.

To install it, we need to open the GitHub repository and download the latest release. At the time of writing this post the latest release is v0.1.0 from July 2, 2020.

Unzip it and paste the npiperelay.exe file in any folder that's configured in your system's PATH. For example %USERPROFILE%/.wsl/mpiperelay.exe and then add %USERPROFILE%/.wsl to your PATH.

@sterin
sterin / sort_pis_by_name.py
Created November 10, 2023 14:47
Sort AIG PIs by name
# This script requires pyaig and click, they can be installed by running:
# > pip install pyaig click
# run the script as follows:
# > python sort_pis_by_name.py input.aig output.aig
# output.aig would the same as input.aig, except that the inputs would be sorted by name
# the script assumes all PIs have names
import click
from pyaig import *
@sterin
sterin / opengl-ubuntu-ec2-install.md
Created September 14, 2017 00:10 — forked from dgoguerra/opengl-ubuntu-ec2-install.md
Set up OpenGL on a Ubuntu 16.04 g2.2xlarge EC2 machine (following https://stackoverflow.com/q/19856192)

Steps from https://stackoverflow.com/q/19856192 with minor changes to work on Ubuntu 16.04.

# Install the Nvidia driver
sudo apt-add-repository ppa:ubuntu-x-swat/updates
sudo apt-get update
sudo apt-get install nvidia-current

# Driver installation needs reboot
sudo reboot now
cmake_minimum_required(VERSION 3.8)
project(dummy)
find_package(PythonLibs 3 REQUIRED)
find_package(PythonInterp ${PYTHONLIBS_VERSION_STRING} REQUIRED)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
cmake_minimum_required(VERSION 3.0.0)
project(so_example)
# needed to link with Python
find_package(PythonLibs REQUIRED)
# a simple shared library
add_library(shared SHARED shared.cpp)
cmake_minimum_required(VERSION 2.8.4)
project(so_31581722)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
set(SOURCE_FILES main.cpp)
cmake_minimum_required(VERSION 2.8.4)
project(so29595222)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES python_threading_example_so29595222.cpp)
@sterin
sterin / CMakeLists.txt
Last active November 7, 2022 12:28
An example showing how to use sub interpreters and threads in Python
cmake_minimum_required(VERSION 2.8.4)
project(py1)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES main.cpp)