Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
### BEGIN INIT INFO
# Source: http://www.dropboxwiki.com/tips-and-tricks/install-dropbox-in-an-entirely-text-based-linux-environment
# NOTE: Change the dropbox path in line: 32
# Provides: dropbox update daemon
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: false
@g3rhard
g3rhard / README.md
Created August 15, 2018 15:06 — forked from savely-krasovsky/README.md
Telegram webhooks with nginx reverse proxy

Make config file:

sudo nano /etc/nginx/sites-available/bot.conf

Then copy and paste bot.conf content and edit YOUR.DOMAIN strings. Now install Let's Encrypt on your server. For example in Debian you need to add jessie-backports and easily install it with apt-get:

sudo apt-get install -t jessie-backports letsencrypt

Then get cert for you domain:

@g3rhard
g3rhard / get-zone.sh
Created August 27, 2018 11:24 — forked from tibu/get-zone.sh
Download zone file in bind format from AWS Route53
#!/bin/bash
# download zone from AWS Route53
zonename=$1
hostedzoneid=$(aws route53 list-hosted-zones | jq -r ".HostedZones[] | select(.Name == \"$zonename.\") | .Id" | cut -d'/' -f3)
aws route53 list-resource-record-sets --hosted-zone-id $hostedzoneid --output json | jq -jr '.ResourceRecordSets[] | "\(.Name) \t\(.TTL) \t\(.Type) \t\(.ResourceRecords[].Value)\n"'
@g3rhard
g3rhard / r53export.sh
Created August 27, 2018 11:24 — forked from ramsey/r53export.sh
Queries AWS Route53 for a zone name and outputs a zone file of its records
#!/bin/bash
#
# Queries AWS Route53 for a zone name and outputs a zone file of its records
#
# Usage:
#
# r53export example.com[ profile]
#
# By default, uses $AWS_PROFILE environment variable, if set.
#
@g3rhard
g3rhard / new_relic_alert.sh
Created August 29, 2018 11:20 — forked from lichti/new_relic_alert.sh
Script to enable or disable newrelic alerts
#!/bin/bash
if [ ! -x /usr/bin/curl ]; then
echo "Please install curl"
exit 1
fi
if [ ! -x /usr/bin/jq ]; then
echo "Please install jq"
exit 1
@g3rhard
g3rhard / README
Created November 20, 2018 09:01 — forked from alexshpilkin/README
Convert the RKN list to a Mikrotik firewall address list
Download the RKN list from https://github.com/zapret-info/z-i, massage it into
a Mikrotik script that manages a firewall address list, and put it up on a web
server. Note well that the list is gigantic---more than 80,000 entries as of
2018-04-28---so be sure to check if your router can handle it in advance (for
example, hAP Lite, with its measly 32M of memory, can’t).
On the router side, do something like
/tool fetch url="https://sheaf.site/rkn.rsc" dst-path=rkn.rsc
:import rkn.src
@g3rhard
g3rhard / php-pools.md
Created June 5, 2019 09:00 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
# hiera
uptream:
'abc_core':
'ips':
- '1.2.3.4'
- '1.2.3.5'
'port': 8080
'abc_cp_core':
'ips':
- '1.2.3.4'
@g3rhard
g3rhard / docker-compose.yml
Created July 31, 2019 05:55 — forked from brunosimioni/docker-compose.yml
Docker Compose to Prometheus, PushGateway and Grafana setup
version: '2.1'
networks:
monitor-net:
driver: bridge
volumes:
prometheus_data: {}
grafana_data: {}
@g3rhard
g3rhard / Jenkinsfile
Created January 17, 2020 13:58 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples