Skip to content

Instantly share code, notes, and snippets.

View mrhalix's full-sized avatar
💭
Call me on telegram

SM. Amin Aleahmad mrhalix

💭
Call me on telegram
View GitHub Profile
@ahbanavi
ahbanavi / script.sh
Last active December 9, 2024 20:27
Dcoker Bind NIC (Network Interface)
# Interface to bind in this example
# ID: wlan0, IP: 192.168.10.183, Gateway: 192.168.10.1
docker network create -d bridge --subnet=172.18.0.0/16 --gateway=172.18.0.1 -o com.docker.network.bridge.enable_ip_masquerade=false -o com.docker.network.bridge.name=docker_binded docker_binded
echo '1 docker_binded' >> /etc/iproute2/rt_tables
ip rule add from 172.18.0.0/16 tab docker_binded
ip route add 172.18.0.0/16 dev wlan0 tab docker_binded
@SepehrImanian
SepehrImanian / changeUser.sh
Last active January 11, 2023 11:29
Change git user in same repo in server
#!/bin/bash
if [[ $1 = "sepehr" ]]; then
git config --local user.email "[email protected]"
git config --local user.name "sepehrimanian"
echo "Change git user to 'Sepehr'"
elif [[ $1 = "ali" ]]; then
git config --local user.email "[email protected]"
git config --local user.name "ali"
echo "Change git user to 'ali'"
@Suzhou65
Suzhou65 / CloudFlare_DDNS_2.md
Last active July 24, 2024 13:35
Get DNS record from CloudFlare API

Let's try to ask DNS record for CloudFlare API.

Replace the "API Token" at auth_key by the API Token you get, the "Zone ID" can be found in Cloudflare Dashboard, logged in the Cloudflare Dashboard, check the Domain page, "Zone ID" information will appearance at API block, right hand side.

import json
import requests

cloudflare_api = "https://api.cloudflare.com/client/v4/"
zone_id = "278035ad7a9d983bc54a990b43ef7eb0"
Windows:
> choco install apache-httpd
# source: https://chocolatey.org/packages/apache-httpd
Mac os:
As of macos bigsur ab is installed by default in macos
Ubuntu:
@rordi
rordi / root-password-MariaDB-docker-compose.md
Last active April 30, 2025 16:02
Change root password in MariaDB Docker container running with docker-compose

Change root password in MariaDB Docker container running with docker-compose

Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:

entrypoint: mysqld_safe --skip-grant-tables --user=mysql

The start up the Docker Compose stack:

$> docker-compose up -d
@timefcuk
timefcuk / ovpn-server-with-certs.md
Last active April 24, 2025 17:03 — forked from SmartFinn/ovpn-server-with-certs.md
MikroTik (RouterOS) script for setup OpenVPN server and generate certificates
@ajxchapman
ajxchapman / README.md
Last active February 20, 2025 17:25
Install Windows on Digital Ocean droplet
@victorddiniz
victorddiniz / cassadran-reaper-deployment.yaml
Created August 13, 2018 15:59
Cassandra-reaper kubernetes deployment
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: cassandra-reaper
namespace: cassandra-reaper
spec:
template:
metadata:
labels:
app: cassandra-reaper
@kgersen
kgersen / ripe-alloc2db.sh
Created August 9, 2018 13:26
RIPE alloclist to database conversion
#!/bin/bash
# convert RIPE allocation list to database friendly format
# (c) kgersen 2018 for https://lafibre.info
# tab (\t) is used as separator in output
# output
# country ispcode ispname date 4|6 block block_size
# optionnal argument: country code to match
url="https://ftp.ripe.net/ripe/stats/membership/alloclist.txt"
@sdenel
sdenel / nginx-hello-world-deployment.yaml
Last active April 2, 2025 14:50
Kubernetes: a simple Nginx "Hello world" deployment file
# To deploy: kubectl create -f nginx-hello-world-deployment.yaml
# Access it with the API as a proxy:
# $ kubectl proxy
# Then in you browser: http://localhost:8001/api/v1/namespaces/default/services/nginx:/proxy/#!/
apiVersion: v1
kind: Service
metadata:
name: nginx
spec: