Skip to content

Instantly share code, notes, and snippets.

View hadi2f244's full-sized avatar

Hadi Azaddel hadi2f244

View GitHub Profile
@hadi2f244
hadi2f244 / kubeshark
Last active October 4, 2023 09:37
kubeshark commands
```
# start kubeshark on port 0.0.0.0:8899 for all namespaces and decrypt tls connection
sudo kubeshark tap --docker-registry nexus.hadiazad.local/kubeshark --proxy-host 0.0.0.0 --ignoretainted --tls
# Delete kubeshark deployments
sudo kubeshark clean
```
You can also change kubeshark config :
```
# create config file :
sudo kubectl get po -o custom-columns="Name:metadata.name,CPU-limit:spec.containers[*].resources.limits.cpu, CPU-request:spec.containers[*].resources.requests.cpu, memory-limits:spec.containers[*].resources.limits.memory, memory-request:spec.containers[*].resources.requests.memory" -A
@hadi2f244
hadi2f244 / check_tcp_pod
Created September 4, 2023 08:13
Check tcp connection in pod simplly
</dev/tcp/nginx-1.nginx-1.svc.cluster.local/80 && echo open || echo closed
@hadi2f244
hadi2f244 / limit_journald_log_size
Created September 2, 2023 10:30
Limit journald log size
sudo sed -i '/^#SystemMaxUse=/s/^#//; s/^SystemMaxUse=.*/SystemMaxUse=50M/' /etc/systemd/journald.conf && sudo service systemd-journald restart
@hadi2f244
hadi2f244 / nexus_upload.sh
Created July 25, 2023 12:01
nexus file upload
find . -type f -print | xargs -I {} curl -v -u admin:admin123 --upload-file {} https://nexus.hadiazad.local/repository/FileRepo/\{\}
@hadi2f244
hadi2f244 / step-ca-readme.md
Last active July 26, 2023 08:44
A simple guidance for installing CA with step-ca

Prerequisites:

CA Server

  1. Install step and step-ca commands. Follow official document or simply :
curl -L https://dl.smallstep.com/gh-release/cli/docs-ca-install/v0.23.2/step_linux_0.23.2_amd64.tar.gz \
   -o step.tar.gz
tar -xf step.tar.gz
sudo cp step_0.23.2/bin/step /usr/bin
@hadi2f244
hadi2f244 / docker-compose.yml
Created July 11, 2023 06:37
powerdns with admin ui
version: '2'
services:
db:
image: mariadb:latest
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
- MYSQL_DATABASE=powerdnsadmin
- MYSQL_USER=pdns
- MYSQL_PASSWORD=mypdns
@hadi2f244
hadi2f244 / custom_tcp_pkt.py
Last active May 18, 2023 15:02
sudo python3 main.py 172.16.16.181 2233 172.16.23.20 4444
import socket
import struct
import array
import argparse
# Instantiate the parser
parser = argparse.ArgumentParser(description='Send custom tcp packet')
parser.add_argument('src_ip', type=str,
help='Source IP address')
@hadi2f244
hadi2f244 / fileio_sysbench.sh
Created July 3, 2021 18:44
Run some fileio module scenarios in sysbench
#!/bin/bash
sysbench fileio cleanup
total_sizes=(
13M
10G
)
test_type=(
seqwr # sequential write
@hadi2f244
hadi2f244 / cloudSettings
Last active December 30, 2020 11:03
Actually I suffered from loss of a simple eject command in linux. Sometimes I just want to eject a damn hard or flash and nothing more!!! To use it properly read HELP comment in the file.
{"lastUpload":"2020-12-30T11:03:52.998Z","extensionVersion":"v3.4.3"}