Skip to content

Instantly share code, notes, and snippets.

@webcartel
webcartel / mysql_secure.sh
Created January 5, 2021 15:27 — forked from Mins/mysql_secure.sh
Automating mysql_secure_installation
#!/bin/bash
aptitude -y install expect
// Not required in actual script
MYSQL_ROOT_PASSWORD=abcd1234
SECURE_MYSQL=$(expect -c "
set timeout 10
@webcartel
webcartel / setup-mysql.sh
Created January 5, 2021 08:34 — forked from sheikhwaqas/setup-mysql.sh
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@webcartel
webcartel / mb_str_replace.php
Created June 4, 2018 13:12 — forked from sgmurphy/mb_str_replace.php
mb_str_replace for PHP
<?php
/**
* Replace all occurrences of the search string with the replacement string.
*
* @author Sean Murphy <[email protected]>
* @copyright Copyright 2012 Sean Murphy. All rights reserved.
* @license http://creativecommons.org/publicdomain/zero/1.0/
* @link http://php.net/manual/function.str-replace.php
*
* @param mixed $search
@webcartel
webcartel / gulpfile.js
Created May 3, 2018 16:17 — forked from LoyEgor/gulpfile.js
best image compression settings (gulp-imagemin)
// install
// npm i gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy -f
// node node_modules/jpegtran-bin/lib/install.js
// node node_modules/gifsicle/lib/install.js
// node node_modules/zopflipng-bin/lib/install.js
// node node_modules/mozjpeg/lib/install.js
// node node_modules/giflossy/lib/install.js
// node node_modules/pngquant-bin/lib/install.js
@webcartel
webcartel / echo-enqueued-styles-scripts-wordpress.php
Created December 10, 2017 21:32 — forked from omurphy27/echo-enqueued-styles-scripts-wordpress.php
Wordpress - Print Out All Enqueued Scripts And Styles On A Page
<?php
// add the below to your functions file
// then visit the page that you want to see
// the enqueued scripts and stylesheets for
function se_inspect_styles() {
global $wp_styles;
echo "<h2>Enqueued CSS Stylesheets</h2><ul>";
foreach( $wp_styles->queue as $handle ) :
echo "<li>" . $handle . "</li>";