Impact.com – one of the WORST partners to work with

This is possibly pure frustration post but allow me to put my arguments here. I will describe all the ways this company is one of the worst software companies I have ever worked with on behalf of a client.\ The Absolute Worst Affiliate Partner Program: Why impact.com Should Be Avoided at All Costs trustpilot.com reviews state impact.com as BAD When choosing an affiliate partner program, businesses need reliability, cost-effectiveness, and strong support. Unfortunately, impact.com falls woefully short in all these areas, earning a reputation as one of the worst affiliate platforms in the industry. Here’s an in-depth look at why partnering with impact.com could be a disastrous decision for your business. ...

July 2, 2024 · 5 min · Harshvardhan Malpani

array_diff in excel – finding missing values from column B that exist in column A

Fill column A with bigger sample space, aka the longer array. Fill column B with smaller array, that has few or none of the elements from column A Now, you need to find out values that are in column A but not in column B, here is what you do. Create a separate column C and put this formula in cell C1 or $C$1\ =IF(ISERROR(MATCH(A1, $B$1:$C$<LAST_ROWNUMBER_THAT_EXISTS_IN_COLUMN_B>, 0)), A1, "") Ultimately your formula becomes match function dependable for whole column A. You just have to drag the cell C1 downwards.

April 7, 2024 · 1 min · Harshvardhan Malpani

How to temporarily bypass content security policy CSP headers

Browser: Firefox Extension: Mod Headers https://addons.mozilla.org/en-US/firefox/addon/modheader-firefox/ Add A CSP policy like this: Use “parse” option and paste this:\ default-src *; script-src 'unsafe-inline' 'unsafe-eval' *; style-src 'unsafe-inline' *; img-src * blob: data:; font-src * data:; To create a Content Security Policy (CSP) header that allows everything, you would use the 'unsafe-inline' and 'unsafe-eval' sources for scripts and styles, and the * wildcard to allow all other sources. This setup is generally not recommended for production environments because it exposes your site to potential security vulnerabilities. However, it can be useful for development or testing purposes. Here’s an example of what this CSP header might look like: ...

March 7, 2024 · 2 min · Harshvardhan Malpani

Proxy another website url on a particular path using cloudflare workers – modify response body

// cloudflare worker to proxy a path or a whole url and make changes in response for any use case. const SECOND_DOMAIN = 'second.YOURDOMAIN.com' const THIRD_DOMAIN = 'third.YOURDOMAIN.com' const THIRD_PATH = 'abc-pathname-seo' const THIRD_LINK = 'https://' + THIRD_DOMAIN + THIRD_PATH async function handleRequest(event) { const url = new URL(event.request.url) const pathname = url.pathname if (pathname === '/' + THIRD_PATH) { return thirdLander(event) } const search = url.search const pathWithParams = pathname + search return retrieveStatic(event, pathWithParams) } async function retrieveStatic(event, pathname) { let response = await caches.default.match(event.request) if (response) { return response } const requestHeaders = new Headers(event.request.headers) const headers = new Headers() headers.set('Host', SECOND_DOMAIN) headers.set('Accept', requestHeaders.get('Accept')) headers.set('Accept-Encoding', requestHeaders.get('Accept-Encoding')) let init = { redirect: 'manual', method: event.request.method, headers: headers, } response = await fetch(`https://${THIRD_DOMAIN}/${pathname}`, init) if (event.request.method === 'GET') { event.waitUntil(caches.default.put(event.request, response.clone())) } return response } async function thirdLander(event) { let response = await caches.default.match(event.request) if (response) { return response } const requestHeaders = new Headers(event.request.headers) const headers = new Headers() headers.set('Host', THIRD_DOMAIN) headers.set('Accept', requestHeaders.get('Accept')) headers.set('Accept-Encoding', requestHeaders.get('Accept-Encoding')) headers.set('Cookie', requestHeaders.get('Cookie')) let init = { redirect: 'manual', method: event.request.method, headers: headers, } response = await fetch(THIRD_LINK, init) // RESPONSE BODY MODIFICATION let res2 = response.clone() let orgBody = await response.text() orgBody = orgBody.replace(/src="\//g, 'src="') orgBody = orgBody.replace(/url\("\//g, `url("https://${THIRD_DOMAIN}/`) orgBody = orgBody.replace(/<\/head>/g, `<base href="https://${THIRD_DOMAIN}/" target=_blank><link rel="canonical" href="https://YOURDOMAIN.com${THIRD_PATH}" /></head>`) if (event.request.method === 'GET') { event.waitUntil(caches.default.put(event.request, new Response(orgBody, res2))) } return new Response(orgBody, res2) } addEventListener("fetch", (event) => { event.passThroughOnException() event.respondWith(handleRequest(event)) })

