Skip to content

Instantly share code, notes, and snippets.

@loskiq
Last active October 28, 2025 12:43
Show Gist options
  • Save loskiq/f6d9348c8cfd8573a90cafda88a57392 to your computer and use it in GitHub Desktop.
Save loskiq/f6d9348c8cfd8573a90cafda88a57392 to your computer and use it in GitHub Desktop.

Revisions

  1. loskiq revised this gist Sep 2, 2024. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions 3x-ui.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,12 @@
    openssl req -x509 -keyout /etc/ssl/certs/3x-ui.key -out /etc/ssl/certs/3x-ui.pem -newkey rsa:4096 -sha256 -days 3650 -nodes -new
    ```

    ### Generate self-signed certificate with Subject Alternative Name

    ```
    openssl req -x509 -keyout /etc/ssl/certs/3x-ui.key -out /etc/ssl/certs/3x-ui.pem -newkey rsa:4096 -sha256 -days 3650 -nodes -new -addext "subjectAltName=DNS:*.domain.com"
    ```

    ### Show fingerprint of certificate

    ```
  2. loskiq revised this gist Aug 26, 2024. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions 3x-ui.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    ### Generate self-signed certificate

    ```
    openssl req -x509 -keyout /etc/ssl/certs/3x-ui.key -out /etc/ssl/certs/3x-ui.pem -newkey rsa:4096 -sha256 -days 3650 -nodes -new
    ```

    ### Show fingerprint of certificate

    ```
    openssl x509 -noout -sha256 -fingerprint -in /etc/ssl/certs/3x-ui.pem
    ```
  3. loskiq revised this gist Aug 16, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions sysctl.conf
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ net.core.wmem_max = 67108864
    net.core.dev_weight = 16
    net.core.netdev_max_backlog = 16000
    net.core.somaxconn = 4096
    net.core.default_qdisc = fq

    net.netfilter.nf_conntrack_max = 1048576
    net.netfilter.nf_conntrack_buckets = 131072
  4. loskiq revised this gist Aug 13, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion xray.service
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ After=network.target
    [Service]
    CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
    AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
    ExecStart=/usr/local/bin/xray run -c /etc/xray.yaml
    ExecStart=/usr/local/bin/xray -c /etc/xray.yaml
    User=xray
    Group=xray
    Restart=on-failure
  5. loskiq revised this gist Aug 13, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### Check TLS 1.3
    ### Check TLS 1.3 for host

    ```
    openssl s_client -brief -state -connect 188.165.1.3:443 -servername www.checkyourorders24-7.com
  6. loskiq revised this gist Aug 13, 2024. 1 changed file with 38 additions and 0 deletions.
    38 changes: 38 additions & 0 deletions sysctl.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    # tunning network stack

    #net.ipv6.conf.all.disable_ipv6 = 1

    fs.file-max = 51200

    net.core.rmem_max = 67108864
    net.core.wmem_max = 67108864
    net.core.dev_weight = 16
    net.core.netdev_max_backlog = 16000
    net.core.somaxconn = 4096

    net.netfilter.nf_conntrack_max = 1048576
    net.netfilter.nf_conntrack_buckets = 131072
    net.netfilter.nf_conntrack_generic_timeout = 60
    net.netfilter.nf_conntrack_icmp_timeout = 10
    net.netfilter.nf_conntrack_tcp_timeout_close_wait = 20
    net.netfilter.nf_conntrack_tcp_timeout_established = 600
    net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 30
    net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 30
    net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 60
    net.netfilter.nf_conntrack_tcp_timeout_time_wait = 60
    net.netfilter.nf_conntrack_udp_timeout_stream = 60
    net.netfilter.nf_conntrack_checksum = 0

    net.ipv4.tcp_syncookies = 1
    net.ipv4.tcp_tw_reuse = 1
    net.ipv4.tcp_fin_timeout = 30
    net.ipv4.tcp_keepalive_time = 1200
    net.ipv4.ip_local_port_range = 10000 65000
    net.ipv4.tcp_max_syn_backlog = 8192
    net.ipv4.tcp_max_tw_buckets = 5000
    net.ipv4.tcp_fastopen = 3
    net.ipv4.tcp_mem = 25600 51200 102400
    net.ipv4.tcp_rmem = 4096 87380 67108864
    net.ipv4.tcp_wmem = 4096 65536 67108864
    net.ipv4.tcp_mtu_probing = 1
    net.ipv4.tcp_congestion_control = bbr
  7. loskiq revised this gist Aug 11, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -4,15 +4,15 @@
    openssl s_client -brief -state -connect 188.165.1.3:443 -servername www.checkyourorders24-7.com
    ```

    ### Generate
    ### Generate uuid, private/public keys and shortid

    ```
    xray uuid
    xray x25519
    openssl rand -hex 8
    ```

    ### Mobile clients
    ### String for mobile clients (v2rayng, foxray, hiddify)

    ```
    vless://[email protected]:443?flow=xtls-rprx-vision&type=tcp&security=reality&sni=www.checkyourorders24-7.com&fp=chrome&pbk=seBxvk7WKB1qw4YGQTWtqwfgvLPCGD-CB0zjY7lbF3o&sid=032e0ae968dca962#xtls
  8. loskiq revised this gist Aug 11, 2024. No changes.
  9. loskiq revised this gist Aug 11, 2024. 2 changed files with 34 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    ### Check TLS 1.3

    ```
    openssl s_client -brief -state -connect 188.165.1.3:443 -servername www.checkyourorders24-7.com
    ```

    ### Generate

    ```
    xray uuid
    xray x25519
    openssl rand -hex 8
    ```

    ### Mobile clients

    ```
    vless://[email protected]:443?flow=xtls-rprx-vision&type=tcp&security=reality&sni=www.checkyourorders24-7.com&fp=chrome&pbk=seBxvk7WKB1qw4YGQTWtqwfgvLPCGD-CB0zjY7lbF3o&sid=032e0ae968dca962#xtls
    ```
    15 changes: 15 additions & 0 deletions xray.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    [Unit]
    Description=xray
    After=network.target

    [Service]
    CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
    AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
    ExecStart=/usr/local/bin/xray run -c /etc/xray.yaml
    User=xray
    Group=xray
    Restart=on-failure
    SyslogIdentifier=xray

    [Install]
    WantedBy=multi-user.target
  10. loskiq revised this gist Aug 11, 2024. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions xray-client.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    inbounds:
    - listen: 127.0.0.1
    port: 1082
    protocol: socks
    settings:
    udp: true
    outbounds:
    - protocol: vless
    settings:
    vnext:
    - address: domain.com
    port: 443
    users:
    - id: 71f84a4b-6b0c-4b84-b003-10f6ed1b6714
    flow: xtls-rprx-vision
    encryption: none
    streamSettings:
    network: tcp
    security: reality
    realitySettings:
    fingerprint: chrome
    serverName: www.checkyourorders24-7.com
    publicKey: seBxvk7WKB1qw4YGQTWtqwfgvLPCGD-CB0zjY7lbF3o
    shortId: 032e0ae968dca962
  11. loskiq created this gist Aug 11, 2024.
    21 changes: 21 additions & 0 deletions xray-server.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    inbounds:
    - listen: 0.0.0.0
    port: 443
    protocol: vless
    settings:
    clients:
    - id: 71f84a4b-6b0c-4b84-b003-10f6ed1b6714 # loskiq
    flow: xtls-rprx-vision
    decryption: none
    streamSettings:
    network: tcp
    security: reality
    realitySettings:
    dest: 188.165.1.3:443
    serverNames:
    - www.checkyourorders24-7.com
    privateKey: 2G1jQB0yxEczmCIbfDkwND_07e4kskjZjlYFaAu5pEU
    shortIds:
    - 032e0ae968dca962
    outbounds:
    - protocol: freedom