This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
error_reporting(0); | |
// Prosody log file path | |
$logFile = "/var/log/prosody/prosody.log"; | |
$debug = false; | |
// CakePHP database config | |
$db = array( | |
'driver' => 'mysql', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DIR=/root/mysql-backups/ | |
DATESTAMP=$(date +%Y-%m-%d) | |
DB_USER=user | |
DB_PASS=password | |
find ${DIR} -type f -mtime +5 -exec rm -rf {} \; | |
DB_LIST=`mysql -u $DB_USER -p"$DB_PASS" -e'show databases;'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run as root or with sudo | |
$ sudo setcap 'cap_net_bind_service=+ep' /usr/bin/executable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Header unset Pragma | |
FileETag None | |
Header unset ETag | |
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType text/html "access plus 1 seconds" | |
ExpiresByType image/gif "access plus 30 days" | |
ExpiresByType image/jpeg "access plus 30 days" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BLACK='\033[0;30m' | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
ORANGE='\033[0;33m' | |
BLUE='\033[0;34m' | |
PURPLE='\033[0;35m' | |
CYAN='\033[0;36m' | |
LIGHTGRAY='\033[0;37m' | |
DARKGRAY='\033[1;30m' | |
LIGHTRED='\033[1;31m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Metadata:</h2> | |
<label for="url">URL:</label> | |
<input type="url" name="url" id="url" onkeyup="setUrl();"> | |
<br> | |
<label for="title">SEO Title:</label> | |
<input type="text" name="title" id="title" onkeyup="setTitle();"> | |
<br> | |
<label for="title">Meta Description:</label> | |
<input type="text" name="description" id="description" onkeyup="setDescription();"> | |
<br> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Prepare | |
sudo apt update | |
sudo apt upgrade | |
# Install basics | |
sudo apt install curl git vim zsh tmux wget htop | |
# Install and configure oh-my-zsh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -exec chmod 644 {} \; | |
find . -type d -exec chmod 755 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Purpose: Block all traffic from RUSSIA (ru) and BELARUS (by). Use ISO code. # | |
# See url for more info - http://www.cyberciti.biz/faq/?p=3402 | |
# Author: nixCraft <www.cyberciti.biz> under GPL v.2.0+ | |
# ------------------------------------------------------------------------------- | |
ISO="ru by" | |
### Set PATH ### | |
IPT=/sbin/iptables | |
WGET=/usr/bin/wget |
OlderNewer