This file contains hidden or 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
# RHEL based | |
yum install gcc make pam-devel | |
# Debian Based | |
apt-get install build-essential make libpam0g-dev libpam0g; LDFLAGS="-lpam" | |
version=1.0 | |
mkdir ${HOME}/tmp | |
cd ${HOME}/tmp |
This file contains hidden or 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
# Reference: http://blog.gurudelleccelsopicco.org/2009/09/online-lun-expansion-and-partition-resizing-without-reboot-under-linux/ | |
echo 1 > /sys/block/[DEVICE]/device/rescan | |
# DETECT IF NEW DISKS ARE ATTACHED TO THE HOST | |
# Reference: http://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.html | |
ls /sys/class/scsi_host |
This file contains hidden or 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
# Enable the PageUp and PageDown to search history commands | |
$EDITOR /etc/inputrc | |
"\e[5~": history-search-backward | |
"\e[6~": history-search-forward | |
# Enable the autocomplete using case INsentitive | |
echo 'set show-all-if-ambiguous on' >> ~/.inputrc | |
echo 'set completion-ignore-case on' >> ~/.inputrc |
This file contains hidden or 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
# The lines bellow set the Gitlab to work with SELinux | |
# As the Documentation Says: DO NOT DISABLE SELinux, just adjust it! | |
# Tips taken from: https://gitlab.com/gitlab-org/gitlab-recipes/blob/master/web-server/apache/README.md | |
setsebool -P httpd_can_network_connect on | |
setsebool -P httpd_can_network_relay on | |
setsebool -P httpd_enable_homedirs on | |
setsebool -P httpd_read_user_content on | |
semanage fcontext -a -t user_home_dir_t '/home/git(/.*)?' | |
semanage fcontext -a -t ssh_home_t '/home/git/.ssh(/.*)?' |
This file contains hidden or 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
# This rule, block one IP for 5 minutes, that is trying to connect to SSH port more than 3 times. | |
# ideal to block Brute Force Attacks | |
iptables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --set | |
iptables -I INPUT -p tcp --dport 22 -m state --state NEW -m recent --update --seconds 300 --hitcount 3 -j DROP |
This file contains hidden or 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
PACKAGE=awstats | |
# RedHat Like | |
yum deplist $PACKAGE | grep provider | awk '{print $2}' | sort | uniq | grep -v $PACKAGE | sed ':a;N;$!ba;s/\n/ /g' | xargs yum -y install | |
# Debian like | |
apt-get build-dep $PACKAGE |
This file contains hidden or 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
#!/bin/bash | |
HTTPADDR=http://acraiz.icpbrasil.gov.br/credenciadas/CertificadosAC-ICP-Brasil/ACcompactado.zip | |
DEST=/etc/ssl/certs/icp-brasil | |
mkdir -p ${DEST} | |
cd ${DEST} | |
rm -f *.crt | |
rm -f *.zip |
This file contains hidden or 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
<?php | |
if ($_SESSION['OCS']['cnx_origine'] == "LOCAL"){ | |
$name_field[]="PASSWORD"; | |
$type_field[]=4; // Changed from '0' to '4' to mask the input field | |
$tab_name[]=$l->g(217).":"; | |
$value_field[]=$protectedPost['PASSWORD']; | |
} |
This file contains hidden or 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
<VirtualHost *:80> | |
ServerName git.domain.com | |
# Point this to your public folder of teambox | |
DocumentRoot /home/gitlab/gitlab | |
RewriteEngine On | |
<Proxy balancer://unicornservers> | |
BalancerMember http://127.0.0.1:8080 |
This file contains hidden or 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
# Changes in apache | |
<VirtualHost *:443> | |
ServerName git.server.com.br | |
ServerSignature Off | |
SSLEngine On | |
SSLProxyEngine On | |
SSLCertificateFile /etc/pki/tls/certs/localhost.crt | |
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key |