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 / Raspberry USB eth0.txt
Last active January 1, 2019 18:32
Raspberry USB Interface with ssh
config.txt
dtoverlay=dwc2
cmdline.txt
after rootwait add:
modules-load=dwc2,g_ether
@cretudorin
cretudorin / raspicam.service
Last active April 29, 2022 18:07
raspicam stream with mjpg_streamer
[Unit]
Description=Camera streamer for raspberry pi
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/local/bin/mjpg_streamer -i "input_uvc.so -r 1280x720 -q 100 -y -d /dev/video0" -o "output_http.so -p 8090"
[Install]
WantedBy=multi-user.target
#!/usr/bin/env python
# !/usr/bin/python
#--------------------------------------
# ___ ___ _ ____
# / _ \/ _ \(_) __/__ __ __
# / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/ /_/___/ .__/\_, /
# /_/ /___/
#
# bmp180.py
@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