This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough banksean@gmail.com | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Zeppelin install | |
pkg="zeppelin-0.8.0-bin-all.tgz" | |
wget "http://apache.rediris.es/zeppelin/zeppelin-0.8.0/$pkg" | |
tar xvzf $pkg | |
cd zeppelin-0.8.0-bin-all | |
prinf "Installing interpreters... \n" | |
./bin/install-interpreter.sh --all | |
printf "Starting Zeppelin... \n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version=6.6.0 | |
printf "Installing Apache Solr $version ...\n" | |
name="solr-$version" | |
pkg="$name.tgz" | |
wget "https://archive.apache.org/dist/lucene/solr/$version/$pkg" | |
tar zxvf $pkg | |
cd $name | |
sudo add-apt-repository ppa:webupd8team/java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Solr configuration | |
input { | |
file { | |
path => "/var/log/syslog" | |
start_position => "end" | |
} | |
} | |
filter { | |
if [message] =~ "crawler" or [message] =~ "milnomada" { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Help | |
# https://www.elastic.co/guide/en/logstash/current/plugins-outputs-solr_http.html | |
# https://www.elastic.co/guide/en/logstash/current/plugins-inputs-syslog.html | |
printf "Installing logstrash.." | |
name=logstash-6.3.2 | |
pkg="$name.tar.gz" | |
wget "https://artifacts.elastic.co/downloads/logstash/$pkg" | |
tar -xvzf $pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install pip installing | |
wget https://bootstrap.pypa.io/get-pip.py | |
sudo python get-pip.py | |
# Necessary gcc to install uwsgi | |
sudo apt-get install -y gcc git openssl | |
sudo pip install virtualenv | |
sudo apt-get install -y python3.5-dev python-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# iptables | |
printf "Installing iptables-persistent..." | |
sudo apt-get update | |
sudo apt-get install iptables-persistent | |
printf "Setting basic rules...\n" | |
# sudo iptables -I INPUT -p tcp -s 10.1.1.2 --dport 22 -j ACCEPT -m comment --comment "Filter traffic to specific ip address" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remote | |
user=username | |
host=192.168.2.2 | |
adduser $user | |
sudo usermod -aG sudo $user | |
# local | |
key_name=rsa | |
cd .ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validateEmail = (str) => { | |
var emailRe = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; | |
var arr = emailRe.exec(str) | |
if(arr && arr.length) { | |
return arr[0] | |
} | |
else return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib, sys | |
def main(argv): | |
try: | |
_str=str(argv[0]) | |
print(md5(_str)) | |
except: | |
print("Invalid string") | |