Skip to content

Instantly share code, notes, and snippets.

View ha7ilm's full-sized avatar
🇭🇺

András Retzler ha7ilm

🇭🇺
View GitHub Profile
@ha7ilm
ha7ilm / debugnn.md
Created September 2, 2022 10:05
Debugging NNs with PyTorch

This is work in progress.

Visualizing gradients


@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 / 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 / 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 / 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 / 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 [email protected] "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 / 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.

Building Inkscape from source on Ubuntu 20.04.2 LTS

sudo apt install libdouble-conversion-dev libpotrace-dev libgtkmm-3.0-dev libpoppler-dev libpoppler-private-dev libpoppler-glib-dev
git clone https://gitlab.com/inkscape/inkscape/
cd inkscape
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/home/$USER/a_sensible_install_directory/inkscape_install ..
make -j6

How to open a Stylus Labs Write .svgz file with Inkscape?

cat something.svgz | gunzip | inkscape -

@ha7ilm
ha7ilm / viber-qt-crash.md
Last active March 5, 2023 16:47
Fix Qt related Viber crash on Ubuntu

I was getting the following error message while trying to run Viber on Ubuntu:

Failed to create OpenGL context for format QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
[1]    929803 abort (core dumped)  /opt/viber/Viber

Solved by running: