Skip to content

Instantly share code, notes, and snippets.

# Use like: python setx.py my_python_program [args...]
#
# my_python_program can be a literal path to a file (e.g., foo.py), or the unqualified
# name of a Python program in PATH. In the latter case, setx.py examines PATH for
# a program with that name.
#
# Prints every line executed, including the filename and line number.
#
# This is a hacky prototype for py27; it almost certainly breaks in significant ways on
# non-Unix, or Python3000; and has only been tested on a FreeBSD derivative. It still
@bglopez
bglopez / get_windows_ip.sh
Created August 4, 2020 18:33
Get IP address of Windows 10 host through WSL2. MobaXterm's X11 forwarding seems to work only when you set the DISPLAY variable to the LAN IP address of the Windows host itself and not the VM IP or 127.0.0.1.
#!/usr/bin/env bash
# example output
# regex in mywinip can be replaced with the following to snag more private subnets:
# '^.*(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.).*'
# but it *will* catch the 172 address assigned to the VM/as gateway as well
#
# mygw: 172.20.192.1
# mywinhost: DESKTOP-N2VKDIR
# mywinip: 192.168.0.39

Keybase proof

I hereby claim:

  • I am bglopez on github.
  • I am bglopez (https://keybase.io/bglopez) on keybase.
  • I have a public key ASAZhnuiMtdwkl5q1WPNnWplVzSXP-M587KzrYmnQp-X1wo

To claim this, I am signing this object:

@bglopez
bglopez / template.pl
Created June 21, 2019 07:14 — forked from gjherbiet/template.pl
A Perl script template
#!/usr/bin/env perl -w
##############################################################################
# File :
# Author : Guillaume-Jean Herbiet <guillaume-jean@herbiet.net>
#
#
# Copyright (c) 2010 Guillaume-Jean Herbiet (http://herbiet.net)
#
# This program is free software: you can redistribute it and/or modify