Skip to content

Instantly share code, notes, and snippets.

View koolamusic's full-sized avatar
🎯
Focusing

U.M Andrew koolamusic

🎯
Focusing
View GitHub Profile
@koolamusic
koolamusic / wp.sh
Last active April 9, 2018 16:31 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@koolamusic
koolamusic / .htaccess_redirect
Last active July 27, 2019 22:01 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
#!/bin/bash
#
# phpmyadmin-fixer
#
# Fixes for phpmyadmin (configuration storage and some extended features)
#
# If you're tired from message - "The phpMyAdmin configuration storage
# is not completely configured, some extended features have been deactivated",
# this patch for you ;-)
#
@koolamusic
koolamusic / htaccess_snippets.md
Last active May 25, 2018 00:00
Useful HTACCESS Snippets #Apache #Nginx #Proxy

.htaccess Snippets Awesome

A collection of useful .htaccess snippets, all in one place.

NOTE: .htaccess files are for people that do not have rights to edit the main server configuration file. They are intrinsically slower and more complicated than using the main config. Please see the howto in the httpd documentation for further details.

Disclaimer: While dropping the snippet into an .htaccess file is most of the time sufficient, there are cases when certain modifications might be required. Use at your own risk.

IMPORTANT: Apache 2.4 introduces a few breaking changes, most notably in access control configuration. For more information, check the upgrading document as well as this issue.

@koolamusic
koolamusic / .htaccess
Created July 31, 2017 02:06
wordpress htaccess copy from css tricks
# BEGIN W3 Total Cache
<IfModule mod_rewrite.c>
SetEnvIfNoCase Accept-Encoding (gzip) APPEND_EXT=.$1
RewriteEngine On
RewriteCond %{REQUEST_URI} !\/wp-admin\/|\/xmlrpc.php|\/wp-(app|cron|login|register).php|/video-feed/|/video-feed-iphone/ [OR]
RewriteCond %{REQUEST_URI} wp-comments-popup\.php|wp-links-opml\.php|wp-locations\.php [NC]
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} =""
RewriteCond %{HTTP_COOKIE} !comment_author|wp-postpass|wordpress_\[a-f0-9\]\+|wordpress_logged_in [NC]
RewriteCond %{HTTP_USER_AGENT} !bot|ia_archive|slurp|crawl|spider [NC]
@koolamusic
koolamusic / wp.sh
Created July 31, 2017 09:53 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
@koolamusic
koolamusic / wp.sh
Created July 31, 2017 10:04
Script to install wordpress with htaccess config to protect wordpress from CSS Tricks and perishable 6g Firewall
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@koolamusic
koolamusic / wp-datas.php
Created September 5, 2017 20:53 — forked from pH-7/wp-datas.php
This is used by hackers wanna hack Wordpress sites. With this file, most of the time hackers add HTML files to promote them (usually Chinese posts/products) on your server, change the Google Webmaster account and add new sitemap file (containing the HTML files added) to request new indexation of the compromising site by Google, etc. This can be …
<?php
/**
* This is used by hackers wanna hack Wordpress sites. With this file, most of the time hackers add HTML files to promote
* them (usually Chinese posts/products) on your server, change the Google Webmaster account and add new sitemap file
* (containing the HTML files added) to request new indexation of the compromising site by Google, etc.
* This can be very dangerous and destroy your whole reputation.
* Most of the time hackers are able to upload this file on crappy (most are!) sharing Web host.
* Be really careful and scan your site + overwritten all files by new ones
*/
header("Content-type:text/html;charset=utf-8");
@koolamusic
koolamusic / README.md
Created September 13, 2017 15:12 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@koolamusic
koolamusic / windows github webhook
Created February 16, 2018 11:54 — forked from upggr/windows github webhook
Workflow for automated github pull on windows
On the github website there is guide detailing a worfklow for the developer that wants to have continuous integration on a linux server.
This has been detailed in many gists and goes like this in its simplest form :
1.git clone on your public_html folder (after you create ssh keys etc)
2.create a file gitpull.php with the command : exec(git pull); inside it
3.create a webhook on github to call yourwebsite.com/gitpull.php
What about windows though? you can install git bash, but the above will not work because of permissions, mostly because the user that will invoke the url will be whatever user is running the process that calls php (for example SYSTEM or IUSR)
I have a better, clever solution for that, that uses.. the windows log! Also great for troubleshooting your deployments: