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
#!/usr/bin/env bash | |
function systemdConfigPath(){ | |
service=$1 | |
systemctl show $service --no-pager | grep FragmentPath= | cut -d '=' -f 2 | |
} |
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 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
cd $DIR | |
if (java -version 2>&1 | head -1 | fgrep -q "1.8") | |
then | |
java -cp lib/annotations.jar:lib/aopalliance.jar:lib/appbundler-1.0ea.jar:lib/apple.jar:lib/derby.jar:lib/guice-3.0.jar:lib/guice-assistedinject-3.0.jar:lib/jDeskMetrics.jar:lib/javax.inject.jar:lib/jdesktop.jar:lib/jl1.0.1.jar:lib/jline-2.11.jar:lib/jruby-incomplete.jar:lib/json_simple-1.1.jar:lib/jsoup-1.7.1.jar:lib/jsr305-1.3.9.jar:lib/l2fprod-common-fontchooser.jar:lib/mahalo.jar:lib/mysql-connector-java-5.1.7-bin.jar:lib/readline.jar:lib/txtmark.jar:lib/jbidwatcher:app/JBidwatcher.jar com.jbidwatcher.app.JBidWatch | |
else | |
echo "You must install Oracle's Java 8 to run JBidwatcher." | |
echo "Download it from here:\n\thttps://www.java.com/download" |
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
# This will take a CSV file as input, | |
# pull out the header row, | |
# split that onto new lines | |
# and then prepend a zero indexed line number to each line | |
head ./filename.csv -n 1 | sed "s/,/\n/g" | awk '{printf("%d %s\n", NR-1, $0)}' | |
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
#!/usr/bin/env bash | |
PID=$(pgrep -n gnome-session) | |
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-) | |
GSETTINGS_BACKEND=dconf | |
gsettings set org.gnome.desktop.background picture-uri '"file://'$(ls ~/Pictures/Wallpapers/*.jpg | shuf -n 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
#!/usr/bin/env bash | |
readonly DIR=$(dirname $(readlink -f "$0")) | |
cd $DIR; | |
set -e | |
set -u | |
set -o pipefail | |
standardIFS="$IFS" | |
IFS=$'\n\t' | |
echo " | |
=========================================== |
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 | |
/** | |
* @category EdmondsCommerce | |
* @package EdmondsCommerce_ | |
* @author Ross Mitchell <[email protected]> | |
*/ | |
namespace EdmondsCommerce\ServerHardening; | |
use Symfony\Component\Yaml\Yaml; |
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
# Bash function to send email via Gmail SMTP | |
# sendEmail [subject] [toEmail] [message] (optional attachment path) | |
function sendEmail(){ | |
if (($# < 3 )) | |
then | |
echo "" | |
echo "Usage:" | |
echo "sendEmail [subject] [toEmail] [message] (optional attachment path)" | |
echo "" | |
exit 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
# /etc/nginx/conf.d/domain.com.conf | |
location /jira { | |
if ($scheme = 'http') { | |
rewrite ^ https://$http_host$request_uri? permanent; | |
} | |
proxy_set_header X-Forwarded-Host $host; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
client_max_body_size 10M; |
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 | |
find . -type d -ipath '*app/etc/modules' | \ | |
while read f; | |
do | |
echo $f; | |
ls -l "${f}" | \ | |
grep 'EM_Quickshop.xml\|EM_Ajaxcart.xml\|Smartwave_QuickView.xml\|MD_Quick'; | |
done | grep -B 1 'xml' |
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
function getCurrentMysqlConfigForVariable(){ | |
local variable=$1 | |
mysql -e "select variable_value from information_schema.global_variables where variable_name like '$variable'" | | |
while read variable_value; | |
do | |
if [[ 'variable_value' == "$variable_value" ]] | |
then | |
# skip the header | |
continue | |
fi |