View terminal.sh
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
# Inside the root directory of the Joomla 3 instance, run these commands to add .htaccess files | |
# to joomla directories (except ./administrator) that prevent direct access to them. | |
# Also see https://www.joomla-security.de/dateien-verzeichnisse/htaccess-einstellungen.html | |
# Generally block access from outside | |
echo "<Files "*.*"> | |
Deny from all | |
</Files>" > ./bin/.htaccess; cp -i ./bin/.htaccess ./cache/.htaccess; cp -i ./bin/.htaccess ./cli/.htaccess; cp -i ./bin/.htaccess ./includes/.htaccess; cp -i ./bin/.htaccess ./language/.htaccess; cp -i ./bin/.htaccess ./layouts/.htaccess; cp -i ./bin/.htaccess ./libraries/.htaccess; cp -i ./bin/.htaccess ./logs/.htaccess; cp -i ./bin/.htaccess ./tmp/.htaccess | |
# Block all except media files: First, create .htaccess file with |
View .htaccess
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
# When changing joomla routing to not output article ids, google must be told where those articles are. | |
# Beware! This breaks if an article slug contains a number! | |
# https://docs.joomla.org/J3.x:New_Routing_System | |
RewriteRule category\/([a-z]*)\/(\d+)-([^/]*) https://www.site.example/category/$1/$3 [R=301,L] |
View .htaccess
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
# Redirect Query String to Html file. | |
<IfModule mod_rewrite.c> | |
RewriteCond %{QUERY_STRING} ([a-z0-9]+) [NC] | |
RewriteRule (.*) /%1.html? [R=301,L] | |
</IfModule> |
View node, nvm
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
# node version manager: list available versions | |
nvm ls | |
# nvm: see https://github.com/creationix/nvm | |
# node: get active version | |
node -v | |
# activate node version via nvm | |
nvm use 8 |
View wp-tweaks.php
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 | |
// remove wp generator | |
// https://css-tricks.com/snippets/wordpress/remove-wp-generator-meta-tag/ | |
remove_action('wp_head', 'wp_generator'); | |
// disable emojis | |
// http://wordpress.stackexchange.com/questions/185577/disable-emojicons-introduced-with-wp-4-2 | |
function wpt_disable_emojis() { | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); |
View wp-config.php
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 | |
define'ABSPATH', dirname__FILE__ ; | |
require_onceABSPATH '../path/to/wp-config.php'; |
View mail.php
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 | |
// get args from command line | |
// http://stackoverflow.com/questions/6826718/pass-variable-to-php-script-running-from-command-line | |
if ( defined('STDIN') ) { | |
$dir = $argv[1] ? $argv[1] : './'; | |
$ext = $argv[2] ? $argv[2] : 'html'; | |
} else { | |
die( 'not on a local machine.' ); | |
} |
View terminal.ini
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 all php.ini files on machine from terminal. | |
mdfind php.ini | grep php.ini | |
# copy local file to remote machine via scp | |
scp -P 92 /path/filename.ext user@hostname.com:~/path | |
# delete non-empty directory | |
rm -rf <dirname> | |
# unzip zip file in current dir |
View reinstall-npm.txt
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
curl -L http://npmjs.org/install.sh | sudo sh |
View Preferences.sublime-settings
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
Show hidden characters
{ | |
"enable_tab_scrolling": true, | |
"ignored_packages": | |
[ | |
"Vintage" | |
], | |
// theming & colors | |
"color_scheme": "Packages/Base16 Color Schemes/base16-ocean.dark.tmTheme", |
NewerOlder