Skip to content

Instantly share code, notes, and snippets.

Avatar

Alonisser alonisser

View GitHub Profile
@alonisser
alonisser / config.properties
Created Jun 27, 2020
Ansible role for running the kafka-consumer-groups cli tool from docker with changing .properties according to env
View config.properties
bootstrap.servers={{ kafka_cluster.boostrap_servers }}
ssl.endpoint.identification.algorithm=https
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="{{kafka_cluster.username}}" password="{{kafka_cluster.password}}";
@alonisser
alonisser / Dockerfile
Last active Mar 24, 2021
Dockerfile for spacy prodigy for cloud setup using remote postgresql including changing instructions file and overriding index.html - and the leanest I've got
View Dockerfile
FROM python:3.6-alpine
# Opted for alpine to get a lean docker image as possible
RUN apk add --no-cache openssl
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$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
alonisser / postgres_connections
Last active Nov 27, 2015
Finding the postgres connections hog
View postgres_connections
#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:
http://chrismiles.info/systemsadmin/databases/articles/viewing-current-postgresql-queries/
https://support.pivotal.io/hc/en-us/articles/201595093-Script-Session-level-information
@alonisser
alonisser / Installation
Last active Aug 29, 2015
Ansible role for setting cloudwatch reporting script on ubuntu servers
View Installation
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
alonisser / iptables-persistent no input
Last active Apr 8, 2021
Installing iptables-persistent on ubuntu without manual input
View iptables-persistent no 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
View nginx-dashboard.json
{
"title": "Nginx Web",
"services": {
"query": {
"list": {
"0": {
"query": "response:[200 TO 299]",
"alias": "OK",
"color": "#7EB26D",
"id": 0,
@alonisser
alonisser / ubuntu 14.04 server security setup
Last active Aug 29, 2015
Setting server security patches
View ubuntu 14.04 server security setup
1. replace apt-get upgrade to install only security patches:
http://askubuntu.com/questions/194/how-can-i-install-just-security-updates-from-the-command-line
2. use unattended-upgrade
3. automate unattended-upgrade with cron
https://help.ubuntu.com/community/AutomaticSecurityUpdates
4. get alerts about pending updates:
@alonisser
alonisser / solution_redis_misconf
Created Sep 17, 2014
Fixing redis "ISCONF Redis is configured to save RDB snapshots"
View solution_redis_misconf
check redis log /var/logs/redis/redis-server.log for write errors
can be permissions on the redis dbump dir or memory conditions or not enough place on disk
check place on disks:
http://www.cyberciti.biz/faq/check-free-space/
```
$ df -h
```