Skip to content

Instantly share code, notes, and snippets.

Avatar

Alonisser alonisser

View GitHub Profile
@alonisser
alonisser / iptables-persistent no input
Last active Jan 11, 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
@alonisser
alonisser / Dockerfile
Last active Nov 13, 2020
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
View setup-headless-selenium-xvfb.sh
#!/bin/bash
#
# Bash script to setup headless Selenium (uses Xvfb and Chrome)
# (Tested on Ubuntu 12.04) trying on ubuntu server 14.04
# Add Google Chrome's repo to sources.list
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list
# Install Google's public key used for signing packages (e.g. Chrome)
# (Source: http://www.google.com/linuxrepositories/)
@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 / common_vagrant_problems.md
Last active Mar 24, 2017
Fixing vagrant virtualbox problems
View common_vagrant_problems.md
  1. Uncomment vb.gui=true in the vagrantfile and log in from there. solves a lot of problems, can also sudo reboot from there.
  2. To unlock 'guru meditation' mode: navigate to the virtualbox folder and: VBoxManage controlvm <vm> poweroff (notice this the virtualbox full vm name and not the vagrant name)
  3. Upgrade to virtualbox 4.16 ,solves 4.14 problems with vagrant 1.2.2
  4. Add more memory to the virtualbox (not more than the host machine has)
  5. check the bios setting allowing virtualization is enabled
@alonisser
alonisser / post-merge.sh
Created Dec 29, 2013
git hook for bower install and npm install on bower.json/package.json change
View post-merge.sh
#!/bin/sh
#Inspired by https://gist.github.com/jbergantine/3870080
#Since every `git pull` is actually a merge. We can use it to automaticly run basic Django tasks after pulling from the upstream master branch (or any other)
#Notice: This won't run at git fetch. since fetch doesn't merge anything
#Installation:
# copy this script with the name:`post-merge.sh` to your project root folder
# symlink it to the ./git/hooks/post-merge: `ln post-merge.sh .git/hooks/post-merge
#You should have bash (windows users, means cygwin/mingw anything that works for you
#Based on the instructions here: https://oknesset-devel.readthedocs.org/en/latest/workflow.html#before-coding
View django_post-merge.sh
#!/bin/sh
#Inspired by https://gist.github.com/jbergantine/3870080
#Since every `git pull` is actually a merge. We can use it to automaticly run basic Django tasks after pulling from the upstream master branch (or any other)
#Notice: This won't run at git fetch. since fetch doesn't merge anything
#Installation:
# copy this script with the name:`post-merge.sh` to your project root folder
# symlink it to the ./git/hooks/post-merge: `ln post-merge.sh .git/hooks/post-merge
#You should have bash (windows users, means cygwin/mingw anything that works for you
#Based on the instructions here: https://oknesset-devel.readthedocs.org/en/latest/workflow.html#before-coding
@alonisser
alonisser / precommit.sh
Created Jul 15, 2013
A naive implentation of a pre commit jslinting hook
View precommit.sh
#!/bin/sh
# A naive implentation of a pre commit jslinting hook
# First: checking if jshint is installed
retval=`jshint ; echo $?`
if [[ retval -ne 0 ]]
then
echo "You have to install JSHINT for this to work"
echo "npm install -g jshint"
exit 1
fi
@alonisser
alonisser / setup.md
Last active Dec 17, 2015
memo to self: how to setup a python developer windows 7 computer
View setup.md

#Setting up a windows 7 python dev computer

  • Set up a dev folder in root with subfolders: projects, programs, custom, envs.

  • Set a HOME (Check specific) variable to point to c:\dev\custom so .dot files should go there.

  • Python: install python 2.7.X 32bit in dev\programs also easy_install pip,and pip install virtualenv.

  • Install virtualenv-wrapper for windows and sets WORKON_HOME to c:\dev\envs

@alonisser
alonisser / double.js
Created May 21, 2013
a whatwg suggestion to solve to double sumbitting forms problem
View double.js
//a crude polyfill to handle this functionality