Skip to content

Instantly share code, notes, and snippets.

View msdousti's full-sized avatar

Sadeq Dousti msdousti

View GitHub Profile
create table test
as
select id, random() > 0.5 as to_be
from generate_series(1, 10000000) as id;
CREATE INDEX IF NOT EXISTS idx_1
ON test (id)
WHERE to_be = true;
CREATE INDEX IF NOT EXISTS idx_2
#!/bin/bash
users=("cantony" "hadmohammadi" "helseoudy" "mmorsy" "mtaufikakbar" "pebermann" "rogupta" "sdousti" "tschlage" "yzykau")
token=`ztoken`
for user in ${users[*]}; do
has_role=$(curl -sH "Authorization: Bearer $token" https://users.auth.zalando.com/api/employees/$user/groups | jq '.[] | select(.dn | contains("24x7 Emergency,ou=Retail Operations")) | length > 0')
echo "$user: $has_role"
done
#!/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
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
# 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
[
{
"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
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
# First enable "Developer Tools" & "USB Debugging"
adb shell
pm uninstall -k --user 0 com.mi.globalbrowser
pm uninstall -k --user 0 com.miui.analytics
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;
@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
*