Skip to content

Instantly share code, notes, and snippets.

View KamranBiglari's full-sized avatar
:octocat:

Kamran Biglari KamranBiglari

:octocat:
View GitHub Profile
@KamranBiglari
KamranBiglari / websocket_script.md
Last active November 7, 2024 11:50
WebSocket Client Script with Dynamic User Prompts and Auto Installation of websocat

This Bash script establishes a WebSocket connection to a server, allowing users to send a sequence of messages interactively. It is particularly useful for testing WebSocket APIs or automating WebSocket-based data subscriptions.

The script leverages websocat for WebSocket communication. If websocat is not installed, the script will prompt the user to install it automatically.

Features

  • Interactive Setup: The script prompts the user for essential parameters, including:
  • WebSocket URL: Defaults to wss://example.com if left blank.
  • Username and Password: For authentication in the WebSocket server.
  • Currency (CCY): Used to specify the currency in the subscription message.
@behroozam
behroozam / Dockerfile
Last active March 4, 2024 12:15
send nginx custom log to elasticsearch with fluentd syslog input
FROM fluent/fluentd:v1.3-1
# Use root account to use apk
USER root
# below RUN includes plugin as examples elasticsearch is not required
# you may customize including plugins as you wish
RUN apk add --no-cache --update --virtual .build-deps \
build-base ruby-dev \
&& gem install \