Skip to content

Instantly share code, notes, and snippets.

@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 \
@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 / 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/
#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 / 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"
@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.8-rpi3.sh
Last active February 22, 2018 22:32
Cross Compile QT 5.8 for Raspberry PI 3
./configure -release -opengl es2 -device linux-rpi3-vc4-g++ -device-option CROSS_COMPILE=/opt/rpi3/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /opt/rpi3/gentoo-sysroot/ -extprefix /opt/Qt/5.8/rpi3 -v -nomake examples -nomake tests -no-use-gold-linker -opensource -confirm-license -skip qtscript
gmake
sudo gmake install
@alepez
alepez / wget-1.19.ebuild
Created October 12, 2017 14:43
wget 1.19 ebuild for old (2015) gentoo
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
EAPI="4"
PYTHON_COMPAT=( python{3_3,3_4} )
inherit flag-o-matic python-any-r1 toolchain-funcs eutils
DESCRIPTION="Network utility to retrieve files from the WWW"
@alepez
alepez / boost-android-build.sh
Created October 3, 2017 20:13
Build boost for android
#!/bin/bash
version=1.65.1
echo "Building boost $version..."
set -eu
toolchain=$PWD/toolchain
if [ ! -d "$toolchain" ]; then
echo "Building toolchain..."
@alepez
alepez / cross-compile-rpi3-kernel.sh
Last active September 28, 2017 14:52
Cross Compile Raspberry Pi 3 Kernel
make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- bcm2709_defconfig
make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- -j9 zImage modules dtbs
cp arch/arm/boot/zImage /mnt/raspberrypiroot/boot/ ; cp arch/arm/boot/dts/*.dtb /mnt/raspberrypiroot/boot/ ; cp arch/arm/boot/dts/overlays/*.dtb* /mnt/raspberrypiroot/boot/overlays/ ;
sudo make ARCH=arm CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- INSTALL_MOD_PATH=/mnt/raspberrypiroot modules_install