View backup.sh
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
USERNAME="USERNAME" | |
PASSWORD="PASSWORD" | |
SERVER="IP_ADDRESS" | |
PORT="FTP/SFTP PORT" | |
REMOTEDIR="REMOTE_DIR" | |
TYPE=2 # 1 -> ftp 2 -> sftp | |
FILE=$(find /var/opt/gitlab/backups/ -type f -printf "%p\n" | sort -n | tail -1) | |
echo $FILE | |
View WebpConvert.php
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 getDirContents($dir, &$results = array()) { | |
$files = scandir($dir); | |
foreach ($files as $key => $value) { | |
$path = realpath($dir . DIRECTORY_SEPARATOR . $value); | |
if (!is_dir($path)) { | |
$results[] = $path; | |
} else if ($value != "." && $value != "..") { |
View PreventSleep.cs
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
internal static class NativeMethods { | |
public static void PreventSleep() { | |
SetThreadExecutionState(ExecutionState.EsContinuous | ExecutionState.EsSystemRequired); | |
} | |
public static void AllowSleep() { | |
SetThreadExecutionState(ExecutionState.EsContinuous); | |
} |