Skip to content

Instantly share code, notes, and snippets.

View nhasbun's full-sized avatar

Nicolas Hasbun nhasbun

  • Santiago, Chile
View GitHub Profile
@nhasbun
nhasbun / *pycharm-setup-2019.3.md
Created July 20, 2020 23:05 — forked from rszeto/*pycharm-setup-2020.3.2.md
Setting up PyCharm project with remote interpreter

Setting up PyCharm project with remote interpreter

Setting up a remote interpreter on PyCharm is awfully unintuitive. I've pared it down to what I think is the minimal number of steps, and leaves the fewest number of deployment configurations and Python interpreters lying around. This is designed for my specific configuration (specifically PyTorch); adapt as needed.

Configuring default project (only do after installing PyCharm for the first time):

  1. (Optional) Add virtual environment path to excluded files
    1. From Welcome Page, go to Configure > Settings > Build, Execution, Deployment > Deployment > Options
    2. Add virtualenv path. For example, if you always have the project's virtualenv in .env, add ";.env" to the "Exclude items by name" field
@nhasbun
nhasbun / msys2-here-uninstall.reg
Created September 25, 2020 04:39 — forked from elieux/msys2-here-uninstall.reg
MSYS2 here context menu items
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here]
@nhasbun
nhasbun / telnet.py
Created April 27, 2022 15:49 — forked from pedrominicz/telnet.py
Extremely simple Telnet server in Python.
#!/usr/bin/env python3
import socket
# Connect to the server with `telnet $HOSTNAME 5000`.
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.setblocking(False)
server.bind((socket.gethostname(), 5000))
server.listen(5)
The USB Blaster udev rules on the Altera website
( http://www.altera.com/download/drivers/dri-usb_b-lnx.html )
did not work for me on Debian Jessie/Sid. A modified version of the file, listed below, works for me
(this is the contents of /etc/udev/rules.d/51-usbblaster.rules ). After restarting udev
(`sudo service udev restart`) I was able to program the DE0-Nano.
# USB-Blaster
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666", GROUP="plugdev"