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 / 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 / git-dropbox.sh
Created September 15, 2012 09:22 — forked from klang/git-dropbox.sh
git repository on dropbox
export DROPBOX=~/Dropbox/repos
export newRepo=project-name
export NAME=$(git config --global --get user.name)
cd ~/projects/$newRepo
git init
git add .
git commit -m 'initial'
HERE=$(pwd)
@fpersson
fpersson / facts.lua
Created September 9, 2011 21:34 — forked from randrews/facts.lua
Make Lua look like Prolog!
----------------------------------------------------------------------------------------------------
--- Making Lua look like Prolog:
---
--- Let's use metatables for something other than emulating prototype-based OO. By making the
--- __index metamethod create values for undefined things, we can make Lua look like Prolog!
--- We create empty tables for anything starting with a capital letter, functions that populate
--- those tables for lowercase things (to assign relationships) and if a name begins with "is_"
--- then it becomes a function that queries those tables.
----------------------------------------------------------------------------------------------------
@fpersson
fpersson / about.md
Created September 9, 2011 20:59 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer