Skip to content

Instantly share code, notes, and snippets.

@Tajmahal86
Tajmahal86 / .p3xrs-conns.json
Last active January 12, 2023 18:50
Run patrikx3/redis-ui on a subfolder
{
"update": "2021-03-02T03:30:23.228Z",
"list": [
{
"awsElastiCache": false,
"azure": false,
"name": "Cache",
"host": "redis-cache",
"port": 6379,
"id": "P3Xid67eebf0f7710100003b2b6c50560d6",
@Tajmahal86
Tajmahal86 / sanitize-magento-database.sql
Last active October 7, 2022 11:32 — forked from zlik/sanitize-magento-database.sql
Sanitize Magento database
DROP FUNCTION IF EXISTS SANITIZE_EMAIL;
DROP FUNCTION IF EXISTS GET_RANDOM_FIRSTNAME;
DROP FUNCTION IF EXISTS GET_RANDOM_LASTNAME;
DROP FUNCTION IF EXISTS GET_RANDOM_STREET;
DROP FUNCTION IF EXISTS GET_CITY;
DROP FUNCTION IF EXISTS GET_REGION;
DROP FUNCTION IF EXISTS GET_RANDOM_ZIP;
DROP FUNCTION IF EXISTS GET_RANDOM_PHONE_NUMBER;
DROP FUNCTION IF EXISTS GET_RANDOM_COMPANY;
DROP FUNCTION IF EXISTS GET_RANDOM_CC_LAST_4;
@Tajmahal86
Tajmahal86 / install-fortigui.sh
Created November 26, 2020 16:54
Install OpenFortiGiu
#https://hadler.me/linux/openfortigui/
wget https://apt.iteas.at/iteas/pool/main/o/openfortigui/openfortigui_0.9.3-1_amd64_focal.deb
sudo apt-get install libqt5keychain1
sudo dpkg -i openfortigui_0.9.3-1_amd64_focal.deb
@Tajmahal86
Tajmahal86 / cf-worker-find-replace.js
Created December 12, 2019 12:46 — forked from samuelcolvin/cf-worker-find-replace.js
Cloudflare worker to find and replace
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
// Fetch from origin server.
let response = await fetch(request)
// don't do the find and replace for png file,s should probably use content type here instead.
if (request.url.endsWith('.png')) {
return response
@Tajmahal86
Tajmahal86 / .gitlab-ci.yml
Created September 20, 2019 23:37 — forked from foklepoint/.gitlab-ci.yml
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@Tajmahal86
Tajmahal86 / lbcheck.php
Created July 16, 2018 12:29 — forked from jrodriguez-ifuelinteractive/lbcheck.php
Magento load balancer health check script
<?php
include './app/Mage.php';
try {
Mage::app();
echo gethostname();
} Catch (Exception $e) {
header("HTTP/1.0 503 Service Unavailable");
}
@Tajmahal86
Tajmahal86 / delete_images_container_registry.sh
Created June 12, 2018 13:42
Delete all untagged container images from Container Registry leaving only latest tag
#!/bin/bash
gcloud container images list > images.list
sed -i 1d images.list
while IFS='' read -r CONTAINERIMAGE || [[ -n "$CONTAINERIMAGE" ]];
do
gcloud container images list-tags \
"$CONTAINERIMAGE" \
--filter='-tags:*' --format='get(digest)' --limit=2000 |
while read DIGEST ;
do
@Tajmahal86
Tajmahal86 / delete_imags.sh
Created June 16, 2017 23:27
delete all container images in google container registry
# set the project
gcloud config set project my-projectid
# get all images names
gcloud container images list > images.list
# remove first line (string NAME)
sed -i 1d images.list
# delete don't ask me
gcloud container images --quiet delete $(cat images.list)