October 9, 2023 · 2 min · Harshvardhan Malpani

How to speed up slow Magento indexer process? Maria DB 10.4

Category Products index taking too much time? bin/magento index:reset bin/magento index:reindex Stuck at category products index … Here is the solution if you are using MariaDB 10.4 You need to update options/parameters for your db. If using RDS, edit “DB instance parameter group” that you are using and update these 2 values: optimizer_switch='rowid_filter=off' optimizer_use_condition_selectivity = 1 After these changes, restart your database. In aws, RDS automatically updates these parameters without any downtime or requirement for restarting. You will see noticeable difference in indexer time. ...

September 8, 2023 · 1 min · Harshvardhan Malpani

Windows 10 WSL Ubuntu Common Commands and hacks

In C:\Windows\System32\drivers\etc\hosts 127.0.0.1 test.tld ::1 test.tld #::1 is really important sometimes Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\AppId_Catalog\0408F7A3] "AppFullPath"="C:\\Windows\\System32\\wsl.exe" "PermittedLspCategories"=dword:80000000 Save the above as a .reg file and run it to update registry Powershell script=> save as .ps1 file If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { $arguments = "& '" + $myinvocation.mycommand.definition + "'" Start-Process powershell -Verb runAs -ArgumentList $arguments Break } $remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '" $found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; if( $found ){ $remoteport = $matches[0]; } else{ echo "The Script Exited, the ip address of WSL 2 cannot be found"; exit; } #[Ports] #All the ports you want to forward separated by coma $ports=@(80,443,3306); #[Static ip] #You can change the addr to your ip config to listen to a specific address $addr='0.0.0.0'; $ports_a = $ports -join ","; #Remove Firewall Exception Rules iex "Remove-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' "; #adding Exception Rules for inbound and outbound Rules iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Outbound -LocalPort $ports_a -Action Allow -Protocol TCP"; iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort $ports_a -Action Allow -Protocol TCP"; for( $i = 0; $i -lt $ports.length; $i++ ){ $port = $ports[$i]; iex "netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr"; iex "netsh interface portproxy add v4tov4 listenport=$port listenaddress=$addr connectport=$port connectaddress=$remoteport"; } netsh interface portproxy show v4tov4 check if your proxy is working ...

April 1, 2022 · 2 min · Harshvardhan Malpani

Remove zone.identifier files in windows

find . -name "*:Zone.Identifier" -type f -delete Usually seen in wsl issues https://github.com/microsoft/WSL/issues/7456 and https://github.com/microsoft/WSL/issues/4609

March 21, 2022 · 1 min · Harshvardhan Malpani

Condition types for addAttributeToFilter in Magento2 Collections

'eq' => "{{column}} = ?", 'finset' => "FIND_IN_SET(?, {{column}})", 'from' => "{{column}} >= ?", 'gt' => "{{column}} > ?", 'gteq' => "{{column}} >= ?", 'in' => "{{column}} IN(?)", 'is' => "{{column}} IS ?", 'like' => "{{column}} LIKE ?", 'lt' => "{{column}} < ?", 'lteq' => "{{column}} <= ?", 'neq' => "{{column}} != ?", 'nin' => "{{column}} NOT IN(?)", 'nlike' => "{{column}} NOT LIKE ?", 'notnull' => "{{column}} IS NOT NULL", 'ntoa' => "INET_NTOA({{column}}) LIKE ?", 'null' => "{{column}} IS NULL", 'regexp' => "{{column}} REGEXP ?", 'seq' => null, 'sneq' => null, 'to' => "{{column}} <= ?"

March 3, 2022 · 1 min · Harshvardhan Malpani

How to fix CORS error for amazon s3 files and resources?

Go to bucket In the bucket permissions tab There is a section for CORS, put the following in it and save. [ { "AllowedOrigins": [ "*" ], "AllowedMethods": [ "GET" ], "MaxAgeSeconds": 3000, "ExposeHeaders": [ "Content-Range", "Content-Length", "ETag" ], "AllowedHeaders": [ "Authorization", "Content-Range", "Accept", "Content-Type", "Origin", "Range" ] } ]

January 17, 2022 · 1 min · Harshvardhan Malpani

centos web panel – vhost templates for proxying websocket traffic

http://wiki.centos-webpanel.com/webservers-vhost-templates Templates location: /usr/local/cwpsrv/htdocs/resources/conf/web_servers/ – Folder main contains main configuration for WebServers – Folder vhosts contains vhosts configuration for domains (this is what you need) How to create a template file The easiest way to do that is to simply copy an existing file and then edit a new file you have created. Note that you need to have .tpl and .stpl files (tpl is for http and stpl is for https version) ...

January 7, 2022 · 1 min · Harshvardhan Malpani