Skip to content

Instantly share code, notes, and snippets.

@alepez
alepez / cross-compile-qt-imx6-vivante.md
Created October 26, 2017 10:39
cross compile qt imx6 vivante
./configure -release -opengl es2 -device linux-imx6-g++ -device-option CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- -sysroot /opt/imx6-gentoo/sysroot -extprefix /opt/Qt/5.9.2/imx6 -v -nomake examples -nomake tests -no-use-gold-linker -opensource -confirm-license -skip qtscript -no-sql-psql -no-sql-mysql
@alepez
alepez / cross-compile-qt5.9.2-rpi3.md
Created November 2, 2017 23:13
Cross Compile Qt 5.9.2 for Raspberry Pi 3 on Gentoo

Example of make.conf with distcc enabled

/etc/portage/make.conf

CFLAGS="-mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

CHOST="armv7a-hardfloat-linux-gnueabi"
#include "opencv2/opencv.hpp"
#include <ctime>
#include <sys/timeb.h>
using namespace cv;
int main(int, char**) {
VideoCapture cap(1); // open the default camera
if (!cap.isOpened()) // check if we succeeded
return -1;
@alepez
alepez / android-crystax-build-openssl.md
Last active November 12, 2017 16:06
Android Crystax build OpenSSL

You have Crystax installed in /opt/crystax

CRYSTAX_ROOT=/opt/crystax

Which version does crystax expect?

ls ${CRYSTAX_ROOT}/sources/openssl/
@alepez
alepez / chromium-gpu-vivante.sh
Created November 16, 2017 14:06
Chromium Hardware Acceleration i.MX6 Vivante
#!/bin/sh
if [ "${1}" == "forever" ]; then
while sleep 1; do "${0}"; done
exit 0
fi
export DISPLAY=:0
# url="http://jsfiddle.net/gionaf/Ugc5g/embedded/result/"
@alepez
alepez / gpg-key-to-datamatrix.sh
Created November 24, 2017 11:22
GPG to Printable Datamatrix
#!/bin/bash
add_caption() {
convert "${1}" \
-quality 100 \
-units PixelsPerInch \
-resize 200% \
\( -background white -fill black -size x48 \
label:"${2}" -trim +repage \
-bordercolor white -border 10 \
#include <cassert>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
std::vector<int> toVector(const std::string& str) {
std::vector<int> result;
for (auto c : str) {
result.push_back(c - '0');
@alepez
alepez / xbindkeys_1.8.6.bb
Created December 21, 2017 10:44
xbindkeys yocto recipe
SUMMARY = "xbindkeys - Tool for launching commands on keystrokes"
HOMEPAGE = "http://www.nongnu.org/xbindkeys/xbindkeys.html"
LICENSE = "GPL"
LIC_FILES_CHKSUM = "file://COPYING;md5=24396300012ca5a98ff24b08179852a0"
SECTION = "x11"
DEPENDS = "virtual/libx11"
PR = "r0"
inherit distro_features_check autotools
@alepez
alepez / update-adblock-list
Created January 12, 2018 13:37
adblock: Generates dnsmasq rules for NetworkManager
#!/bin/sh
FAKE_SERVER_ADDRESS='127.8.8.8'
URL='http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext'
FILENAME='/etc/NetworkManager/dnsmasq.d/adblock'
## do not update if fresh (24h)
if test -e "${FILENAME}"; then
echo 'file exists'
if ! test "$( find "${FILENAME}" -mmin +1440 )"; then
@alepez
alepez / brother-top-margin-cut-off-FIX.md
Created January 26, 2018 22:17
Brother MFC-J480DW cuts off top margin

Brother MFC-J480DW cuts off top margin

In Linux, my Brother MFC-J480DW cuts off top margin when used with A4 paper, even if all settings are set to A4.

To make it work, I had to edit /opt/brother/Printers/mfcj480dw/inf/brmfcj480dwrc file (that's the path in Gentoo, it could be different in other distributions).

And change:

PaperType=Letter