сряда, 28 ноември 2018 г.

convert jpg to pdf error

Obviously, ImageMagick has some vulnerability which is "solved" by stopping it do what you would expect it to do. Like covert jpg or png files to a pdf. I was quite surprised by this, but luckily people have found a way to solve it (read here):

$ sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xmlout
$ convert *.jpg my_new.pdf
$ sudo mv /etc/ImageMagick-6/policy.xmlout /etc/ImageMagick-6/policy.xml

It's tempting to permanently edit the rules and to remove the line, but then I do that probably once a year, so I can easily type 3 lines instead of 1. And safety above all, lol.

вторник, 4 септември 2018 г.

How to restart wifi after suspend

My laptop seems to have a problem with one particular router that after suspend, every now and then (though not always) it will not restore the connection. It freezes on "Authenticating" and after some time, it stops trying to reconnect.
I tried restarting the module for the network:
$sudo rmmod r8169 && sudo modprobe r8169
but it didn't help.
I also tried restarting everything related to the network with:
$sudo systemctl restart *network*
Also it didn't help.
What it finally helped was:
sudo nmcli con up id #name_of_the_network --ask
After inputting the key for the Wifi network, it reconnected! YAY!
Thank you Arch community for suggesting this on one of the pages I digged trough.

понеделник, 16 юли 2018 г.

Troubleshoot the touchpad

How to compile your own driver for the touchpad:
1. Download source Sabayon
2. cd
3. Check (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1653456)
$make mrproper 
$ cp /lib/modules/$(uname -r)/build/.config ./
$ cp /lib/modules/$(uname -r)/build/Module.symvers ./
$ make oldconfig

Find the "extraversion" of your distro ("-sabayon" in my case)

$cat /lib/modules/$(uname -r)/build/Makefile|head
# SPDX-License-Identifier: GPL-2.0
NAME = Fearless Coyote
$make EXTRAVERSION=-sabayon modules_prepare
$ make M=~/linux_elan1200_touchpad-master/
Next step might be unneeded because all you need is the hid-elan.ko to be able to load it as a module with modprobe.  
$xz ~/linux_elan1200_touchpad-master//hid-elan.ko 

How to unfreeze multitouh (careful with this cuz I had to restart once because I accidently unbinded the keyboard):
cd /sys/bus/hid/drivers/hid-multitouch
# ls
0018:04F3:3043.0007 bind module new_id uevent unbind
# echo "0018:04F3:3043.0007" | sudo tee /sys/bus/hid/drivers/hid-multitouch/unbind
# echo "0018 04F3 3043 0013" | sudo tee /sys/bus/hid/drivers/hid-multitouch/new_id

How to restart touch modules (it seems that hid-multitouch is not the one that freezes):
$lsmod|grep i2c
i2c_hid                24576  0
i2c_i801               32768  0
i2c_algo_bit           16384  2 igb,i915
$sudo rmmod i2c_hid
$sudo modprobe i2c_hid