-
name of the current banch and nothing else (for automation)
git rev-parse --abbrev-ref HEAD
-
all commits that your branch have that are not yet in master
git log master..<HERE_COMES_YOUR_BRANCH_NAME>
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
[global] | |
; Override default pid file | |
pid = /run/php-fpm.pid | |
; Avoid logs being sent to syslog | |
error_log = /proc/self/fd/2 | |
[www] | |
; Access from webserver container is via network, not socket file | |
listen = [::]:9000 |
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
Something like this: | |
+----------+ +-----------+ | |
| |+----SSH+-->| | | |
| A | | B | | |
|+--------+| | | | |
Internet <-++-+PROXY<++<SSH Tunnel--+ | | |
|+--------+| | | | |
+----------+ +-----------+ |
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
---------------------------------------- | |
Setup Install HAProxy 1.8 on Ubuntu 16 | |
---------------------------------------- | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:vbernat/haproxy-1.8 | |
sudo apt-get update | |
apt-cache policy haproxy | |
sudo apt install haproxy | |
sudo update-rc.d haproxy enable |
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
image: golang:latest | |
variables: | |
REPO_NAME: gitlab.com/***/*** | |
before_script: | |
- go version | |
- echo $CI_BUILD_REF | |
- echo $CI_PROJECT_DIR |
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
Failed attempts by username: | |
grep "Invalid user " /var/log/auth.log | cut -d' ' -f8 | awk '{a[$0]++}END{for(i in a)print i,a[i]}' | sort -k 2 -n -r | head -n 100 | |
IP address of each attempt: | |
grep "Invalid user " /var/log/auth.log | cut -d' ' -f10 | awk '{a[$0]++}END{for(i in a)print i,a[i]}' | sort -k 2 -n -r | head -n 100 | |
Filter for brute-force interactive SSH logins: | |
grep sshd.\*Failed /var/log/auth.log | less | |
Look for failed connections (i.e. no login attempted, could be a port scanner, etc.): |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<zabbix_export> | |
<date>2017-02-16T10:30:20Z</date> | |
<graphs> | |
<graph> | |
<graph_items> | |
<graph_item> | |
<calc_fnc>2</calc_fnc> | |
<color>157419</color> | |
<drawtype>1</drawtype> |
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
/* | |
Mohammad Shafiee | |
Parsian Business Accelerator | |
www.parsian.ac | |
muhammad.shafiee-at-gmail.com | |
*/ | |
package data | |
import ( |
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
sudo apt-get install mysql-server | |
sudo mysql_secure_installation | |
CREATE DATABASE mail; | |
GRANT SELECT ON mail.* TO 'mail'@'localhost' IDENTIFIED BY 'mailpassword'; | |
FLUSH PRIVILEGES; | |
USE mail; | |
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
Let's Encrypt: | |
sudo apt install git bc nginx | |
sudo git clone https://github.com/certbot/certbot.git /opt/letsencrypt | |
Automatic renewal: | |
sudo crontab -e | |
30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log | |
35 2 * * 1 /etc/init.d/nginx reload | |
To sign certificates, the Let's Encrypt API needs to verify that you own the domain for the certificate. |