Skip to content

Instantly share code, notes, and snippets.

View stefangweichinger's full-sized avatar

Stefan G. Weichinger stefangweichinger

View GitHub Profile
@stefangweichinger
stefangweichinger / rclone_sync.sh
Created September 19, 2023 12:31 — forked from aquigni/rclone_sync.sh
Rclone syncing bash script
#!/bin/bash
##############################################################
### RCLONE SYNC SCRIPT
##############################################################
### crontab -e every 4 hours:
# 0 */4 * * * root /root/scrpts/rclone_sync.sh >/dev/null 2>&1
### Useful rclone commands:
# rclone config show
# Create your CA crt and key:
openssl req -new -x509 -nodes -newkey rsa:4096 -extensions v3_ca -sha256 -days 3650 -subj "/C=US/ST=CA/L=San Francisco/O=Acme Inc./CN=Acme Insecure Certificate Authority" -keyout ca.key -out ca.crt
chmod 600 ca.key
# Create a CSR:
openssl req -newkey rsa:2048 -nodes -sha256 -keyout cert.key -out cert.csr -subj "/C=US/ST=CA/L=San Francisco/O=Snakeoil Inc./OU=Core/CN=lobotomat.de"
# Check contents of CSR (optional):
openssl req -in cert.csr -text -noout
@stefangweichinger
stefangweichinger / GitRecovery
Created May 31, 2023 18:53 — forked from pce1991/GitRecovery
Repair git says object files are empty/corrupted
find .git/objects/ -type f -empty | xargs rm
git fetch -p
git fsck --full
http://stackoverflow.com/questions/11706215/how-to-fix-git-error-object-file-is-empty
@stefangweichinger
stefangweichinger / migrate-docker-volume.sh
Created March 7, 2023 14:08 — forked from funkyfisch/migrate-docker-volume.sh
Migrate a docker volume from one host to another
#!/bin/bash
# Environment check
# If migrating from localhost, set this to localhost
if [[ ! $SOURCE_HOST_ADDRESS ]]
then
echo "Please set the current host address in SOURCE_HOST_ADDRESS"
exit 1
fi
@stefangweichinger
stefangweichinger / README.md
Created April 29, 2022 11:54 — forked from ElXreno/README.md
Fedora installation guide for me

Fedora 36 installation manual

Upgrade all system:

sudo dnf upgrade --refresh

Setup sysctl config:

Add params to /etc/sysctl.d/99-custom.conf:

# AMANDA CONFIGURATION FROM FILE '/etc/amanda/vtape/amanda.conf':
ORG "CUSTOMER vtape"
MAILTO "logs@xunil.at"
DUMPUSER "backup"
PRINTER ""
MAILER "/usr/bin/mail"
TAPEDEV ""
TPCHANGER "aggregate"
CHANGERDEV ""
@stefangweichinger
stefangweichinger / postfix
Created September 19, 2021 15:00 — forked from joe-speedboat/postfix
postfix grok patterns for graylog 3.x
# Syslog stuff
COMPONENT ([\w._\/%-]+)
COMPID postfix\/%{COMPONENT:component}(?:\[%{NUMBER:pid}\])?
POSTFIX (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{COMPID}:
# Milter
HELO (?:\[%{IP:helo}\]|%{HOST:helo}|%{DATA:helo})
MILTERCONNECT %{QUEUEID:qid}: milter-reject: CONNECT from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
MILTERUNKNOWN %{QUEUEID:qid}: milter-reject: UNKNOWN from %{RELAY:relay}: %{GREEDYDATA:milter_reason}; proto=%{WORD:proto}
root@app1:~# iptables -L
# Warning: iptables-legacy tables present, use iptables-legacy to see them
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:67
ACCEPT udp -- anywhere anywhere udp dpt:bootps
Chain FORWARD (policy ACCEPT)
@stefangweichinger
stefangweichinger / ansible-galaxy-find-role-id.sh
Created April 22, 2019 20:07 — forked from pavlov99/ansible-galaxy-find-role-id.sh
Find your role's id in ansible-galaxy
$ ansible-galaxy info YourUser.RoleName | grep -E 'id: [0-9]' | awk {'print $2'}
#### Contents of the preconfiguration file (for stretch)
#### Localization
## Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string de_DE
#
## The values can also be preseeded individually for greater flexibility.
d-i debian-installer/locale string de_DE
## Optionally specify additional locales to be generated.
##d-i localechooser/supported-locales multiselect en_US.UTF-8, nl_NL.UTF-8
#