Skip to content

Instantly share code, notes, and snippets.

View krauthex's full-sized avatar

Fabian Krautgasser krauthex

View GitHub Profile
import sys
import time # for example
from typing import Optional, Callable, Any
def keyboard_interrupt_handler(*, save: Optional[Callable[..., Any],
abort: Optional[Callable[..., Any]) -> Callable[..., Any]:
"""Use as decorator to handle KeyboardInterrupts while running a simulation.
The given function objects for save and abort will be called depending on
the choice of aborting the simulation directly or saving the contents first.
@krauthex
krauthex / hiddenWifi.md
Last active January 30, 2019 13:38
Hidden Wifi issue with NetworkManager on Dell XPS 13 9370

Tried running various Linux distributions on the XPS: elementary OS, Kali Linux and now Solus OS - all of them shipped with NetworkManager. In my current housing situation we have a hidden wifi, and I have no chance to change that. Interestingly, when I tried to connect to the hidden wifi using the nm-applet, the connection always closed and I got no meaningful errors. Additionally, I have a Lenovo Thinkpad Yoga S1 running Arch Linux and using netctl for wifi, which had no issue whatsoever to connect to the hidden wifi; I did have to write the config file on my own though, but it only differed from a regular wpa connection by one line, namely Hidden=yes.

What finally worked for the XPS was a set of commands to address NetworkManager's command line interface:

nmcli c add type wifi con-name <connect name> ifname <network device> ssid <wifi ssid>
nmcli con modify <connect name> wifi-sec.key-mgmt wpa-psk
nmcli con modify <connect name> wifi-sec.psk <password>
nmcli con up <connect name>