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/local/psa/admin/sbin/httpdmng --reconfigure-domain example-domain.com |
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
(FLOOR( 100 + RAND( ) * 1000 )) |
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
sudo openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr |
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
useradd [username] | |
passwd [username] | |
usermod -g www-data -G [username] -d [home-directory] -s /usr/sbin/nologin [username] | |
Add this to bottom of /etc/ssh/sshd_config | |
Match User [username] | |
ChrootDirectory [home-directory] | |
PasswordAuthentication yes | |
X11Forwarding no |
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 | |
# | |
# /etc/init.d/gitautodeploy | |
# | |
# Service manager for GitAutoDeploy | |
# | |
# chkconfig: 345 70 30 | |
# description: Git Auto Deploy is a simple HTTP server for accepting push notifications from GitLab | |
# processname: gitautodeploy |
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
<?php | |
if (!class_exists('FRM_Loop')) | |
{ | |
class FRM_Loop | |
{ | |
public function __construct() | |
{ | |
add_shortcode('loop', array(&$this, 'loop_shortcode')); | |
} |
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
<?php | |
/** | |
* Convert a timestamp into a relative string e.g. 2 Hours ago | |
* | |
* @return string | |
* | |
* @param $time Timestamp | |
**/ | |
function time_elapsed($time) |
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
<?php | |
function processImage($imgname) | |
{ | |
// Load original image | |
$original = @imagecreatefromjpeg($imgname); | |
if (!$original) | |
die('Bad Image: ' . $imgname); |
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
if (!isset($_SERVER['HTTPS'])) | |
{ | |
header('Status-Code: 301'); | |
header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); | |
} | |
else | |
{ | |
header('Strict-Transport-Security: max-age=500'); | |
} |
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
<?php | |
/** | |
* Are we on a blog page? | |
* | |
* @return bool | |
**/ | |
function is_blog() | |
{ | |
return (is_post_type_archive('post') || is_author() || is_category() || is_home() || is_singular('post') || is_tag()) ? true : false ; |
OlderNewer