Skip to content

Instantly share code, notes, and snippets.

View tomaszklim's full-sized avatar

Tomasz Klim tomaszklim

View GitHub Profile
@tomaszklim
tomaszklim / uptimerobot-get-checks.sh
Created January 8, 2019 11:57
Get the list of Uptimerobot.com checks
#!/bin/sh
api="u123456-qa9oic80zsll1xi0fhbwso1"
offset=$1
if [ "$offset" = "" ]; then
offset=0
fi
curl -s -X POST \
@tomaszklim
tomaszklim / uptimerobot-add-check.sh
Created January 8, 2019 11:53
Add new Heartbeat-based check to Uptimerobot.com using API
#!/bin/bash
api_key="u123456-qa9oic80zsll1xi0fhbwso1"
alert_contacts="0123456_0_0-2761234_0_0"
baseurl="https://serverfarmer.home.pl/heartbeat/query.php"
db="id_myaccount.txt"
# 300 for free accounts, 60 for paid accounts
interval=300
#!/bin/sh
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install nginx python-certbot-nginx
@tomaszklim
tomaszklim / docker-clear-old-images.sh
Created August 19, 2018 19:47
Clear old Docker images (works with all Docker versions)
#!/bin/sh
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
@tomaszklim
tomaszklim / install-docker-ubuntu16.sh
Last active June 7, 2019 15:12
Install Docker stack on Ubuntu 16.04 LTS
#!/bin/sh
# warning: this installs old 17.05.0-ce version, see my install-docker-ubuntu18.sh gist for the current version
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" >/etc/apt/sources.list.d/docker.list
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
apt-get update
apt-get install docker-engine python-pip
@tomaszklim
tomaszklim / wp-fetch-updates-info.php
Last active June 28, 2018 12:24
Wordpress remote update checker
<?php
/**
* Wordpress remote update checker
* Written by Tomasz Klim, based on wp-admin code
**
<Files wp-fetch-updates-info.php>
Order Deny,Allow
Deny from all
Allow from 1.2.3.4