Skip to content

Instantly share code, notes, and snippets.

View egantz's full-sized avatar
🎯
🐼

Eyal Gantz egantz

🎯
🐼
View GitHub Profile
@egantz
egantz / wp-config.php
Created February 5, 2019 21:35 — forked from ifamily/wp-config.php
A universal WordPress wp-config.php which works on local development to staging and production server environments.
<?php
/*
One wp-config for local development to staging to production.
*/
// Define Environments
$environments = array(

Keybase proof

I hereby claim:

  • I am egantz on github.
  • I am egantz (https://keybase.io/egantz) on keybase.
  • I have a public key whose fingerprint is 1F9E 6406 6D00 892F 51AD 3A4D 6FD6 D311 42CB A8E1

To claim this, I am signing this object:

@egantz
egantz / Instructions.sh
Created May 12, 2018 00:27 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@egantz
egantz / string-to-slug.js
Created December 24, 2017 04:36 — forked from spyesx/string-to-slug.js
String to slug in JS (wordpress sanitize_title)
var string_to_slug = function (str)
{
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++)
@egantz
egantz / ec2_instance_create_and_setup.sh
Created October 7, 2017 21:28 — forked from Pablosan/ec2_instance_create_and_setup.sh
A bash script that will set up a new EC2 instance and ssh into it.
#!/bin/bash
# Authorize TCP, SSH & ICMP for default Security Group
#ec2-authorize default -P icmp -t -1:-1 -s 0.0.0.0/0
#ec2-authorize default -P tcp -p 22 -s 0.0.0.0/0
# The Static IP Address for this instance:
IP_ADDRESS=$(cat ~/.ec2/ip_address)
# Create new t1.micro instance using ami-cef405a7 (64 bit Ubuntu Server 10.10 Maverick Meerkat)
@egantz
egantz / howto.md
Created August 30, 2017 04:15 — forked from bsodmike/howto.md
HOWTO: Setup mail forwarding with Sendmail in Ubuntu 10.04 LTS

Copyright (c) 2011, Michael de Silva (michael@mwdesilva.com) Blog: http://www.bsodmike.com ~ Twitter: @bsodmike

Fix: 'config error: mail loops back to me (MX problem?)'

To prevent receiving config error: mail loops back to me (MX problem?) errors, you need to add each virtualdomain.tld to the /etc/mail/local-host-names file and re-compile your sendmail config via make.

You have asked mail to a domain (e.g., domain.net) to be forwarded to a specific host (in this case, relay.domain.net) by using an MX record, but the relay machine doesn't recognise itself as domain.net. Add domain.net to /etc/mail/local-host-names [known as /etc/sendmail.cw prior to version 8.10] (if you are using FEATURE(`use_cw_file')) or add "Cw domain.net" to your configuration file.

Source: http://www.sendmail.com/sm/open_source/support/support_faq/general_issues_faq/#4.5

@egantz
egantz / gist:71235115093ae2789f75e500895fd138
Created August 13, 2017 03:51 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart
<?php
// Copies woocommerce orders and users over from source to target.
// I use this on my local machine - loading both db's up there side by side
// could easily adjust the connect strings to connect elsewhere if needed.
// will change order ids
// My use case for this is when I've got a staging/test version of a site with new posts/products/pages etc, that needs
// to go live without the loss of any orders placed on the site site since we copied it to the staging site.
@egantz
egantz / nginx.conf
Created November 15, 2016 18:59 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@egantz
egantz / 0_reuse_code.js
Created December 25, 2015 12:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console