Skip to content

Instantly share code, notes, and snippets.

install pip & venv

sudo apt-get install python3 python3-pip python3-venv

upgrade pip, setuptools & wheel

python3 -m pip install --upgrade pip setuptools wheel 
import json
import scipy
import scipy.misc
import scipy.cluster
import webcolors
COLOR_TO_COLOR_GROUP = {
u'pink': u'pink',
u'lightpink': u'pink',
u'hotpink': u'pink',
# list topics
bin/kafka-topics.sh --list --zookeeper localhost:2181
# list groups
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list
# describe group
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group console-consumer-59433 --describe
# list partitions and offsets
/**
* Originally posted at: (not available now)
* http://blogs.sun.com/andreas/resource/InstallCert.java
* Use:
* java InstallCert hostname
* Example:
*% java InstallCert ecc.fedora.redhat.com
*/
import javax.net.ssl.*;
@ssledz
ssledz / install-node.md
Last active March 4, 2023 20:00
Install node & npm

install nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash

install node

nvm install v18.14.2
#!/bin/bash
assert_exit_status() {
lambda() {
local val_fd=$(echo $@ | tr -d ' ' | cut -d':' -f2)
local arg=$1
shift
shift
local cmd=$(echo $@ | xargs -E ':')
@ssledz
ssledz / system-out.bash
Last active December 4, 2017 17:00
bash lib : system out
#!/bin/bash
[[ -z $DBG ]] && DBG=0
now() {
date +"%Y-%m-%d %H:%M:%S"
}
eecho() {
local label=$1

check what listening on port 80

sudo ss -nltp | grep 80

encrypting compressed folder

tar cz my_folder/ | openssl enc -aes-256-cbc -e > encrypted.tar.gz.enc
# legend
^ means ctrl
# ctags
:!ctags *.m
:ta[g][!] tagstring # edit the file containing tagstring
:po[p][!] # pop the tagstack by one element
:tags
@ssledz
ssledz / aw-alert.sh
Last active February 9, 2017 09:07
mcabber eventcmd for awesome wm
#!/bin/bash
DBG=0
dbg() {
[[ $DBG == 1 ]] && (1>&2 echo "[DEBUG] : "$1)
}
info() {
echo "[INFO] : $1"