Skip to content

Instantly share code, notes, and snippets.

View jonmunson's full-sized avatar

Jon Munson jonmunson

View GitHub Profile
@jonmunson
jonmunson / install_lamp_vhosts_git.sh
Created August 22, 2024 13:35
LAMP stack with VHOST and GIT install script
#!/bin/bash
# Set the domain name as a variable
DOMAIN_NAME="example.com"
# Update the package index
echo "Updating package index..."
sudo apt update
# Install Apache

Keybase proof

I hereby claim:

  • I am jonmunson on github.
  • I am jonmunson (https://keybase.io/jonmunson) on keybase.
  • I have a public key ASCyXh8bPuIdNQf08yXQY7WH9bC4O-PwzV101feiryxXAgo

To claim this, I am signing this object:

@jonmunson
jonmunson / apache2.conf
Created April 16, 2017 18:15
Apache2 settings for optimum security - /etc/apache2/apache2.conf
<Directory /var/www/>
Options FollowSymLinks
AllowOverride None
Require all granted
Header always append X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
FileETag None
RewriteEngine On
RewriteCond %{THE_REQUEST} !HTTP/1\.1$
<?php wp_footer(); ?>
<?php if (!$user_ID) : ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9669661-12']);
_gaq.push(['_trackPageview']);
@jonmunson
jonmunson / prefetchbuilder.js
Created December 3, 2015 22:23 — forked from PaulKinlan/prefetchbuilder.js
Code to return link rel=dnsprefetch
(function() {
var requests = window.performance.getEntries();
var hosts = {};
var output = "";
for(var requestIdx = 0; requestIdx < requests.length; requestIdx++) {
var request = requests[requestIdx];
var origin = new URL(request.name).origin;
hosts[origin] = 1;
TRUNCATE dataflow_batch_export;
TRUNCATE dataflow_batch_import;
TRUNCATE log_customer;
TRUNCATE log_quote;
TRUNCATE log_summary;
TRUNCATE log_summary_type;
TRUNCATE log_url;
TRUNCATE log_url_info;
TRUNCATE log_visitor;
TRUNCATE log_visitor_info;
@jonmunson
jonmunson / .gitignore
Last active August 29, 2015 14:27 — forked from carlosasin/.gitignore
Git ignore Magento (ignore .htaccess for NGINX)
# Ignore PHPStorm
/.idea/
/.phpstorm.meta.php
#Ignore vagrant
/.vagrant/
# Ignore code coverage reports
/build/
@jonmunson
jonmunson / permission.sh
Last active August 29, 2015 14:27 — forked from carlosasin/permission.sh
Magento - Repair permissions
#!/bin/sh
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo chmod o+w var app/etc
sudo chmod 550 mage
sudo chmod -R o+w media
@jonmunson
jonmunson / vertical-align.scss
Created June 23, 2015 10:05
Vertical align anything with just 3 lines of CSS
// Source: http://zerosixthree.se/vertical-align-anything-with-just-3-lines-of-css/
/* Mixin */
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@jonmunson
jonmunson / mysqldump-remote.sh
Created March 9, 2015 21:55
mysqldump all databases from remote host
mysqldump -h 1.2.3.4 -u username -p --all-databases > database_backup.sql