This file contains hidden or 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(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){ | |
$redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
header('HTTP/1.1 301 Moved Permanently'); | |
header('Location: ' . $redirect); | |
exit(); | |
} |
This file contains hidden or 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
httrack "http://domain.com/path/?querystring" '-*' '+http://domain.com/path/*' -v |
This file contains hidden or 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 /home/*/www/lib -name "functions.php" -exec grep --color -H -n "functionName" {} \; |
This file contains hidden or 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
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" . |
This file contains hidden or 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
egrep -o 'dovecot_login[^ ]+' /var/log/exim_mainlog | sort|uniq -c|sort -nk 1 |
This file contains hidden or 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
#target illustrator | |
var sourceDir, | |
destDir, | |
files, | |
sourceDoc; | |
sourceDir = Folder.selectDialog( 'Select the import directory.', '~' ); | |
destDir = Folder.selectDialog( 'Select the export directory.', sourceDir.sourceDir ); |
This file contains hidden or 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
xattr -cr . |
This file contains hidden or 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 /path/to/dir/* -type f -exec sed -i '' 's/FIND_STRING/REPLACE_STRING/g' {} \; |
This file contains hidden or 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
pgrep -fl filename.php | |
# returns something like: | |
# 4676 /usr/bin/php /path/to/file.php |
This file contains hidden or 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 | |
// Removes files older than a day | |
$dir = '/path/to/dir'; | |
if ($handle = opendir($dir)) { | |
while (false !== ($file = readdir($handle))) { | |
$filelastmodified = filemtime($dir . '/' . $file); | |
$filetype = filetype($dir . '/' . $file); |
NewerOlder