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 | |
NVM_LATEST=$(curl https://api.github.com/repos/nvm-sh/nvm/releases/latest -s | grep "tag_name"| awk '{print substr($2, 2, length($2)-3) }') | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_LATEST}/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
nvm install --lts node |
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/php | |
<?php | |
/* | |
* Decrypt symmetric encrypted passwords of plesk stored in "psa" database in table "accounts" | |
* Script has to be run on the plesk server locally | |
* | |
* /usr/local/sbin/decrypt-sym | |
* | |
*/ |
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 | |
if [ $1 ] | |
then | |
if [ -f $1 ] | |
then | |
pemfile=$1 | |
fi | |
else | |
echo "Usage: split-pem.sh COMBINED-PEMFILE" |
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/bash | |
# Dotroll domain api | |
# - api access values stored per domain, including migration from account stored values | |
# - zone data is POST-ed to avoid "414 Request-URI Too Large" errors | |
# | |
# Initially export values Dotroll_User and Dotroll_Password | |
# export Dotroll_User='<your.dotroll@user>'; export Dotroll_Password='<dotroll_api_password>'; acme.sh --issue --dns dns_dotroll -d <domain.tld> -d '*.<domain.tld>' | |
# Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" |
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 | |
## | |
# Script to run WP All Import scripts sychronously with cron | |
## | |
# This is default wp core directory for us | |
ABSPATH="/var/www/project/wp" | |
function usage() | |
{ |
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 () { | |
// Simply add a data-save-tabs to your tablist e.g. <ul role="tablist" data-save-tabs="your-custom-slug"> | |
$('[data-save-tabs] a[data-toggle="tab"]').on('shown.bs.tab', function (e) { | |
var savedTabs = JSON.parse(localStorage.getItem('savedTabs')); | |
if (typeof savedTabs !== 'object' || !savedTabs){ | |
savedTabs = {}; | |
} | |
savedTabs[$(this).closest('[data-save-tabs]').data('save-tabs')] = $(this).attr('href'); | |
localStorage.setItem('savedTabs', JSON.stringify(savedTabs)); |
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 | |
# | |
# PushBullet API basic client for BASH | |
# | |
# needs some packages to run (available Debian Jessie and up) | |
# apt -y install jq jshon curl | |
# | |
pbapi="" # PushBullet API token |
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
# one-liner to check if the server-provided certificates include the self-signed ISRG Root X1, or not. Just declare the hostname you want to check | |
export hostname2check=""; export port2check="443"; check_self_x1=$(openssl s_client -CApath /etc/ssl/certs -servername "${hostname2check}" -connect "${hostname2check}:${port2check}" 2>&1 </dev/null | grep -E -A1 "s:.*CN\s*=\s*ISRG Root X1$" | grep -E "i:.*CN\s*=\s*ISRG Root X1$"); if [[ "x${check_self_x1}" == "x" ]]; then echo "You need to fix your intermediate chain, to present the self-signed X1"; else echo "GOOD, you already have the self-signed X1 in the intermediate chain"; fi; unset hostname2check; unset port2check |
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 | |
# | |
# Check if updated and self-signed ISRG Root X1 cert is present | |
# then remove DST_Root_CA_X3 from trusted CA-s | |
# lastly update combined ca-certificates.pem | |
# | |
if [ -f /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt ]; then | |
check_self_x1=$(openssl x509 -noout -text -in /usr/share/ca-certificates/mozilla/ISRG_Root_X1.crt | grep Issuer | grep -E "CN\s*=\s*ISRG Root X1") |
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/yum.repos.d/CentOS-Base.repo | |
# http://mirror.centos.org/centos/5/readme declares 5.11 as the latest of CentOS 5 family, so it may be better to create this | |
# version of CenbtOS-Base.repo than using CentOS-Vault.repo | |
[base] | |
name=CentOS-$releasever - Base | |
baseurl=http://vault.centos.org/5.11/os/$basearch/ | |
gpgcheck=1 | |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 | |
exclude=kernel-xen*, *xen* |
NewerOlder