A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 551
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/system/core/Exceptions.php:271)

Filename: view/raw.php

Line Number: 2

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/themes/geocities/views/view/raw.php
Line: 2
Function: header

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 173
Function: include

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/core/MY_Loader.php
Line: 43
Function: _ci_load

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 558
Function: view

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

#!/usr/bin/env bash # # Functions ok() { echo -e '\e[32m'$1'\e[m'; } die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; } # Sanity check if [[ $(id -g) != "0" ]] ; then die "❯❯❯ Script must be run as root." fi if [[ ! -e /dev/net/tun ]] ; then die "❯❯❯ TUN/TAP device is not available." fi dpkg -l openvpn > /dev/null 2>&1 if [[ $? -eq 0 ]]; then die "❯❯❯ OpenVPN is already installed." fi # Install openvpn ok "❯❯❯ apt-get update" apt-get update -q > /dev/null 2>&1 ok "❯❯❯ apt-get install openvpn curl openssl" apt-get install -qy openvpn curl > /dev/null 2>&1 # IP Address SERVER_IP=$(curl -s ipv4.icanhazip.com) if [[ -z "${SERVER_IP}" ]]; then SERVER_IP=$(ip a | awk -F"[ /]+" '/global/ && !/127.0/ {print $3; exit}') fi # Generate CA Config ok "❯❯❯ Generating CA Config" openssl dhparam -out /etc/openvpn/dh.pem 2048 > /dev/null 2>&1 openssl genrsa -out /etc/openvpn/ca-key.pem 2048 > /dev/null 2>&1 chmod 600 /etc/openvpn/ca-key.pem openssl req -new -key /etc/openvpn/ca-key.pem -out /etc/openvpn/ca-csr.pem -subj /CN=OpenVPN-CA/ > /dev/null 2>&1 openssl x509 -req -in /etc/openvpn/ca-csr.pem -out /etc/openvpn/ca.pem -signkey /etc/openvpn/ca-key.pem -days 365 > /dev/null 2>&1 echo 01 > /etc/openvpn/ca.srl # Generate Server Config ok "❯❯❯ Generating Server Config" openssl genrsa -out /etc/openvpn/server-key.pem 2048 > /dev/null 2>&1 chmod 600 /etc/openvpn/server-key.pem openssl req -new -key /etc/openvpn/server-key.pem -out /etc/openvpn/server-csr.pem -subj /CN=OpenVPN/ > /dev/null 2>&1 openssl x509 -req -in /etc/openvpn/server-csr.pem -out /etc/openvpn/server-cert.pem -CA /etc/openvpn/ca.pem -CAkey /etc/openvpn/ca-key.pem -days 365 > /dev/null 2>&1 cat > /etc/openvpn/udp1194.conf < /dev/null 2>&1 chmod 600 /etc/openvpn/client-key.pem openssl req -new -key /etc/openvpn/client-key.pem -out /etc/openvpn/client-csr.pem -subj /CN=OpenVPN-Client/ > /dev/null 2>&1 openssl x509 -req -in /etc/openvpn/client-csr.pem -out /etc/openvpn/client-cert.pem -CA /etc/openvpn/ca.pem -CAkey /etc/openvpn/ca-key.pem -days 36525 > /dev/null 2>&1 cat > /etc/openvpn/client.ovpn < $(cat /etc/openvpn/client-key.pem) $(cat /etc/openvpn/client-cert.pem) $(cat /etc/openvpn/ca.pem) EOF # Iptables if [[ ! -f /proc/user_beancounters ]]; then N_INT=$(ip a |awk -v sip="$SERVER_IP" '$0 ~ sip { print $7}') iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o $N_INT -j MASQUERADE else iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source $SERVER_IP fi iptables-save > /etc/iptables.conf cat > /etc/network/if-up.d/iptables < /proc/sys/net/ipv4/ip_forward # Restart Service ok "❯❯❯ service openvpn restart" service openvpn restart > /dev/null 2>&1 ok "❯❯❯ Your client config is available at /etc/openvpn/client.ovpn" ok "❯❯❯ All done!"