Skip to content

Instantly share code, notes, and snippets.

View juliojsb's full-sized avatar
:octocat:
Focusing

Jota juliojsb

:octocat:
Focusing
View GitHub Profile
@juliojsb
juliojsb / apache-modsecurity.conf
Last active August 29, 2015 14:27
Added regex "^.*\[client <HOST>\] ModSecurity:" to /etc/fail2ban/filter.d/apache-modsecurity.conf filters of fail2ban
# Fail2Ban apache-modsec filter
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# apache-common.local
before = apache-common.conf
[Definition]
@juliojsb
juliojsb / sources.list
Last active August 29, 2015 14:27
My sources.list file for Debian Jessie (stable)
# Debian main repos
deb http://ftp.es.debian.org/debian/ jessie main contrib non-free
deb-src http://ftp.es.debian.org/debian/ jessie main
# Debian security repos
deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free
# Debian jessie-updates, previously known as 'volatile'
deb http://ftp.es.debian.org/debian/ jessie-updates main contrib non-free
@juliojsb
juliojsb / apache-auth.conf
Created August 18, 2015 18:06
Added regex "^.*\[client <HOST>\:.*] AH01630: client denied by server configuration:" to /etc/fail2ban/filter.d/apache-auth.conf
# Fail2Ban apache-auth filter
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# apache-common.local
before = apache-common.conf
[Definition]
@juliojsb
juliojsb / robots.txt
Created August 23, 2015 12:21
Robots.txt file for my website (http://www.juliojosesanz.com/robots.txt) useful for other Wordpress sites
# ---------------------------------------------------
# CRAWLERS/BOTS NOT ALLOWED
# ---------------------------------------------------
# Digg Mirror (Blocks Digg crawler)
User-agent: duggmirror
Disallow: /
# Alexa archiver
User-agent: ia_archiver
@juliojsb
juliojsb / ejemplos_gzip_tar
Last active March 24, 2019 19:13
Ejemplos prácticos GZIP/TAR
#Comprimir un fichero access_log
gzip access_log
#Comprimir varios ficheros: access_log, error_log y ssl_access
gzip access_log error_log ssl_access
#Comprimir al máximo un fichero access_log (gzip admite 9 niveles de compresión)
@juliojsb
juliojsb / name_virtualhosting_apache
Last active November 29, 2015 13:52
An example of Name based Virtual Hosting in Apache
# Name based Virtual Hosting
Listen 80
# Site 1
<VirtualHost *:80>
DocumentRoot "/var/www/html/site1"
ServerName www.site1.com
</VirtualHost>
# Site 2
@juliojsb
juliojsb / port_virtualhosting_apache
Created November 29, 2015 13:52
An example of port based Virtual Hosting in Apache
# VirtualHosting based on ports
Listen 80
Listen 81
Listen 82
Listen 83
# Site 1
<VirtualHost *:80>
DocumentRoot "/var/www/html/site1"
ServerName www.site1.com
</VirtualHost>
@juliojsb
juliojsb / ip_virtualhosting_apache
Created November 29, 2015 13:54
An example of IP based Virtual Hosting in Apache
# VirtualHosting based on IP
Listen 80
# Site 1
<VirtualHost 192.168.2.101:80>
DocumentRoot "/var/www/html/site1"
ServerName www.site1.com
</VirtualHost>
@juliojsb
juliojsb / standalone-ha.xml
Created January 18, 2016 19:39
Jboss AS 7.X/6.X EAP TCP Cluster example
In standalone-ha.xml:
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
<stack name="udp">
...
</stack>
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
<protocol type="TCPPING">
<property name="initial_hosts">192.168.2.101[7600],192.168.2.102[7600]</property>
@juliojsb
juliojsb / dont_show_pass_typing.sh
Created March 2, 2016 18:44
Read password variable in bash without showing the typing in the terminal
#!/bin/bash
# Read password from terminal without showing it
# read -s disables echo
echo -n "Enter your password: "
read -s password
# Show the password
echo -e "\nThe password you entered before -> $password"