Skip to content

Instantly share code, notes, and snippets.

@HoracioDos
HoracioDos / fix-broken-apt-get-update.sh
Created August 9, 2021 13:36 — forked from rashkopetrov/fix-broken-apt-get-update.sh
Fix `Error: Timeout was reached ` when doing `apt-get update`
#!/bin/bash
# source: https://www.linuxquestions.org/questions/debian-26/apt-get-update-gets-stuck-while-reading-package-list-on-my-slug-795324/
mv /var/lib/dpkg/status /var/lib/dpkg/status.broken.bak
cp /var/lib/dpkg/status-old /var/lib/dpkg/status
rm -rf /var/lib/apt/lists/*
dpkg --configure -a
aptitude update
aptitude upgrade
[Unit]
Description=Check WS3080 USB Lock
After=network.target weewx.service
[Service]
PIDFile=/run/%I.pid
WorkingDirectory=/usr/share/weewx/user
ExecStart=/usr/share/weewx/user/chkusblck
KillSignal=SIGINT
@HoracioDos
HoracioDos / noip2.service
Created May 9, 2019 20:01 — forked from NathanGiesbrecht/noip2.service
Systemd Service file for no-ip.com dynamic ip updater
# Simple No-ip.com Dynamic DNS Updater
#
# By Nathan Giesbrecht (http://nathangiesbrecht.com)
#
# 1) Install binary as described in no-ip.com's source file (assuming results in /usr/local/bin)
# 2) Run sudo /usr/local/bin/noip2 -C to generate configuration file
# 3) Copy this file noip2.service to /etc/systemd/system/
# 4) Execute `sudo systemctl enable noip2`
# 5) Execute `sudo systemctl start noip2`
#
@HoracioDos
HoracioDos / fr24feed
Created May 2, 2019 11:03
Logrotate fr24feed
# /etc/logrotate.d/fr24feed
/var/log/fr24feed/fr24feed.log {
weekly
rotate 4
missingok
notifempty
postrotate
invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
endscript
}
@HoracioDos
HoracioDos / mqtt.py
Created April 29, 2019 23:04
Weewx MQTT extension with enable option
# $Id: mqtt.py 1784 2018-08-26 15:46:33Z mwall $
# Copyright 2013 Matthew Wall
"""
Upload data to MQTT server
This service requires the python bindings for mqtt:
pip install paho-mqtt
Minimal configuration:
@HoracioDos
HoracioDos / utc.txt
Created August 29, 2018 11:45
Set Windows 10 x64 in UTC
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1
@HoracioDos
HoracioDos / openproject.conf
Last active August 24, 2018 22:20 — forked from seLain/openproject.conf
nginx config for openproject
# assume :
# - openproject installed in /opt/openproject
# - local port: 6000
# - external port: 6020
server {
listen 6020;
server_name SERVER_DOMAIN_NAME;
root /opt/openproject/public;
WARNING: Unauthorized access to this system is forbidden and will be
prosecuted by law. By accessing this system, you agree that your actions
may be monitored if unauthorized usage is suspected.
@HoracioDos
HoracioDos / GeoIp.sh
Created August 24, 2018 12:25
GeoIp Install
sudo apt-get install geoip-bin geoip-database-contrib
@HoracioDos
HoracioDos / sshfilter.sh
Last active August 24, 2018 14:22 — forked from jokey2k/sshfilter.sh
Modified version of sshfilter.sh to allow for ipv6 and local IP filtering
#!/bin/bash
# based on script from http://www.axllent.org/docs/view/ssh-geoip
# based on script from https://gist.github.com/ManfMert/b34f098ad6e5094225ff9366ae4e9d7d
# License: WTFPL
# location /usr/local/bin
function private_ip()
{
local ip=$1
local stat=1