Skip to content

Instantly share code, notes, and snippets.

View technikamateur's full-sized avatar

Daniel technikamateur

  • Dresden, Germany
View GitHub Profile
@technikamateur
technikamateur / locker.c
Created May 16, 2024 17:23
This small example shows how to use cmpxchg in C using inline assembly
#include <stdio.h>
#include <stdint.h>
uint32_t lockin = 0;
uint32_t cmpxchg(uint32_t new, uint32_t old, volatile uint32_t* lock) {
uint32_t result = 0;
asm volatile(
"lock cmpxchg %2,%1\n"
"sete (%3)\n"
@technikamateur
technikamateur / gitea-backup.service
Last active August 3, 2023 09:47
Gitea systemd daily backup
# Contents of /etc/systemd/system/gitea-backup.service
[Unit]
Description=This service backups gitea
[Service]
Type=oneshot
ExecStart=/usr/local/bin/ultimative-backupper
[server]
skip_name_resolve = 1
innodb_buffer_pool_size = 128M
innodb_buffer_pool_instances = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 32M
innodb_max_dirty_pages_pct = 90
query_cache_type = 1
query_cache_limit = 2M
query_cache_min_res_unit = 2k
@technikamateur
technikamateur / tlp
Created April 21, 2020 14:06
tlp config file, optimized for ThinkPads
# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# Hint: some features are disabled by default, remove the leading # to enable
# them.
# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1
# Dirty page values (timeouts in secs).
@technikamateur
technikamateur / ch414prog.sh
Last active December 26, 2019 19:40
Installation of CH314prog under Debian (Ubuntu) based systems
# Run the following lines (line by line) in your terminal
git clone https://github.com/setarcos/ch341prog.git
sudo apt install libusb-1.0-0 libusb-1.0-0-dev
make
@technikamateur
technikamateur / file.txt
Last active October 28, 2018 11:49
Kubuntu minimal
# This is a list of packages to be removed when the 'minimal' option is
# selected during installation.
# Extract from http://people.canonical.com/~ubuntu-archive/seeds/kubuntu.bionic/desktop.minimal-remove
# Desktop apps
kamera
konversation
ktorrent
package videoshop.customer;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;
@Component
public class CustomerNewMail {
private final JavaMailSender emailSender;
@technikamateur
technikamateur / bpi-nextcloud.conf
Last active January 19, 2023 17:12
Banana Pi Nextcloud - site config for nginx
upstream php-handler {
#TODO php Version anpassen
server unix:/var/run/php/php7.4-fpm.sock;
}
server {
listen 80;
listen [::]:80;
#TODO Domain anpassen bzw. IP einfügen
server_name cloud.example.com;