Skip to content

Instantly share code, notes, and snippets.

View Lemmings19's full-sized avatar

Lemmings19

View GitHub Profile
@Lemmings19
Lemmings19 / apache-localhost-ssl-notes.mkd
Last active October 8, 2019 23:26
localhost apache self-signed ssl notes

To review the Apache config: (rename 000-default.conf to whatever yours is set to) cat /etc/apache2/sites-available/000-default.conf

To create the necessary certificates (you can choose any name you want for the file): sudo openssl req -x509 -nodes -days 9999 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt

Make sure to type the URL or IP of your site (eg localhost or 127.0.0.1 for the prompt Common Name (e.g. server FQDN or YOUR name) []:.

If this is just for testing, don't password protect anything without a good reason...

@Lemmings19
Lemmings19 / productive.js
Created May 2, 2017 22:16
Another day at the office...
console.log('yo dawg' + console.log('we heard you liked logs' + console.log('so we put a log in your log' + console.log('so you could log while you log'))));
@Lemmings19
Lemmings19 / readme.md
Last active June 20, 2019 09:03
Set up Laravel 5.4 in an Ubuntu VM on Windows

To setup Laravel inside an Ubuntu virtual machine on Windows

Tested on Windows 10. Probably works in 7 and 8. I wrote this after I went through all of it, so let me know if I forgot a step.

In this guide:

  • VirtualBox (allows you to run a Linux operating system such as Ubuntu while you are running Windows)
  • Ubuntu 16.04 64 (a user friendly Linux installation that will be supported for many years)
  • LAMP stack (Linux, Apache, MySQL, PHP - all of the things that you will run your web application on)
  • Composer (this just manages your PHP dependencies, such as Laravel)
@Lemmings19
Lemmings19 / slugify.js
Created February 24, 2019 03:33 — forked from hagemann/slugify.js
Slugify makes a string URI-friendly
function slugify(string) {
const a = 'àáäâãåăæçèéëêǵḧìíïîḿńǹñòóöôœṕŕßśșțùúüûǘẃẍÿź·/_,:;'
const b = 'aaaaaaaaceeeeghiiiimnnnoooooprssstuuuuuwxyz------'
const p = new RegExp(a.split('').join('|'), 'g')
return string.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(p, c => b.charAt(a.indexOf(c))) // Replace special characters
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w\-]+/g, '') // Remove all non-word characters
@Lemmings19
Lemmings19 / sendy_nginx_config.md
Last active February 2, 2019 21:12
Sendy Nginx Configuration 2018-07-11

Installing Sendy at https://mydomain.com/sendy, this worked for me:

Add this into your existing site configuration found at /etc/nginx/sites-available/mydomain.com:

    location /sendy {
        # covers /l, /t, and /w URLs.
        rewrite ^/sendy/(l|t|w)/([a-zA-Z0-9\/]+)$ /sendy/$1.php?i=$2&$args;
        # covers /subscribe and /unsubscribe URLs.
        rewrite ^/sendy/(u?n?subscribe)/(.*)$ /sendy/$1.php?i=$2&$args;
@Lemmings19
Lemmings19 / sendy_error_instructions.md
Last active February 2, 2019 21:07
Sendy "unlicensed domain" Error Fix On Nginx

For me, this was caused because of the Nginx server configruation. I originally had:

server {
    listen       80;
    server_name 12.168.101.224 mydomain.com www.mydomain.com;

    # the rest of the config ...
    . . .
@Lemmings19
Lemmings19 / README.md
Created March 7, 2018 23:04 — forked from oodavid/README.md
Restore MySQL from Amazon S3

Restore MySQL from Amazon S3

This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it

Sister Document - Backup MySQL to Amazon S3 - read that first

1 - Set your MySQL password and S3 bucket, make a temp dir, get a list of snapshots

# Set our variables

export mysqlpass="ROOTPASSWORD"

@Lemmings19
Lemmings19 / README.md
Last active March 7, 2018 23:05 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@Lemmings19
Lemmings19 / PasswordBroker.php
Created January 27, 2018 23:06 — forked from jamesfairhurst/PasswordBroker.php
Laravel 5.2 Queue Password Reset Email
<?php
namespace App;
use Illuminate\Auth\Passwords\PasswordBroker as IlluminatePasswordBroker;
class PasswordBroker extends IlluminatePasswordBroker
{
/**
* Send the password reset link via e-mail in a queue
@Lemmings19
Lemmings19 / hide-annoying-content.md
Last active October 23, 2017 09:02
Hide annoying content on thesaurus.com and dictionary.com

Looks like someone has spent too much time adding annoying crap to dictionary.com and thesaurus.com.

Remove it by doing the following:

  1. In Chrome install the Custom Javascript (cjs) extension: https://chrome.google.com/webstore/detail/custom-javascript-for-web/poakhlngfciodnhlhhgnaaelnpjljija/related?hl=en
  2. When on dictionary.com or thesaurus.com, click on the extension's icon in the top right of your browser. The icon reads: "cjs"
  3. Make sure the checkbox to enable cjs for this host is enabled.
  4. From the external scripts dropdown, select the newest version of jQuery.
  5. Paste the code in script.js (found on this page) into the textbox hit "save", and reload the page if necessary.
  6. All of that annoying shit should be gone now.