вторник, 21 април 2020 г.

Convert a pdf and decrease size

First:
convert  -density 200 -trim AS1.pdf AS2.pdf AS3.pdf AS4.pdf AS_all.pdf
And then "Print to file". That's it. It decreased a 25MB file to 6.7MB. Pretty good.
P.S. That's an interesting one, but obviously it works only with 1 page:
convert -density 600 test.pdf -background white -flatten -resize 25% test.png

вторник, 7 април 2020 г.

uploading screenshots to steam on Linux

My steam overlay is not working. I have no idea why.
I enabled it both from Steam->Settings->In-Game and for each game separately, I added
LD_PRELOAD='/home/USER/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so'
as a game option, I changed all possible key-bindings to something free. And still, nada.
I checked the output of: 
$cat /tmp/dumps/`id -un`_stdout.txt
nothing very informative but some ELF errors which too annoying to even start working on.
So for the moment I'm leaving it aside and posting the workaround.
What I did is this:
https://steamcommunity.com/sharedfiles/filedetails/?id=1358157391
If you do what's described using Chrome, it actually uploads your screenshots as a screenshot, not as art. So that's something I guess.
In brief:
 Load http://steamcommunity.com/sharedfiles/edititem/767/3/
Press
Ctrl + Shift + J
Then paste into the console
$J('#image_width').val('1000'); 
$J('#image_height').val('1'); 
$J('[name="file_type"]').val("5");
And press enter. It gives some kind of error but still, it works. So after choosing your file and describing it, you end up with a Screenshot! :)
The only problem is that you cannot add tags, so it won't go to the Community Hub. 

dictionaries for LibreOffice

For whatever unknown reason aspell is not working well on my system. Like at all, spell-checking works fine only on Firefox because it has its own dictionaries obviously. In kwrite it works but only for some predefined dictionaries and I cannot add Bulgarian to it, even though I have aspell-bg installed. Oh well.
In any case, what helped in the end is downloading the dictionary for LibreOffice from:
https://wiki.documentfoundation.org/Language_support_of_LibreOffice
(for Bulgarian dictionary, go to:
https://extensions.openoffice.org/en/project/dictionaries-bg
for Spanish:
https://extensions.openoffice.org/en/project/diccionario-de-correccion-ortografica-separacion-silabica-y-sinonimos-en-espanol-espana)
Get the *.oxt files. 
And then from Tools->Extension Manager
You click Add and you add the dictionary you downloaded.
Note, you need to restart and also to change your dictionary by right-clicking and choosing Spelling and from the top of the window you choose your dictionary.
Happy spelling!