Skip to content

Instantly share code, notes, and snippets.

View tuergeist's full-sized avatar

Christoph Becker tuergeist

View GitHub Profile
@atomical
atomical / bitstream-from-sub.py
Last active December 4, 2024 15:24 — forked from jinschoi/bitstream-from-sub.py
Python script to clean up and recover an OOK bitstream from a Flipper RAW .sub file.
#!/usr/bin/env python
# Find the raw bitstring from a captured Flipper RAW .sub file.
# Must provide the bitlength in ms, and the allowable error which can be tolerated.
import re
import sys
import math
filename = sys.argv[1]
@fm4dd
fm4dd / gcc compiler optimization for arm systems.md
Last active April 11, 2025 08:11
GCC compiler optimization for ARM-based systems

GCC compiler optimization for ARM-based systems

2017-03-03 fm4dd

The gcc compiler can optimize code by taking advantage of CPU specific features. Especially for ARM CPU's, this can have impact on application performance. ARM CPU's, even under the same architecture, could be implemented with different versions of floating point units (FPU). Utilizing full FPU potential improves performance of heavier operating systems such as full Linux distributions.

-mcpu, -march: Defining the CPU type and architecture

These flags can both be used to set the CPU type. Setting one or the other is sufficient.

@sm-azure
sm-azure / application.py
Created October 3, 2016 04:15
Elastic beanstalk Python logging
from flask import Flask, abort, request, jsonify, g, url_for, Response, json
from flask_sqlalchemy import SQLAlchemy
from model.billingmodel import db
from model.billingmodel import User, ManagedAccount, VPNTunnel
from flask_login import LoginManager, login_required, logout_user, login_user, current_user
import logging
from logging.handlers import RotatingFileHandler
import base64
logger = logging.getLogger(__name__)
@jm3
jm3 / README.md
Last active February 19, 2024 04:47
Cognitive Bias Codex
@rafaelcaricio
rafaelcaricio / api.py
Created April 25, 2016 12:34
Custom type format - Connexion
import logging
import re
from connexion import App
from jsonschema import draft4_format_checker
MONEY_RE = re.compile('^\$\s*\d+(\.\d\d)?')
logging.basicConfig(level=logging.DEBUG)
@hezhao
hezhao / django_cmd.sh
Last active May 1, 2024 07:22
Django Commands Cheatsheet
# Use Python 3 for easy unicode
$ virtualenv -p python3 .env
$ source .env/bin/activate
$ pip install django
$ deactivate
# Start new django project and app
$ django-admin.py startproject mysite
$ ./manage.py migrate
$ ./manage.py createsuperuser
@miraculixx
miraculixx / .bashrc
Created July 12, 2014 21:31
add and remove pip install/uninstall from requirements.txt automatically
# add pip install/uninstall to requirements.txt automatically
pipr() {
if [ "$1" == "install" ]; then
pip $1 $2
pip freeze | grep -i $2 >> requirements.txt
echo ok, added $2 as:
tail -n1 requirements.txt
fi
if [ "$1" == "uninstall" ]; then
echo y | pip $1 $2 >> .pipremoved
@matt448
matt448 / slack_nagios.sh
Last active February 13, 2023 15:38
Script to post Nagios notifications into a Slack channel
#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here:
@puppe
puppe / absender.lco
Last active July 30, 2023 20:14
Deutsche Briefvorlage für LaTeX (scrlttr2) (ACHTUNG: Aktualisierte Version jetzt unter https://codeberg.org/puppe/german-latex-letter-template/)
\ProvidesFile{absender.lco}
\KOMAoptions{%
% fromemail=true, % Email wird im Briefkopf angezeigt
% fromphone=true, % Telefonnumer wird im Briefkopf angezeigt
% fromfax=true, % Faxnummer wird im Briefkopf angezeit
% fromurl=true, % URL wird im Briefkopf angezeigt
% fromlogo=true, % Logo wird im Briefkopf angezeigt
% subject=titled, % Druckt "Betrifft: " vor dem Betreff
locfield=wide, % Breite Absenderergänzung (location)