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 | |
/** | |
* @param int $timeout - max process execution time in seconds until it is terminated | |
**/ | |
function execute($cmd, $stdin = null, $timeout = 600) | |
{ | |
$this->log->debug("executing: " . $cmd . " ". $stdin); | |
$cmd = str_replace("\n", "", $cmd); | |
$cmd = str_replace("\r", "", $cmd); |
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 | |
$host = 'example.com'; | |
$password = 'pass'; | |
$username = 'username'; | |
try { | |
$result = checkFtp($host, $username, $password); | |
} catch(Exception $e) { | |
$result = $e->getMessage(); | |
} |
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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
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 | |
#Convert all jpeg files in current dir to PNG in new folder Converted | |
sips -s format png *.jpeg –out Converted | |
#Convert all tiff files in current dir to jpeg in new folder Converted | |
sips -s format jpeg *.tiff –out Converted |
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 | |
echo date('c'); | |
?> |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<?php | |
echo "This is a very simple php example."; | |
?> | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<?php | |
echo "This is a very simple php example."; | |
?> | |
</body> | |
</html> |
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
convert *.png -set filename:base "%[basename]" -crop 2048x2048+0+0 -resize 640x640 -sharpen 0x1 res/"%[filename:base].png" |
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 | |
for f in "$@"; do | |
echo "$f" | |
[[ "$f" != *.flac ]] && continue | |
album="$(metaflac --show-tag=album "$f" | sed 's/[^=]*=//')" | |
artist="$(metaflac --show-tag=artist "$f" | sed 's/[^=]*=//')" | |
date="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')" | |
title="$(metaflac --show-tag=title "$f" | sed 's/[^=]*=//')" | |
year="$(metaflac --show-tag=date "$f" | sed 's/[^=]*=//')" |
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 | |
private function _getDataRange($range) | |
{ | |
$lowerdate = null; | |
$upperdate = null; | |
switch ($range) { | |
case 'today': | |
$lowerdate = date('Y-m-d 00:00:00'); |