Skip to content

Instantly share code, notes, and snippets.

View cyavu's full-sized avatar

C.yavu cyavu

  • The Netherlands
View GitHub Profile
@cyavu
cyavu / sslrenewer.sh
Created February 2, 2019 10:39
Certificate renewer for services on a Plesk server that uses Let's Encrypt wildcard certificate
#!/bin/bash
# SSL renewer script by Cihad Yavuzel
# This script comes in handy if you have some services that are using
# a Let's Encrypt issued wildcard certificate on your Plesk webserver
# and need to be changed every 3 months
# Let's set our paths and variables
yourservice1_crt="/var/lib/service/cert.crt"
yourservice1_key="/var/lib/service/cert.key"
@cyavu
cyavu / csfpost.sh
Created February 2, 2019 10:20
OpenVPN internet accesss through CSF fix
#!/bin/bash
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A INPUT -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -j ACCEPT
iptables -A FORWARD -i tun+ -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun+ -m state --state RELATED,ESTABLISHED -j ACCEPT
# csf -r
@cyavu
cyavu / ignorelist.txt
Created February 2, 2019 10:19
Bash backup script [local/remote] with an ignorelist and progress tracker
/root/*.txt
/root/.bash*
/root/dir/name/*.sh
@cyavu
cyavu / backupper.sh
Created February 2, 2019 10:18
Bash backup script [local/remote] with an ignorelist and progress tracker
#!/bin/bash
#### Backup script by Cihad Yavuzel - Yavuzel.nl ####
#### Stores backup locally or to network mount ####
#### Package 'pv' must be installed to keep track on your backup progress ####
#### Usage: ./backup.sh (755) or cron-wise just call the script ####
echo "Reading variables..."
# Variables to adjust
@cyavu
cyavu / plesk-autologin-script.php
Last active February 2, 2019 12:33
Plesk auto login script in PHP
<?php
/* Plesk auto-login PHP-script */
/* This script is using a predefined IP address for which this auto login script will work for */
/* Tested on Plex Onyx 17.8.11 */
/* Written by Cihad Yavuzel, out of frustration */
// Set Plesk XML-API Target
$ch = curl_init('https://<hostname.tld>:8443/enterprise/control/agent.php');
// Elements user_ip and source_server are base64 encoded. First is the client's IP address and second is the hostname of where this request is coming from