Getting started:
Related tutorials:
#!/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 |
#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 -e | |
clear | |
echo "============================================" | |
echo "WordPress Install Script" | |
echo "============================================" | |
echo "Database Name: " | |
read -e dbname | |
echo "Database User: " | |
read -e dbuser | |
echo "Database Password: " |
<?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"); |
Getting started:
Related tutorials:
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: |
#!/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 |
{% 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 %}'; | |
}; |
#! /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 . |
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 |