Skip to content

Instantly share code, notes, and snippets.

View jeroenvermeulen's full-sized avatar

Jeroen Vermeulen jeroenvermeulen

View GitHub Profile
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@peterjaap
peterjaap / convertImages.sh
Last active May 11, 2020 08:28
Convert images to smaller size and lower quality to reduce file sizes for Magento's original product photos
#!/bin/bash
# convertImages.sh
# Author: Peter Jaap Blaakmeer (elgentos.nl)
# https://gist.github.com/peterjaap/7080989
NEWQUALITY=80
NEWSIZE=1000
DIRECTORY=media/catalog/product/
du -hs $DIRECTORY
@gerard-kanters
gerard-kanters / server.ini
Last active September 18, 2016 12:17
HHVM server ini
;extension = /usr/lib64/php/modules/geoip.so
hhvm.pid_file = "/var/run/hhvm/hhvm.pid"
hhvm.server.port = 9000
hhvm.server.fix_path_info = true
hhvm.server.type = fastcgi
hhvm.server.enable_magic_quotes_gpc = false
hhvm.server.enable_keep_alive = true
hhvm.server.enable_ssl = true
hhvm.log.access_log_default_format = "%h %l %u %t \"%r\" %>s %b"
@ck-on
ck-on / hhvminfo.php
Last active September 18, 2022 05:44
HHVMinfo - phpinfo for HHVM HipHop Virtual Machine
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
@lantins
lantins / query.php
Created September 1, 2014 22:39
Get DNS servers from root servers using dig (hack)
<?php
function get_ns_from_root($hostname) {
$regex_hostname = preg_quote($hostname);
$dig_cmd = "dig +trace {$hostname} | egrep '^{$regex_hostname}\..*IN.*NS' | awk '{ print $5 }'";
exec($dig_cmd, $nameservers);
return $nameservers;
}
@gsomoza
gsomoza / README.md
Last active May 14, 2020 10:09
Magento CLI Media Cleaner

Magento CLI Media Cleaner

CLI utilities to clean the Magento media folders.

Features:

  • Clean unused images from the product catalog.
  • Clean the product catalog image cache.
  • Ready to use: automatically reads settings from app/etc/local.xml
  • FAST: I used it to safely clean about 45,000 images in just a couple of minutes.
@z0mbix
z0mbix / tcpdump-es-capture
Created December 19, 2014 14:45
Capture Elasticsearch Queries
# tcpdump -A -nn -s 0 'tcp dst port 9200 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' -i lo
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on lo, link-type EN10MB (Ethernet), capture size 65535 bytes
14:32:33.525122 IP 127.0.0.1.49777 > 127.0.0.1.9200: Flags [P.], seq 313752908:313753888, ack 2465010394, win 257, options [nop,nop,TS val 2684167067 ecr 2684167066], length 980
E...^.@.@............q#...}L...............
..#...#.GET /index/_search HTTP/1.1
Host: 127.0.0.1:9200
Accept: */*
Content-Length: 845
Content-Type: application/x-www-form-urlencoded
@mpchadwick
mpchadwick / Mpchadwick_Missing_Acl_Checker.php
Created July 11, 2015 03:42
Mpchadwick_Missing_Acl_Checker.php
<?php
require_once 'abstract.php';
/**
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed()
*/
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract
{
const MODULES_PATH = 'modules';
@demagu
demagu / Could-not-restore-untracked-files-from-stash.md
Last active September 8, 2022 17:28
Could not restore untracked files from stash

How to fix 'Could not restore untracked files from stash' issue

Convert a stash to a temporary branch

git stash branch STASHTEMPBRANCH

Apply your stash

git stash apply

@thisismitch
thisismitch / haproxy.cfg
Last active November 11, 2023 04:08
Let's Encrypt Auto-Renewal script for HAProxy
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
maxconn 2048