Skip to content

Instantly share code, notes, and snippets.

View alonisser's full-sized avatar

Alonisser alonisser

View GitHub Profile
alonisser / .aliases
Last active May 23, 2024 14:18
Setting up a dev machine (with osx)
alias ll="ls -lhA"
alias cd..="cd .."
alias psg="ps aux | grep -v grep | grep -i -e VSZ -e"
alias ps="ps auxf"
alias mkdir="mkdir -pv"
alias wget="wget -c"
alias histg="history | grep"
alias kedit-secret=" kubectl edit secret"
alias cat="bat"
alonisser /
Last active November 7, 2021 15:40
Code for medium post
# Create the read stream
dataitemsAppendDf = spark.readStream.format("delta")\
.option("maxFilesPerTrigger", 25)\
# Initiate the write stream
dataitemsAppendDf.writeStream \
.trigger(processingTime='15 seconds') \ # note, you can also have different modes here
.option("checkpointLocation", f"{checkpoint_name}") \
.foreachBatch(processRawStreamBatch) \ #Callback that would handle each batch
alonisser / react modern
Last active August 18, 2021 08:24
React tools
alonisser /
Created June 27, 2020 18:47
Ansible role for running the kafka-consumer-groups cli tool from docker with changing .properties according to env
bootstrap.servers={{ kafka_cluster.boostrap_servers }}
sasl.mechanism=PLAIN required username="{{kafka_cluster.username}}" password="{{kafka_cluster.password}}";
alonisser / Dockerfile
Last active June 28, 2022 02:26
Dockerfile for spacy prodigy for cloud setup using remote postgresql including changing instructions file and overriding index.html - and the leanest I've got
FROM python:3.6-alpine
# Opted for alpine to get a lean docker image as possible
RUN apk add --no-cache openssl
RUN wget$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# Python deps for alpine
alonisser / postgres_connections
Last active November 27, 2015 18:09
Finding the postgres connections hog
#Broken somehow. need to fix
SELECT COUNT(*) as datname, datname, datid FROM pg_stat_activity GROUP BY datname;
#Works without id
SELECT COUNT(*) as datname, datname FROM pg_stat_activity GROUP BY datname;
More info:
alonisser / Installation
Last active August 29, 2015 14:25
Ansible role for setting cloudwatch reporting script on ubuntu servers
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
mkdir automation && cd automation
touch ansible.cfg && hosts
mkdir -pv roles/aws_monitoring/tasks/main.yml
alonisser / iptables-persistent no input
Last active April 17, 2024 10:59
Installing iptables-persistent on ubuntu without manual input
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
sudo apt-get -y install iptables-persistent
"title": "Nginx Web",
"services": {
"query": {
"list": {
"0": {
"query": "response:[200 TO 299]",
"alias": "OK",
"color": "#7EB26D",
"id": 0,