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 | |
# Copyright © 2016 Faishal Saiyed | |
cd | |
timestamp=$(date +%s) | |
if [ ! -f openssh-7.3.zip ]; then wget https://github.com/faishal/openssh-portable/releases/download/cent.os.6.7.openssh.7.3p1/openssh-7.3.zip; fi; | |
unzip -o openssh-7.3.zip -d openssh-7.3p1 | |
cd openssh-7.3p1/ | |
cp /etc/pam.d/sshd pam-ssh-conf-$timestamp | |
rpm -U *.rpm | |
yes | cp pam-ssh-conf-$timestamp /etc/pam.d/sshd |
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
WP_PATH="/var/www/site_path" | |
for SITE_URL in = $(wp site list --fields=domain,path,archived,deleted --format=csv --path="$WP_PATH" | grep ",0,0$" | awk -F ',' '{print $1 $2}') | |
do | |
echo $SITE_URL | |
for EVENT_HOOK in $(wp cron event list --format=csv --fields=hook,next_run_relative --url="$SITE_URL" --path="$WP_PATH" | grep 'now$' | awk -F ',' '{print $1}') | |
do | |
echo $EVENT_HOOK | |
wp cron event run "$EVENT_HOOK" --url="$SITE_URL" --path="$WP_PATH" > /dev/null 2>&1 | |
done | |
done |
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
import nodemailer from "nodemailer"; | |
import { defaultProvider } from "@aws-sdk/credential-provider-node"; | |
import sesClient from "@aws-sdk/client-ses"; | |
async function wrapedSendMail(mailOptions){ | |
return new Promise((resolve,reject)=>{ | |
const ses = new sesClient.SES({ | |
apiVersion: "2010-12-01", | |
defaultProvider, | |
}); |
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 ./production/ -name "*-schema.sql" -print | xargs sed -ri 's/CREATE\sTABLE\s`([a-zA-Z0-1_]+)`\s/DROP TABLE IF EXISTS `\1`;\nCREATE TABLE `\1` /;' |
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
aws s3 ls s3://<bucket>/AWSLogs/<accountnumber>/elasticloadbalancing/<region>/2019/10/ --recursive | grep <search-string> | awk '{print $4}'| xargs -I FNAME sh -c 'aws s3 cp s3://<bucket-name>/AWSLogs"$FNAME" .' |
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
var pipelines = document.getElementsByClassName( 'zhc-pipeline' ); | |
var line_break = '\n\r'; | |
var report = ''; | |
var epics_data = {}; | |
for ( var i = 0; i < pipelines.length; i ++ ) { | |
var pipeline = pipelines[i]; | |
var issues = $( '.zhc-issue-cards__cell', pipeline ); | |
var status = $( '.zhc-pipeline-header__title', pipeline ).textContent; |
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
# Solution 1 - Non http | |
# Directives to send expires headers and turn off 404 error logging. | |
location ~* .(js|css|png|jpg|jpeg|gif|ico)$ { | |
expires 24h; | |
log_not_found off; | |
try_files $uri $uri/ @production; | |
} | |
location @production { | |
resolver 8.8.8.8; |
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 SITE_URL in $(wp site list --fields=domain,path,archived,deleted --format=csv --url=MAIN_DOMAIN | grep ",0,0$" | awk -F ',' '{print $1 $2}') | |
do | |
echo "Fixing $SITE_URL ..." | |
for POSTID in $(wp post list --post_type=CUSTOM_POSTTYPE --field=ID --url="$SITE_URL") | |
do | |
wp post meta update ${POSTID} META_KEY NEW_META_VALUE --url="$SITE_URL" | |
done | |
done |
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 | |
OPTIND=1 | |
verbose=0 | |
dbuser="" | |
dbpasswd="" | |
while getopts "vh?U:P:H:" opt; do | |
case "$opt" in |
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
/** | |
* Add ajaxprefilter to reset the form | |
*/ | |
function initAjaxPreFilter() { | |
// Add callback | |
$( document ).on( 'term:added', function() { | |
// Do reset form related stuff here | |
} ); | |
// Register ajaxprefilter |
NewerOlder