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 | |
#Variables | |
gitlabUrl="https://gitlab.yourdomain.com" | |
configFile="/etc/gitlab-runner/config.toml" | |
gitlabTolken="" # Get it from https://gitlabUrl/profile/account API read access token | |
# Get GitLab Runner tokens from config.toml | |
mapfile -t runner_tokens < <(sudo grep -oP 'token = "\K[^"]+' ${configFile}) |
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 $color = dechex(rand(0x000000, 0xFFFFFF)); ?> | |
<body style="background-color: <?php echo $color; ?>;"> | |
<h1><?php echo $color ?></h1> | |
</body> |
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
$version = Read-Host "Enter the version (default: 0.21.1):" | |
if ([string]::IsNullOrWhiteSpace($version)) { | |
$version = "0.21.1" | |
} | |
$baseUrl = "https://sdk.flightsimulator.com/files/installers/$version/" | |
$urls = @( | |
"MSFS_SDK_Documentation_Installer_$version.0.msi", | |
"MSFS_SDK_Core_Installer_$version.0.msi", |
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 | |
MAIL_BIN=`command -v mail` | |
QUEUE_SIZE=`/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}'` | |
QUEUE_SUMMARY=`/usr/sbin/qshape -s deferred | head` | |
MAILTO="xxx@gmail.com" | |
LIMIT=100 | |
function send_notification_mail() { | |
echo $QUEUE_SUMMARY | $MAIL_BIN -s "WARNING: mail queue critical on $HOSTNAME" $MAILTO |
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 | |
# Check if an IP address is listed on one of the following blacklists | |
# The format is chosen to make it easy to add or delete | |
# The shell will strip multiple whitespace | |
BLISTS=" | |
b.barracudacentral.org | |
bb.barracudacentral.org | |
bl.deadbeef.com | |
bl.mailspike.net |
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 lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Project Title</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> |
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 | |
namespace Codeception\Module; | |
/** | |
* Additional methods for DB module | |
* | |
* Save this file as DbHelper.php in _support folder | |
* Enable DbHelper in your suite.yml file | |
* Execute `codeception build` to integrate this class in your codeception | |
*/ |
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
version=1.017R | |
echo "\n* Downloading version $version of source code pro font" | |
rm -f SourceCodePro_FontsOnly-$version.zip | |
rm -rf SourceCodePro_FontsOnly-$version | |
wget https://github.com/downloads/adobe/source-code-pro/SourceCodePro_FontsOnly-$version.zip | |
echo "\n* Unziping package" | |
unzip SourceCodePro_FontsOnly-$version.zip | |
mkdir -p ~/.fonts |
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 -name '*.png' -exec optipng -o5 -quiet -preserve {} \; | |
#find . -type f -name '*.jp*' -exec mogrify -compress jpeg -quality 70 {} \; | |
find . -type f -iname "*.jp*g" | xargs mogrify -resize '1280x1280>' | |
find . -type f -iname "*.jp*g" | xargs jpegoptim --strip-all --max=90 | |
# With parallel | |
find . -type f -iname "*.jp*g" -print0 | parallel --progress -0 -j +0 "mogrify -resize 1280x1280\> {}" | |
find . -type f -iname "*.jp*g" | parallel --progress "jpegoptim --strip-all --max=65 {}" |
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 | |
#To execute it directly: sudo bash <(curl -s https://gist.githubusercontent.com/agarzon/ecb0b92d4c8e1bbde126534c76721a58/raw/install-php-tools.sh) | |
BIN_PATH=/usr/local/bin/ | |
#COMPOSER | |
sudo curl -LsS https://getcomposer.org/composer.phar -o ${BIN_PATH}composer | |
sudo chmod a+x ${BIN_PATH}composer |
NewerOlder