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/
@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-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:
@koolamusic
koolamusic / wp-start.sh
Created May 30, 2018 20:47 — forked from ethicka/wp-start.sh
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@koolamusic
koolamusic / disqus.html
Created January 25, 2019 09:51 — forked from Soreine/disqus.html
Jekyll include file to integrate disqus comments.
{% if site.disqus_short_name and page.comments != false %}
<div id="disqus_thread"></div>
<script>
var disqus_shortname = '{{ site.disqus_short_name }}';
var disqus_config = function () {
// _config.yml should define the site's URL
this.page.url = '{{ site.url }}{{ page.url }}';
// Using an optional disqus_identifier variable, or the site.url + page.id combination
this.page.identifier = '{% if page.disqus_identifier %}{{ page.disqus_identifier}}{% else %}{{ site.url }}{{ page.id }}{% endif %}';
};
@koolamusic
koolamusic / a2dp.py
Created June 5, 2019 06:12 — forked from pylover/a2dp.py
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3.5
"""
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04 and also debian jessie, with bluez5.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
@koolamusic
koolamusic / service.js
Created October 17, 2020 19:35 — forked from cadebward/service.js
Remove `__v` and `_id` from MongoDB
import mongoose, {Schema} from 'mongoose'
export const ServiceSchema = new Schema({
displayName: {type: String, required: true, unique: true}
})
ServiceSchema.set('toObject', {
transform: function (doc, ret) {
ret.id = ret._id
delete ret._id