Skip to content

Instantly share code, notes, and snippets.

tristandostaler /
Created Jul 8, 2016
script to count the number of occurence of an IP in the logs (used with a router)
sudo grep "SRC=" /var/log/kern.log |awk '{print $10}' | sort | uniq -c |sort -n |sed 's/SRC=//g' | sed 's/DST//g' | sed 's/DS//g' | sed 's/D//g' $
tristandostaler /
Created Jul 8, 2016
Script to block ip in IP tables.
if [ "$#" -ne 1 ]; then
echo "Usage: $0 IP (ex: $0" >&2
exit 1
sudo iptables -I INPUT 2 -s $1 -j DROP
sudo iptables -I FORWARD 2 -s $1 -j DROP
tristandostaler /
Created Jul 7, 2016
Start Selenium with ipython from script with interactive mode
ipython -i
tristandostaler /
Created Jul 7, 2016
Start Selenium python script
browser = None
def StartSelenium():
import selenium
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import binascii
import hashlib
firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True
firefox_capabilities['binary'] = '/usr/bin/firefox'
tristandostaler /
Created Jul 7, 2016
How to install correctly python Selenium (tested on ubuntu gnome)
apt-get install ipython
apt-get install python-pip
pip install selenium
mkdir /root/bin
cd /root/bin
tar -xvzf geckodriver-v0.9.0-linux64.tar.gz
rm geckodriver-v0.9.0-linux64.tar.gz
chmod +x geckodriver
cp geckodriver wires
View stacktrace
Initial SessionFactory creation Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
oct. 15, 2015 11:46:33 AM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [action] in context with path [/LOG660-E3-LA2] threw exception [L''exécution de la servlet a lancé une exception] with root cause
at ca.etsmtl.log660.bean.Adresse.getId(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)