Skip to content

Instantly share code, notes, and snippets.

View jeroenvermeulen's full-sized avatar

Jeroen Vermeulen jeroenvermeulen

View GitHub Profile
@jeroenvermeulen
jeroenvermeulen / serviceaccount.yaml
Last active July 11, 2023 22:50
Talos on Docker-Desktop
# https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
@jeroenvermeulen
jeroenvermeulen / Dockerfile
Last active November 7, 2024 21:22 — forked from misteliy/Dockerfile
XFCE Virtual desktop using Chrome Remote Desktop
#
# Example build command: docker build --pull --tag DOCKERHUB-USERNAME/chrome-remote-desktop:ubuntu-xfce --build-arg CODE=4/0AZE....jyuw .
#
FROM amd64/ubuntu:latest
ENV DEBIAN_FRONTEND=noninteractive
# INSTALL XFCE AND OTHER PACKAGES
RUN apt-get update && apt-get upgrade --assume-yes
RUN apt-get install --assume-yes --fix-missing sudo wget apt-utils xvfb xfce4 xbase-clients \
desktop-base vim python3-psutil psmisc python3-psutil xserver-xorg-video-dummy \
libutempter0 epiphany-browser
#!/usr/bin/python
"""
File: .git/hooks/pre-commit
Referencing current branch in github README.md[1]
This pre-commit hook[2] updates the README.md file's
Travis badge with the current branch. Gist at[4].
[1] http://stackoverflow.com/questions/18673694/referencing-current-branch-in-github-readme-md
@jeroenvermeulen
jeroenvermeulen / lndupes.py
Last active July 24, 2024 07:20 — forked from filipenf/lndupes.py
Reads fdupes(-r1) output and create relative symbolic links for each duplicate
#!/usr/bin/env python
# source: https://gist.github.com/filipenf/e9901883d66b8da65c151cf674e5f2a9
#
# Reads fdupes(-r -1) output and create relative symbolic links for each duplicate
# usage: fdupes -r1 . | ./lndupes.py
import os
from os.path import dirname, relpath, basename, join
import sys
import shlex
#
# Copyright 2017 MageHost.pro
#
cd ~/httpdocs
test -d .git && { git add -A; git commit -a -m 'Uncommitted changes on server'; }
test -d .modman || modman init
modman clone --copy --force https://github.com/Inchoo/Inchoo_PHP7 -b 1.9.2.4
n98-magerun.phar cache:clean
test -d .git && { git add -A; git commit -a -m 'Installed Inchoo_PHP7 via modman'; }
wget https://gist.githubusercontent.com/renttek/29beaaa1e90909639501/raw/be5df0b33b72cdc2ab037d374802c53ccba066df/0001-BUGIFX-Magento-Zend-Framework-1-PHP5.6.patch
@jeroenvermeulen
jeroenvermeulen / find_cacheable_false.sh
Last active August 3, 2023 08:42
Magento2: Find cacheable="false" in layout XML
#### by MageHost.pro ####
# execute in Magento 2 root:
find vendor app -regextype 'egrep' -type f -regex '.*/layout/.*\.xml' -not -regex '.*(vendor/magento/|/checkout_|/catalogsearch_result_|/dotmailer).*' | xargs grep --color -n -e 'cacheable="false"'
@jeroenvermeulen
jeroenvermeulen / convertImages.sh
Last active September 25, 2020 08:58 — forked from peterjaap/convertImages.sh
Convert images to smaller size and lower quality to reduce file sizes for Magento's original product photos
#!/bin/bash
# convertImages.sh
# Authors: Peter Jaap Blaakmeer (elgentos.nl) & Jeroen Vermeulen (magehost.pro)
# https://gist.github.com/peterjaap/7080989
# https://gist.github.com/jeroenvermeulen/feb819799dea3d74ae9c
NEWQUALITY=90
NEWWIDTH=2000
DIRECTORY=$HOME/httpdocs/media/catalog/product/
#### Magento Hosting Performance Benchmarks
#### Executed by: JeroenVermeulen.eu / MagentoHosting.pro
## Example test command for 5 concurrent users hitting as fast as possible:
## siege --concurrent=5 --file=urls.txt --log=log.txt --time=60s --quiet --benchmark --internet
## The file urls.txt contains 5029 URLs based on sitemap.xml.
## Magento contains 5933 Total products.
## Magento has 4697 Enabled products.
##
@jeroenvermeulen
jeroenvermeulen / jv_clean_product_images.php
Last active July 7, 2021 10:21
Script to clean up unused Magento images
#!/usr/bin/env php
<?php
/**
* mh_remove_unused_product_images.php
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL: