Skip to content

Instantly share code, notes, and snippets.

@izaakm
izaakm / touchpad-scroll-speed.md
Created January 12, 2025 01:01 — forked from roopaish/touchpad-scroll-speed.md
Change touchpad scroll speed in ubuntu/pop os
  1. List the Id's and look for 'ELAN1200: ...' or anything with touchpad mentioned :

xinput list

  1. Grab the ID and List the properties for this ID (eg: 14) :

xinput list-props 14

  1. Set the value of the property "libinput Scrolling Pixel Distance" to 50, you can change this value by default is 15, if the value is bigger the acceleration is slower:
@izaakm
izaakm / Subfolder to git repo.md
Created August 29, 2024 10:41 — forked from korya/Subfolder to git repo.md
Convert subfolder into Git submodule
@izaakm
izaakm / slurm.md
Last active April 22, 2024 13:01

Goals

“Submit a job to the scheduler.” = Run software on the cluster!

  • Write job scripts.
  • Select appropriate resources.
  • Submit job scripts.

What is Slurm?

@izaakm
izaakm / getopts.md
Created October 4, 2023 16:26 — forked from caruccio/getopts.md
Read shell options with positional arguments

This example shows how to read options and positional arguments from a bash script (same principle can be applied for other shells).

# some global var we want to overwrite with options
force=false
help=false
log=info
ARGS=() ### this array holds any positional arguments, i.e., arguments not started with dash

while [ $# -gt 0 ]; do
@izaakm
izaakm / jupyterlab_shortcuts.md
Last active September 12, 2021 12:52 — forked from discdiver/jupyterlab_shortcuts.md
Common Jupyter Lab Keyboard Shortcuts

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Command + B toggle hide/show left sidebar

  • Command + S save and checkpoint

  • Command + Shift + S save as

  • Command + F find

@izaakm
izaakm / macOS keyboard layout for Linux
Created March 17, 2021 12:10 — forked from rbreaves/macOS keyboard layout for Linux
Universal macOS keyboard layout for Linux - Applies to All Windows and Apple Keyboards
# permanent apple keyboard keyswap
echo "options hid_apple swap_opt_cmd=1" | sudo tee -a /etc/modprobe.d/hid_apple.conf
update-initramfs -u -k all
# Temporary & instant apple keyboard keyswap
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
# Windows and Mac keyboards - GUI (Physical Alt is Ctrl, Physical Super is Alt, Physical Ctrl is Super)
setxkbmap -option;setxkbmap -option altwin:ctrl_alt_win
@izaakm
izaakm / rank_metrics.py
Created January 8, 2021 22:42 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@izaakm
izaakm / mpi4py_trivial.py
Created January 8, 2021 14:20 — forked from joezuntz/mpi4py_trivial.py
Simplest possible mpi4py job splitting
#Suppose you have a collection of tasks, which in this example I'll assume is just running a function f.
#If these tasks are completely separate and independent the most then you can parallelize them easily.
#In this gist I'll show the simplest possible way to do this using mpi4py.
#There are better ways to do this, in particular if the tasks vary significantly in time taken to run.
import mpi4py.MPI
def f(i):
"A fake task - in this case let just open a file and write a number to it"
#open file with name based on task number