Skip to content

Instantly share code, notes, and snippets.

View muety's full-sized avatar
🤓

Ferdinand Mütsch muety

🤓
View GitHub Profile
@tldev-de
tldev-de / database_docker_backup.sh
Last active November 14, 2023 18:03
Simple backup script, that dumps any mysql, mariadb or postgres docker container into gzipped files.
#!/bin/bash
#####################################
############## config ###############
#####################################
MYSQL_REGEX='(mariadb|mysql)'
POSTGRES_REGEX='(postgres|mattermost-docker-database).*(?<!zammad-backup_1)$'
MONGO_REGEX='(mongo[^-])'
@ajumalp
ajumalp / Install Mosquitto MQTT on Synology NAS Server.txt
Last active March 29, 2024 04:36
Install Mosquitto MQTT on Synology NAS Server
From https://synocommunity.com add http://packages.synocommunity.com to your NAS package sources.
For that, go to NAS->Package Cnter->Click Settings->Package Sources tab.
Then from the community, you can see Mosquitto. Install it.
After installing, please stop the Mosquitto service before updating configuration. You can start service after changes.
Enable Admin login for Synology
Enable SSH in NAS
Download putty and connect to NAS Server
Login using admin
Change to root user [sudo -i, {use admin password}]
Find mosquitto.conf file [find / -name mosquitto.conf]
@pldubouilh
pldubouilh / caddy.conf
Created December 23, 2018 15:05
fail2ban filter for http 401
# lives in filter.d/
[Definition]
failregex = ^<HOST> -.* HTTP/[0-9].[0-9]" 401
ignoreregex =
@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@harperjiang
harperjiang / Nd4j_lstm.scala
Last active June 21, 2019 08:28
Performance comparison of numpy vs nd4j on LSTM implementation
import org.nd4j.linalg.api.ndarray.INDArray
import org.nd4j.linalg.api.ops.impl.broadcast.BroadcastAddOp
import org.nd4j.linalg.api.rng.distribution.impl.UniformDistribution
import org.nd4j.linalg.factory.Nd4j
import scala.util.Random
object Xavier {
def init(shape: Array[Int]): INDArray = {
var n = shape.dropRight(1).product
@alphamu
alphamu / Android Privacy Policy Template
Created February 9, 2017 03:17
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
<html>
<body>
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
@kastnerkyle
kastnerkyle / painless_q.py
Last active August 18, 2023 09:32
Painless Q-Learning Tutorial implementation in Python http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Author: Kyle Kastner
# License: BSD 3-Clause
# Implementing http://mnemstudio.org/path-finding-q-learning-tutorial.htm
# Q-learning formula from http://sarvagyavaish.github.io/FlappyBirdRL/
# Visualization based on code from Gael Varoquaux gael.varoquaux@normalesup.org
# http://scikit-learn.org/stable/auto_examples/applications/plot_stock_market.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
@gonzaloserrano
gonzaloserrano / log.go
Created August 18, 2015 17:56
logrus wrapper
package log
import (
"fmt"
"github.com/Sirupsen/logrus"
"runtime"
"strings"
)
var logger = logrus.New()
@butlerblog
butlerblog / wp_config.php
Last active February 1, 2024 09:00
Configure WordPress #wp_mail function to send through #SMTP server https://b.utler.co/Y3
<?php
/*
* Set the following constants in wp-config.php.
* These should be added somewhere BEFORE the constant ABSPATH is defined.
*
* Author: Chad Butler
* Author URI: https://butlerblog.com
*
* For more information and instructions, see: https://b.utler.co/Y3
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule