Combine images to PDF in linux

Using convert utility we can join multiple image files (png, jpeg, pdf) into one pdf. convert -density 250 file1.pdf file2.JPG file3.pdf -compress JPEG -quality 70 combined.pdf we use JPEG compression with quality =90 for images inside PDF. Otherwise the PDF will be too large. source For me images appear rotated inside the pdf. That’s probably because EXIF information about image rotation is not taken into account by pdf converter. You can remove all the meta information first with convert <input file> -strip <output file> and then combine it to a pdf....

May 3, 2017 · SergeM

Motor drivers / controllers

Articles about raspberry pi: here SN74HC595 shift register. Controlling from Raspberry: here Comparison of Polou DC motor drivers Comparison of stepper motor drivers DC motors Pololu DRV8833 Dual Motor Driver Carrier exp-tech 4,95€ two DC motors or one stepper motor 2.7‌‌–10.8 V 1.2 A continuous (2 A peak) per motor Motor outputs can be paralleled to deliver 2.4 A continuous (4 A peak) to a single motor Reverse-voltage protection circuit...

April 23, 2017 · SergeM

SN74HC595 shift register. Controlling from Raspberry

For other links about raspberry pi go here Pinouts How to control It seems that procedure described in Texas Instruments’ datasheet is wrong: Using in motor shield DK Electronics V1 Scheme: L293x Quadruple Half-H Driver (pdf) Connection Raspberry PIN 6 -> Shield GROUND Raspberry PIN 11 -> Shield PIN 8 (Register PIN 14, SER / DS) Raspberry PIN 12 -> Shield PIN 12 (Register PIN 12, SRCLK / SHCP) Raspberry PIN 13 -> Shield PIN 4 (Register PIN 11, RCLK / STCP)...

April 23, 2017 · SergeM

How to hide Firefox title bar in Cinnamon (mint)

Source here Install devilspie: sudo apt-get install devilspie There is also a gui called gdevilspie, but the rules it produced seemed inaccurate and often didn’t quite work, so it is easiest to concoct a rule by reading the readme and the manpage. How the rule was created All rules created must go in ~/.devilspie, and have a .ds extension, so firstly create the folder if it doesn’t exist with mkdir ~/....

April 13, 2017 · SergeM

SSH cheat sheet

Create more secure ssh keys Create a key using elliptic curve cryptography (more secure): ssh-keygen -a 100 -t ed25519 generate RSA key of length 4096 to file my_key ssh-keygen -t rsa -b 4096 -C "your@e-mail.com" -f my_key Generate md5 fingerprint of the key (works in newer ubuntu, 16): ssh-keygen -lf ./my_key -E md5 see also: Upgrade Your SSH Key to Ed25519 How to prevent SSH from scanning all the keys in ....

April 12, 2017 · SergeM

Convert ovpn config file to .ca, .crt, .key

How you can take an OpenVPN .ovpn config file and extract the certificates/keys Copy from between <ca> tags into ca.crt, remove <ca> tags from original file. Copy from between <cert> tags into client.crt, remove <cert> tags. Copy from between <key> tags into client.key, remove <key> tags. Copy from between <tls-auth> tags into ta.key, remove <tls-auth> tags. Remove the line “key-direction 1” Above "# -----BEGIN RSA SIGNATURE-----" insert the following lines. ca ca....

April 2, 2017 · SergeM

"No protocol specified" while running a program as another user

Running some GUI application as another user: user1@laptop:~$ su - user2 user2@laptop:~$ leafpad ~/somefile.txt No protocol specified The problem is user2 doesn’t have access to your screen. Solution: xhost + Probably not the safest one. Source: thread

March 30, 2017 · SergeM

Mocking in Python

Let’s consider how python standard unittest module suppose to use mocks. Assume we want to test a method that creates and uses objects of other classes: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 # content of module.py # classes that we want to mock class ClassName1: pass class ClassName2: pass # class that we want to test class ProductionClass: def foo(self, parameter1, parameter2): object1 = module....

March 6, 2017 · SergeM

On image search

ParaDISE - Parallel Distributed Image Search Engine. Based on Hadoop, probably offline processing. Image Similarity service (github) - scala based image similarity service, declared to be scalable. Image storage and image similarity logic is implemented within independent, stateless micro-services. Data is stored in postgres. Clustering is based on histograms. 1 contributor. No tests. abandoned. ViSense SDK for python - SDK for closed source image search List of Content-based image retrieval (CBIR) engines (wikipedia)...

March 5, 2017 · SergeM

About bloody enterprise

Twelve factor app Modules vs Microservices About reasonable choice for architecture To read: Best Practices for Building a Microservice Architecture События, шины и интеграция данных в непростом мире микросервисов Spring Nice tutorials about Spring For example How To Do @Async in Spring

February 24, 2017 · SergeM