Skip to content

Instantly share code, notes, and snippets.

@azliabdullah
azliabdullah / auto-delete-cf-dns.js
Created March 11, 2022 07:12
bulk delete all DNS records in cloudflare
/**
* 1. open cloudflare dashboard, choose domain, go to DNS section
* 2. open browser's dev tool (via F12 or inspect or however)
* 3. in devtool, go to console tab
* 4. clear all existing messages
* 5. paste all script below
* 6. hit enter and watch
* 7. script only delete records displayed in the screen
* 8. if want to delete more, refresh browser and run script again
*
@heywoodlh
heywoodlh / lynis-warnings.sh
Last active July 6, 2021 07:51
Post all Lynis warnings and suggestions to slack as a snippet
#!/usr/bin/env bash
if [[ "$1" == '' ]] || [[ "$1" == '--help' ]]
then
echo "$0 [channel id] [slack token]"
exit 0
fi
SLACK_CHANNEL_ID="$1"
SLACK_TOKEN="$2"
@atifaziz
atifaziz / Unprotect-ProtectedData.ps1
Created March 31, 2017 06:25
Decrypting DPAPI-protected Base64 data from PowerShell
Add-Type -AssemblyName System.Security;
[Text.Encoding]::ASCII.GetString([Security.Cryptography.ProtectedData]::Unprotect([Convert]::FromBase64String((type -raw (Join-Path $env:USERPROFILE foobar))), $null, 'CurrentUser'))
@hanhpv
hanhpv / magento-1-nginx.md
Created September 15, 2016 07:55
Magento 1 nginx configuration
server { 
	listen 80; 
	root /Users/admin/htdocs/vax-uk;
	index index.php index.html index.htm;
	 
	server_name vax.local; 
	access_log /usr/local/etc/nginx/logs/vax_access.log;
	access_log /usr/local/etc/nginx/logs/vax_error.log;
	 
@udovicic
udovicic / InventoryUpdate.php
Created October 31, 2015 11:17
SOAP v2 Inventory update example
<?php
/**
* Magento catalogInventoryStockItemUpdate API example Using SOAPv2
*
* Local measurements:
* Login time: 1.3139259815216s
* Total execution time: 34.751662969589s
*/
/**
@dominicsayers
dominicsayers / elasticsearch.md
Last active August 12, 2024 08:14
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@edannenberg
edannenberg / magento_url_rewrite.patch
Last active August 11, 2022 17:27
Fixes the catalog url rewrite indexer in Magento 1.7.x-1.9.x See https://github.com/magento/bugathon_march_2013/issues/265 for details.Update: DexterDee in the ticket above noted that the previous patch had some side effects. This updated patch still feels like duct tape but at least it seems to be free of the mentioned side effects. It also fix…
diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php
--- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100
+++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100
@@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url
$this->_rewrite = $rewrite;
return $requestPath;
}
+
+ // avoid unnecessary creation of new url_keys for duplicate url keys
+ $noSuffixPath = substr($requestPath, 0, -(strlen($suffix)));