Skip to content

Instantly share code, notes, and snippets.

View fpersson's full-sized avatar

Fredrik Persson fpersson

View GitHub Profile
@fpersson
fpersson / makefile
Created December 1, 2023 14:32 — forked from ibiqlik/makefile
Makefile bump git tag and push
RELEASE_TYPE ?= patch
LATEST_TAG ?= $(shell git ls-remote -q --tags --sort=-v:refname | head -n1 | awk '{ print $2 }' | sed 's/refs\/tags\///g')
LATEST_SHA ?= $(shell git rev-parse origin/main)
NEW_TAG ?= $(shell docker run -it --rm alpine/semver semver -c -i $(RELEASE_TYPE) $(LATEST_TAG))
release:
git tag "v$(NEW_TAG)" $(LATEST_SHA)
git push origin "v$(NEW_TAG)"
@fpersson
fpersson / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created June 26, 2020 10:01 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@fpersson
fpersson / bluetooth-raspberry-pi-communication.py
Created February 4, 2019 12:23 — forked from keithweaver/bluetooth-raspberry-pi-communication.py
Sending information with bluetooth on Raspberry Pi (Python)
# Uses Bluez for Linux
#
# sudo apt-get install bluez python-bluez
#
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html
import bluetooth
def receiveMessages():
@fpersson
fpersson / Readme.md
Created April 30, 2018 11:08
To build kde-connect on Kubuntu 18.04

To build kde-connect on Kubuntu 18.04:

Install: sudo apt install libkf5kcmutils-dev kdesrc-build libqca-qt5-2-dev

Apply: backport_5.44.patch

@fpersson
fpersson / download_eso.sh
Created April 12, 2017 14:02
ladda ner spel till windows från linux
#!/bin/bash
USERNAME=""
APPID="306130" #ESO
DEST=""
steamcmd +@sSteamCmdForcePlatformType windows +login $USERNAME +force_install_dir $DEST +app_update $APPID validate +quit
@fpersson
fpersson / CMakeLists.txt
Last active January 2, 2017 13:47
Minimal sytemd app
cmake_minimum_required(VERSION 3.6)
project(testd)
set(CMAKE_CXX_STANDARD 11)
find_package(PkgConfig)
pkg_check_modules(SYSTEMD libsystemd REQUIRED)
IF(NOT SYSTEMD_FOUND)
message(FATAL_ERROR "ERROR: Systemd not found")
@fpersson
fpersson / unix_color.cpp
Last active November 23, 2022 11:12
Unix color for c++
#ifndef UNIX_COLOR_H
#define UNIX_COLOR_H
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/bin/bash
#put in $HOME/bin/
OIFS=$IFS
NOW=$(date +"%y%m%d")
IFS='.' read -r -a array <<< $1
for result in "${array[@]}"; do
echo $result
done
@fpersson
fpersson / daemon.py
Created July 22, 2016 14:13
Python daemon example
#!/usr/bin/env python
# coding: utf-8
import argparse
import os
import sys
import time
import atexit
import logging
import signal
@fpersson
fpersson / 51-android.rules
Created November 27, 2015 09:33
/etc/udev/rules.d/
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0x15a2", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="2207", MODE="0666", GROUP="plugdev"
#Acer
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0660", GROUP="plugdev"
##ASUS
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0660", GROUP="plugdev"