Skip to content

Instantly share code, notes, and snippets.

Initial SessionFactory creation failed.org.hibernate.MappingException: 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
java.lang.NullPointerException
at ca.etsmtl.log660.bean.Adresse.getId(Adresse.java:26)
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)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:164)
@tristandostaler
tristandostaler / StartSelenium.py
Created July 7, 2016 16:35
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
tristandostaler / StartSelenium.sh
Created July 7, 2016 16:36
Start Selenium with ipython from StartSelenium.py script with interactive mode
ipython -i StartSelenium.py
@tristandostaler
tristandostaler / countIP.sh
Created July 8, 2016 19:32
script to count the number of occurence of an IP in the logs (used with a router)
#/bin/sh
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
tristandostaler / gist:977689e2b2c7e5aad73d4c232e6df8c0
Created August 8, 2016 05:12
Simple nc backdoor listener reminder
nc -l -v -p xx
@tristandostaler
tristandostaler / blockIP.sh
Created July 8, 2016 19:30
Script to block ip in IP tables.
#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Usage: $0 IP (ex: $0 192.168.0.1)" >&2
exit 1
fi
sudo iptables -I INPUT 2 -s $1 -j DROP
sudo iptables -I FORWARD 2 -s $1 -j DROP
@tristandostaler
tristandostaler / InstallSelenium.sh
Created July 7, 2016 16:27
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
wget https://github.com/mozilla/geckodriver/releases/download/v0.9.0/geckodriver-v0.9.0-linux64.tar.gz
tar -xvzf geckodriver-v0.9.0-linux64.tar.gz
rm geckodriver-v0.9.0-linux64.tar.gz
chmod +x geckodriver
cp geckodriver wires
from flask import Flask
from flask import g
from flask import redirect, render_template, request, send_file, make_response, session, url_for
from captcha.image import ImageCaptcha
from io import BytesIO
from Crypto.Cipher import ARC4
from Crypto.Hash import SHA
from Crypto.Random import get_random_bytes
import base64
import string