Skip to content

Instantly share code, notes, and snippets.

View ha7ilm's full-sized avatar
🇭🇺

András Retzler ha7ilm

🇭🇺
  • Belgium
  • 20:51 (UTC -12:00)
View GitHub Profile

Custom battery module for polybar

I made this hack as the built-in battery module failed to display the battery status correctly after waking up from suspend.

[module/custom-battery]
type = custom/script
exec = acpi -b | cut -d' ' -f3-5 | sed 's/Unknown/Charging/g' | sed 's/^/  /'
tail = true
interval = 30

How to make formulas appear larger in Jupyter notebooks? Just add \Large to the beginning of the formula block.

E.g. $\Large \sigma$

@ha7ilm
ha7ilm / 61-zbook-kbd.hwdb
Last active July 17, 2019 15:45
HP Zbook 15v hbdw file for keyboard
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHewlett-Packard*:pn*:pvr*
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnHP*:pn*:pvr*
KEYBOARD_KEY_a0=mute
KEYBOARD_KEY_ae=volumedown
KEYBOARD_KEY_b0=volumeup
KEYBOARD_KEY_90=previoussong
KEYBOARD_KEY_99=nextsong
KEYBOARD_KEY_a2=playpause
KEYBOARD_KEY_81=f20
@ha7ilm
ha7ilm / ju.m
Last active October 18, 2019 12:41
ju - Autojump for MATLAB
% Copyright 2019 Andras Retzler <randras@sdr.hu>
%
% Permission is hereby granted, free of charge, to any person obtaining a copy of this software
% and associated documentation files (the "Software"), to deal in the Software without restriction,
% including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
%and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
% subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in all copies or substantial
% portions of the Software.
@ha7ilm
ha7ilm / python-hexdump.md
Last active November 5, 2019 06:43
A one line hexdump function for python
def xxd(d): return reduce(lambda x,y:x+y+" ", map(lambda p:("0" if ord(p)<=0xf else "")+hex(ord(p))[2:],d), "")
    
print xxd("cat")
print xxd("\x0f\x05\x01")





This code sample was made by Andras Retzler, and is released under the MIT license.

@ha7ilm
ha7ilm / e55bt.md
Last active December 4, 2019 09:53

JBL E55BT

I had a problem with my new bluetooth headphones JBL E55BT.

When connected to my Linux PC, there was an unacceptable background noise and I could hear the audio driver switch on and off even during silent periods inside music.

Solution: The headphones have a separate volume control, which can be adjusted with the buttons on the device. (This is not connected to the mixer volume on the PC.) By default, that was adjusted to maximum for some reason. Turning it down and adjusting a higher volume with Pulseaudio helped to reduce the noise to an acceptable level.

Match whole word in Google Docs search & replace

To match all the asdf enable regexp and type this in the search box: \basdf\b

@ha7ilm
ha7ilm / ranger-cd-for-zshrc.sh
Created July 31, 2016 11:02
ranger-cd for zsh
#This is based on: https://github.com/ranger/ranger/blob/master/examples/bash_automatic_cd.sh
#Paste this into your .zshrc:
function ranger-cd {
tempfile="$(mktemp -t tmp.XXXXXX)"
/usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd -- "$(cat "$tempfile")"
fi

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

cat something.svgz | gunzip | inkscape -

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