Skip to content

Instantly share code, notes, and snippets.

@shahinam2
shahinam2 / security-context-capabilities.yaml
Created July 26, 2025 19:56 — forked from anjmao/security-context-capabilities.yaml
Kubernetes security context all capabilities
apiVersion: v1
kind: Pod
metadata:
name: security-context-capabilities
spec:
containers:
- name: example
image: gcr.io/google-samples/node-hello:1.0
securityContext:
capabilities:
First check the aws version
```bash
aws --version
```
- Write your credentials using this command
```bash
aws configure
```
@shahinam2
shahinam2 / tun2proxy.sh
Created February 3, 2025 08:56 — forked from sae13/tun2proxy.sh
idea account copiliot account through proxy
#!/bin/bash
mkdir -p /home/saeb/App/tun2proxy >/dev/null 2>&1
cd /home/saeb/App/tun2proxy || true
aria2c -x 16 -k1m -s 16 -c "https://github.com/tun2proxy/tun2proxy/releases/latest/download/tun2proxy-x86_64-unknown-linux-gnu.zip"
7z x -aoa tun2proxy-x86_64-unknown-linux-gnu.zip
sudo ip tuntap add name tun0 mode tun
sudo ip link set tun0 up
# Define array of domains
domains=(
@shahinam2
shahinam2 / postgres-cheatsheet.md
Created February 1, 2025 17:30 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@shahinam2
shahinam2 / create-docker-droplet.sh
Created April 8, 2023 18:36 — forked from christianberg/create-docker-droplet.sh
Shell script to create a Digital Ocean Droplet and install docker
#!/bin/bash
set -e
SECRETFILE=~/.digitalocean
if [[ -z $DIGOCEAN_ID ]] || [[ -z $DIGOCEAN_KEY ]]; then
if [ -e $SECRETFILE ]; then
. $SECRETFILE
fi
fi
@shahinam2
shahinam2 / gist:443241db6eef6efa15bbcfbff2524aa1
Created April 12, 2022 18:54 — forked from Evalle/gist:7b21e0357c137875a03480428a7d6bf6
How to configure Docker to use external DNS server
Either via
$ docker run --dns 10.0.0.2 busybox nslookup google.com
or edit your /etc/docker/daemon.json to have something like:
{
"dns": ["10.0.0.2", "8.8.8.8"]
}
then restart docker service
#!/bin/bash
# Install the C compiler and supporting libraries first:
yum update -y
yum install wget -y
yum groupinstall "Development Tools" -y
yum install pcre pcre-devel zlib zlib-devel openssl openssl-devel make -y
# Make sure the download link is up to date.
# get the latest link from here:
#!/bin/bash
# Install the C compiler and supporting libraries first:
apt-get update -y
apt-get install build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev make -y
# Make sure the download link is up to date.
# get the latest link from here:
# https://nginx.org/en/download.html
wget https://nginx.org/download/nginx-1.21.5.tar.gz
@shahinam2
shahinam2 / gist:8d57b045bce6066f572edf332a725b92
Created October 15, 2021 13:59
QR Code generator (HTML+Node.js)
<!DOCTYPE html>
<html lang="en">
<head>
<title>QR-Code Generator</title>
<style>
* {
margin: 0px;
padding: 0px;
font-family: monospace, Arial, sans-serif;
}
ls -A | grep "^\."