Skip to content

Instantly share code, notes, and snippets.

View msdousti's full-sized avatar

Sadeq Dousti msdousti

View GitHub Profile
@msdousti
msdousti / index.html
Last active July 3, 2017 09:33
A simple HTML file making 100 dummy POST requests to /form.php
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title>A Page</title>
</head>
@msdousti
msdousti / form.php
Created July 3, 2017 09:35
A simple PHP file, returning "204 NO CONTENT" in response to any request
<?php
ob_start();
header("HTTP/1.1 204 NO CONTENT");
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP 1.1.
header("Pragma: no-cache"); // HTTP 1.0.
header("Expires: 0"); // Proxies.
@msdousti
msdousti / ElementalReverseProxy.java
Created July 3, 2017 09:41
The file taken from Apache HC project, and only modified to printStackTrace and exit at line 276.
/*
* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
import org.bouncycastle.crypto.agreement.srp.SRP6Client;
import org.bouncycastle.crypto.agreement.srp.SRP6Server;
import org.bouncycastle.crypto.agreement.srp.SRP6StandardGroups;
import org.bouncycastle.crypto.agreement.srp.SRP6VerifierGenerator;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.bouncycastle.util.BigIntegers;
import java.lang.reflect.Field;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
# First enable "Developer Tools" & "USB Debugging"
adb shell
pm uninstall -k --user 0 com.mi.globalbrowser
pm uninstall -k --user 0 com.miui.analytics
#!/bin/bash
secret_name=lumberjack-subscription-management-staging-credentials
token=$(zkubectl get secrets $secret_name -ojsonpath='{$.data.nakadi-token-secret}' | base64 -d)
# Nakadi URL
TEST_URL=https://nakadi-staging.aruha-test.zalan.do
PROD_URL=https://nakadi-live.nakadi.zalan.do
nakadi_url=$TEST_URL
[
{
"metadata":
{
"occurred_at": "2023-08-02T10:52:57.454Z",
"eid": "85469179-ef95-41b8-9c04-1184685e5555"
},
"data_op": "C",
"data_type": "wholesale.goods-receipt-event",
"data":
#!/bin/bash
# Assign the first argument to branch_name,
# or use "new-branch" if no argument is provided
branch_name=${1:-new-branch}
# Set the branch variable based on existence
if git show-ref --verify --quiet refs/heads/master; then
branch=master
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.read.ListAppender;
import jakarta.annotation.Nonnull;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.function.Supplier;
#!/bin/bash
set -euxo pipefail
echo "Starting Colima..."
colima start >/dev/null 2>&1
echo "Creating docker.sock anew..."
sudo bash -c '
rm /var/run/docker.sock >/dev/null 2>&1
ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock