Skip to content

Instantly share code, notes, and snippets.

@JZfi
JZfi / macapps.md
Created December 20, 2023 14:29
MacOS apps and tips

MacOS customization apps and tips

Make your mac usable again. Recommended ones are highlighted.

Window management

  • Rectangle Full featured window manager to enable keyboard shortcuts
  • AltTab Alt-tab to switch between windows

Non-free (See descriptions):

@JZfi
JZfi / x1c6.md
Last active August 24, 2018 22:11
Lenovo ThinkPad X1 Carbon 6th gen (X1C6) and openSUSE Tumbleweed notes

Model 20KH-006MMX (with NFC & HDR) notes for stuff I've done this far to get the machine to an usable state.

openSUSE Tumbleweed works ok and touchpad & trackpoint & hibernation works out-of-the-box (not the case with Ubuntu 18.04 LTS).

To test out hibernation just type (after this it will appear in the GNOME menus):

# systemctl hibernate

BIOS

@JZfi
JZfi / call_python_function.py
Last active January 4, 2017 16:02
Call a python function with a dict of arguments
import inspect
# Call a python function with a dict of arguments
# The dict can contain excess values. This function only picks the supported ones and if they exist in the passed arguments
def call_python_function(module, function_name, argument_dictionary):
funcpointer = getattr(module, function_name)
# Find what arguments the module's function takes
argspec = inspect.getargspec(funcpointer)
# Remove the self that is a python self-reference
argspec.args.remove('self')
# argspec.args is now an empty list if the func doesn't take any arguments
@JZfi
JZfi / debug-ssh-git-ansible
Last active June 12, 2017 12:46
ssh git ansible troubleshooting tips and tricks
Tips on debugging ssh, git and ansible
--- Connection problems
Git 2.3+
GIT_SSH_COMMAND="ssh -vvv" git clone example
Git 2.10+
git config core.sshCommand "ssh -vvv"
git clone example
--- Debug a working connection
@JZfi
JZfi / getAffectivaQcsv.m
Created May 30, 2015 15:50
Affectiva Q sensor support for Ledalab
function [time, conductance, event] = getAffectivaQcsv(fullpathname)
% Import Affectiva Q sensor data from exported headerless csv-files
% v1 by Niklas Juslin
% Headerless csv columns: Time,Z-axis,Y-axis,X-axis,Battery,∞Celsius,EDA(uS),Event
fid = fopen(fullpathname);
data = textscan(fid, '%s %f %f %f %f %f %f %u', 'HeaderLines',0, 'Delimiter',',');
fclose(fid);
conductance = data{1,7};