Skip to content

Instantly share code, notes, and snippets.

🎯
🐼

Eyal Gantz egantz

🎯
🐼
Block or report user

Report or block egantz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

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

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 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
View Instructions.sh
########## 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 Dec 24, 2017 — forked from spyesx/string-to-slug.js
String to slug in JS (wordpress sanitize_title)
View string-to-slug.js
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 Oct 7, 2017 — forked from Pablosan/ec2_instance_create_and_setup.sh
A bash script that will set up a new EC2 instance and ssh into it.
View ec2_instance_create_and_setup.sh
#!/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 Aug 30, 2017 — forked from bsodmike/howto.md
HOWTO: Setup mail forwarding with Sendmail in Ubuntu 10.04 LTS
View howto.md

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 Aug 13, 2017 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu
View gist:71235115093ae2789f75e500895fd138

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
View migrateorders.php
<?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 Nov 15, 2016 — 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/
View nginx.conf
# 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 Dec 25, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.