Skip to content

Instantly share code, notes, and snippets.

View ha7ilm's full-sized avatar
🇭🇺

András Retzler ha7ilm

🇭🇺
  • Belgium
  • 11:28 (UTC -12:00)
View GitHub Profile
@ha7ilm
ha7ilm / wacom-tip.md
Last active August 11, 2021 10:35
Mapping button 4 of Wacom Intuos BT under Linux
xsetwacom set "Wacom Intuos BT S Pad pad" Button 8 <something>

For some reason, button #4 is actually Button 8. It turned out from xev output.

@ha7ilm
ha7ilm / remote-clipboard.md
Last active August 19, 2021 19:51
copying image from clipboard of remote machine to clipboard of local machine over SSH in Linux
#!/bin/sh
rm /tmp/cliprect.png
ssh user@example.com "DISPLAY=:0 xclip -selection clipboard -t image/png -o -" > /tmp/cliprect.png
if [ $? -eq 1 ]; then
    notify-send -t 10000 "failed getting png from remote machine"
else
    xclip -selection clipboard -t image/png -i /tmp/cliprect.png
fi
@ha7ilm
ha7ilm / coppeliasim.md
Created August 24, 2021 11:15
_ZdlPvm, version Qt_5 with Coppeliasim

Problem

error: undefined symbol: _ZdlPvm, version Qt_5"

Solution

You did run ./coppeliaSim. Run ./coppeliaSim.sh instead.

@ha7ilm
ha7ilm / xft.md
Last active September 6, 2021 07:59
change Xft.dpi on the fly

This is normally in .Xresources:

$ cat .Xresources 
Xft.dpi: 130

To change it on the fly:

@ha7ilm
ha7ilm / i3.conf
Last active October 22, 2021 16:11
Prompt to rename current workspace in i3 so that the new name starts with the number of the current workspace, e.g. "1:term"
bindsym $mod+u exec i3-input -F "rename workspace to \"$(i3-msg -t get_workspaces | jq -r \"map(select(.focused))[0].num\"):%s\"" -P 'New name for this workspace: '
@ha7ilm
ha7ilm / openwebrx-quick-setup.sh
Last active February 3, 2022 22:13
Setting up OpenWebRX on Ubuntu 14.04 LTS
#Install dependencies
sudo apt-get install build-essential git libfftw3-dev cmake libusb-1.0-0-dev
#Fetch and build rtl-sdr, skip if already done (subdirectories will be created under the current directory).
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
@ha7ilm
ha7ilm / wsl.md
Last active May 23, 2022 16:24
Execute command inside Windows Terminal and WSL

Execute command inside Windows Terminal and WSL

I do it like this:

wt -p "Ubuntu" wsl zsh -c "command_to_execute"
  • Ubuntu is the name of the profile
  • zsh is my shell
  • command_to_execute is what I would type into zsh
@ha7ilm
ha7ilm / root_dir_of_git_repo_matlab.m
Last active June 15, 2022 08:46
How to get the absolute path of the root directory of the current git repo in MATLAB
[~,gcr]=system("git rev-parse --show-toplevel"); gcr=strsplit(gcr,newline); gcr=[gcr{1} filesep]; %root of repo
@ha7ilm
ha7ilm / debugnn.md
Created September 2, 2022 10:05
Debugging NNs with PyTorch

This is work in progress.

Visualizing gradients


@ha7ilm
ha7ilm / torch-rfft-derivative.md
Created October 31, 2022 06:06
calculate the derivative of a signal with torch.fft
F_signal = torch.fft.rfft(signal])
w = ((((torch.arange(0,301))/600)*(2*torch.pi))) #signal is 600 samples long
d_signal = torch.fft.irfft(w*torch.tensor(complex(0,1))*F_signal)*(1/dt)