Skip to content

Instantly share code, notes, and snippets.

/**
* node.js NoSQL embedded database
* Version: 2.0.7
* Date: 12.09.2014
*
* This file only contains the nodejs nosql typescript definition, run:
$ sudo npm install -g nosql
// or
$ npm install nosql
* this will download the javascript file.
#!/bin/bash
MVN_CMD=${@:-"install"}
# Simple script to run maven in docker in powershell
# by also having a volume of the maven-repos
docker volume create --name maven-repo
docker run -it --rm -v "/$(pwd)"://usr/src/mymaven -v maven-repo://root/.m2 -w //usr/src/mymaven maven mvn $MVN_CMD
#!/bin/sh
# source: https://hackernoon.com/handy-docker-aliases-4bd85089a3b8
# custom extended
# enable updateing this file
.docker-alias() {
SOURCE="https://gist.github.com/BigSisl/7e3f38858dbb460b28b334cfb47c9633/raw/.docker-alias"
if [ "$1" == "update" ]; then
echo "start updating ${FUNCNAME[0]} from $SOURCE"
#!/bin/bash
tmux-session=mySession
tmux new -d -s $tmux-session
command=${@//-c/}
if [[ ! "$(pgrep custom | wc -l)" -le "2" ]]; then
echo "already running";
@BitFis
BitFis / easy-bash-cli.sh
Last active March 16, 2021 10:00
Provide template for fast and easy cli for bash
# print the list of commands starting with prefix_command
usage() {
echo "Usage:"
sed -ne 's/^prefix_command_\(.\+\)().*/ crowdr \1/p' ${BASH_SOURCE-}
echo
echo "CLI v$(crowdr_command_version) (docs @ [LINK])"
}
# define the help function, define more functions as "_server_cli_[CMD]"
check https://github.com/ermakovich/pptr-mock-server/pull/129
@BitFis
BitFis / _conf.sh
Last active November 8, 2021 09:31
Configurations
#!/bin/bash
# configure gitconfig aliases
curl https://gist.githubusercontent.com/BitFis/d7bba90c1a45c0def808c3041ad23c16/raw/aliases.gitconfig >> ~/.gitconfig
@BitFis
BitFis / cmake-variables
Last active August 5, 2022 13:37
Convert cmake variables to a markdown with bash
#!/bin/bash
# Copyright (C) 2022 Lucien Zuercher <[email protected]>
# SPDX-License-Identifier: MIT
set -e
export CMAKE_COMMAND=${CMAKE_COMMAND:-"cmake"}
color_error="\e[0;91m"
color_reset="\e[0m"
@BitFis
BitFis / node-exporter
Created August 28, 2022 14:19
Manage prometheus node-exporter locally
#!/bin/bash
# Manage node exporter binary
# references:
# - https://prometheus.io/docs/guides/node-exporter/
# - https://jaanhio.me/blog/linux-node-exporter-setup/
# print the list of commands starting with prefix_command
usage() {
echo "Usage:"
sed -ne 's/^prefix_command_\(.\+\)().*/ crowdr \1/p' ${BASH_SOURCE-}
@BitFis
BitFis / client.py
Created November 16, 2023 21:26
Mutlicast Server and client
#!/usr/bin/env python
import socket
import struct
def main():
MCAST_GRP = 'ff05::abcd'
MCAST_PORT = 5007
sock = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.IPPROTO_IPV6, socket.IP_MULTICAST_TTL, 32)