Skip to content

Instantly share code, notes, and snippets.

View cretudorin's full-sized avatar

Dorin Cretu cretudorin

  • Ilmenau, Thüringen
View GitHub Profile
@cretudorin
cretudorin / entware zerotier
Last active November 8, 2022 05:39
LibreElec / CoreElec ZeroTier
// install entware
installentware // for coreelec
wget -O - http://bin.entware.net/armv7sf-k3.2/installer/generic.sh | sh // for libreelec rasbperry 3
// update && install zerotier
opkg update
opkg install zerotier
// start the daemon
@cretudorin
cretudorin / nodemcu
Last active August 18, 2019 12:02
using a nodemcu (ESP8266) to send weather data via http using dht22 and bmp180
#include "DHT.h"
#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#define DHTPIN D5
#define DHTTYPE DHT22
@cretudorin
cretudorin / iptables forward all
Created August 24, 2019 17:36
iptables forward all from one nic to other
sudo apt-get install --reinstall iptables
update-alternatives --config iptables
legacy
net.ipv4.ip_forward = 1
sudo sysctl -p /etc/sysctl.conf
iptables -A FORWARD -i eth0 -o ztuze4sgqk -j ACCEPT
@cretudorin
cretudorin / config.txt
Created December 30, 2019 10:30
vu7plus raspberry resolution
# set current over USB to 1.2A
max_usb_current=1
# overscan to adjust image position
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
# HDMI config
@cretudorin
cretudorin / rc.local
Last active July 12, 2022 05:52
Turn off status leds on raspberry change cpu governor
echo 0 >/sys/class/leds/led0/brightness
echo 0 >/sys/class/leds/led1/brightness
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
exit 0
@cretudorin
cretudorin / wp-permissions-script
Created April 1, 2020 13:18 — forked from macbleser/wp-permissions-script
WordPress Permissions Configuration Script
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro
#
WP_OWNER=changeme # &lt;-- wordpress owner
WP_GROUP=changeme # &lt;-- wordpress group
WP_ROOT=/home/changeme # &lt;-- wordpress root directory
@cretudorin
cretudorin / rescueme.txt
Created April 12, 2020 09:19
Change bootloader to grub and timezone after Windows install
# Restore bootloader after Windows install
bcdedit /enum firmware
bcdedit /set {bootmgr} path \EFI\UBUNTU\SHIMX64.efi
# Make Windows use UTC to match ubuntu
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1
/**
* Disable the emoji's
*/
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );

Use nginx as a dns loadbalancer on Debian 10

add deb-src

deb https://*/ buster main contrib non-free => deb-src https://*/ buster main contrib non-free

install build-dep

sudo apt build-dep nginx

find the right version for your system

ngx_version=$(apt-cache policy nginx | grep Candidate | awk -F ':' '{print $2}' | awk -F '-' '{print $1}' | awk '{ gsub(/ /,""); print }')

@cretudorin
cretudorin / ravelry-style.css
Last active April 5, 2021 11:22
ravery css override
:root {
--white-theme-border: #ddd;
--dark-theme-border: #555;
--color-border: var(--white-theme-border);
--color-input-focus: var(--white-theme-border);
--color-infobox-title-border: var(--white-theme-border);
--color-border-black: var(--white-theme-border);
--color-border-dark: var(--white-theme-border);
--color-border-clicker: var(--white-theme-border);
--color-border-tabular-data: var(--white-theme-border);