Init commit

This commit is contained in:
Tanguy MAZE
2018-12-02 18:33:00 +01:00
commit ce8e53b809
13 changed files with 750 additions and 0 deletions

26
files/check_crontab Normal file
View File

@@ -0,0 +1,26 @@
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.ZZlmiC/crontab installed on Fri Nov 16 14:56:13 2018)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
00 0 * * * root /usr/sbin/check_crontab.sh

23
files/default-ssl.conf Normal file
View File

@@ -0,0 +1,23 @@
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin tmaze@student.42.fr
DocumentRoot /var/www/nice_website
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /home/tanguy/.ssl/server.crt
SSLCertificateKeyFile /home/tanguy/.ssl/server.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>

19
files/firewall.conf Normal file
View File

@@ -0,0 +1,19 @@
# Generated by iptables-save v1.6.0 on Sat Nov 17 14:32:27 2018
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
-A INPUT -p tcp -m tcp --dport 2230 -j ACCEPT
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --sport 80 -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --sport 443 -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A INPUT -p udp -m udp --sport 53 -m conntrack --ctstate ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport 2230 -j ACCEPT
-A OUTPUT -p tcp --sport 80 -j ACCEPT
-A OUTPUT -p tcp --sport 443 -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p tcp -m tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
COMMIT
# Completed on Sat Nov 17 14:32:27 2018

25
files/interfaces Normal file
View File

@@ -0,0 +1,25 @@
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
allow-hotplug enp0s3
iface enp0s3 inet static
address 172.127.0.130
netmask 255.255.255.252
gateway 172.127.0.129
# The internal network interface
auto enp0s8
allow-hotplug enp0s8
iface enp0s8 inet static
address 192.168.99.2
netmask 255.255.255.252
gateway 192.168.99.1

23
files/nice_website.conf Normal file
View File

@@ -0,0 +1,23 @@
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin tmaze@student.42.fr
DocumentRoot /var/www/nice_website
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /home/tanguy/.ssl/server.crt
SSLCertificateKeyFile /home/tanguy/.ssl/server.key
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>

49
files/rg1.yml Normal file
View File

@@ -0,0 +1,49 @@
# **************************************************************************** #
# #
# ::: :::::::: #
# rg1.yml :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/11/30 13:12:56 by tmaze #+# #+# #
# Updated: 2018/11/30 15:31:13 by tmaze ### ########.fr #
# #
# **************************************************************************** #
- hosts: roger-skyline-1
tasks:
- name: Install all necessary packages
apt:
update_cache=yes
state=latest
name={{item}}
with_items:
- sudo
- mail
- git
- fail2ban
- apache2
become: yes
become_method: su
tags:
- sudo
- name: Make sure we have a 'sudo' group
group:
name=sudo
state=present
become: yes
become_method: su
tags:
- sudo
- name: Add user tanguy to sudoers
user:
name=tanguy
groups=sudo
append=yes
become: yes
become_method: su
tags:
- sudo

123
files/sshd_config Normal file
View File

@@ -0,0 +1,123 @@
# $OpenBSD: sshd_config,v 1.100 2016/08/15 12:32:04 naddy Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
Port 2230
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
#AuthorizedPrincipalsFile none
#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication. Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
PrintMotd no
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

31
files/update_script Normal file
View File

@@ -0,0 +1,31 @@
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.ZZlmiC/crontab installed on Fri Nov 16 14:56:13 2018)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow command
00 4 * * * root /usr/sbin/update_script.sh
@reboot root /usr/sbin/update_script.sh

337
files/website.html Normal file
View File

@@ -0,0 +1,337 @@
<!doctype html>
<html lang="en">
<head>
<title>A Nice Website</title>
<!-- 2018-11-27 Tue 18:44 -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Org-mode">
<meta name="author" content="tmaze">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script>
<style type="text/css">
/* org mode styles on top of twbs */
html {
position: relative;
min-height: 100%;
}
body {
font-size: 18px;
margin-bottom: 105px;
}
footer {
position: absolute;
bottom: 0;
width: 100%;
height: 101px;
background-color: #f5f5f5;
}
footer > div {
padding: 10px;
}
footer p {
margin: 0 0 5px;
text-align: center;
font-size: 16px;
}
#table-of-contents {
margin-top: 20px;
margin-bottom: 20px;
}
blockquote p {
font-size: 18px;
}
pre {
font-size: 16px;
}
.footpara {
display: inline-block;
}
figcaption {
font-size: 16px;
color: #666;
font-style: italic;
padding-bottom: 15px;
}
/* from twbs docs */
.bs-docs-sidebar.affix {
position: static;
}
@media (min-width: 768px) {
.bs-docs-sidebar {
padding-left: 20px;
}
}
/* All levels of nav */
.bs-docs-sidebar .nav > li > a {
display: block;
padding: 4px 20px;
font-size: 14px;
font-weight: 500;
color: #999;
}
.bs-docs-sidebar .nav > li > a:hover,
.bs-docs-sidebar .nav > li > a:focus {
padding-left: 19px;
color: #A1283B;
text-decoration: none;
background-color: transparent;
border-left: 1px solid #A1283B;
}
.bs-docs-sidebar .nav > .active > a,
.bs-docs-sidebar .nav > .active:hover > a,
.bs-docs-sidebar .nav > .active:focus > a {
padding-left: 18px;
font-weight: bold;
color: #A1283B;
background-color: transparent;
border-left: 2px solid #A1283B;
}
/* Nav: second level (shown on .active) */
.bs-docs-sidebar .nav .nav {
display: none; /* Hide by default, but at >768px, show it */
padding-bottom: 10px;
}
.bs-docs-sidebar .nav .nav > li > a {
padding-top: 1px;
padding-bottom: 1px;
padding-left: 30px;
font-size: 12px;
font-weight: normal;
}
.bs-docs-sidebar .nav .nav > li > a:hover,
.bs-docs-sidebar .nav .nav > li > a:focus {
padding-left: 29px;
}
.bs-docs-sidebar .nav .nav > .active > a,
.bs-docs-sidebar .nav .nav > .active:hover > a,
.bs-docs-sidebar .nav .nav > .active:focus > a {
padding-left: 28px;
font-weight: 500;
}
/* Nav: third level (shown on .active) */
.bs-docs-sidebar .nav .nav .nav {
padding-bottom: 10px;
}
.bs-docs-sidebar .nav .nav .nav > li > a {
padding-top: 1px;
padding-bottom: 1px;
padding-left: 40px;
font-size: 12px;
font-weight: normal;
}
.bs-docs-sidebar .nav .nav .nav > li > a:hover,
.bs-docs-sidebar .nav .nav .nav > li > a:focus {
padding-left: 39px;
}
.bs-docs-sidebar .nav .nav .nav > .active > a,
.bs-docs-sidebar .nav .nav .nav > .active:hover > a,
.bs-docs-sidebar .nav .nav .nav > .active:focus > a {
padding-left: 38px;
font-weight: 500;
}
/* Show and affix the side nav when space allows it */
@media (min-width: 992px) {
.bs-docs-sidebar .nav > .active > ul {
display: block;
}
/* Widen the fixed sidebar */
.bs-docs-sidebar.affix,
.bs-docs-sidebar.affix-bottom {
width: 213px;
}
.bs-docs-sidebar.affix {
position: fixed; /* Undo the static from mobile first approach */
top: 20px;
}
.bs-docs-sidebar.affix-bottom {
position: absolute; /* Undo the static from mobile first approach */
}
.bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
margin-top: 0;
margin-bottom: 0
}
}
@media (min-width: 1200px) {
/* Widen the fixed sidebar again */
.bs-docs-sidebar.affix-bottom,
.bs-docs-sidebar.affix {
width: 263px;
}
}
</style>
<script type="text/javascript">
$(function() {
'use strict';
$('.bs-docs-sidebar li').first().addClass('active');
$(document.body).scrollspy({target: '.bs-docs-sidebar'});
$('.bs-docs-sidebar').affix();
});
</script>
</head>
<body>
<div id="content" class="container">
<div class="row"><div class="col-md-12"><h1 class="title">A Nice Website</h1>
<div id="outline-container-sec-1" class="outline-2">
<h2 id="sec-1">Why this website ?</h2>
<div class="outline-text-2" id="text-1">
<p>
Because of the <code>roger-skyline-1</code> project of École 42 Paris.
</p>
</div>
</div>
<div id="outline-container-sec-2" class="outline-2">
<h2 id="sec-2">How it's made</h2>
<div class="outline-text-2" id="text-2">
<p>
This website was done in Emacs using <a href="http://orgmode.org/en/">Org-mode</a>, a strong tool that let you type
your document as you please and typeset it auto-magically via multiple export
options (this file was exported to twitter bootstrap).
</p>
<p>
Its capabilities extend but are not limited to:
</p>
<ul class="org-ul">
<li>easily formated tables and spredsheets
</li>
<li>TODO lists
</li>
<li>Calendar integration for deadlines, etc&#x2026;
</li>
<li>Multiple export modules (like ODT, HTML, Twitter Bootstrap and LaTeX)
</li>
<li>Code Snippet typesetting
</li>
<li>Lists &amp; CheckLists
</li>
</ul>
</div>
</div>
<div id="outline-container-sec-3" class="outline-2">
<h2 id="sec-3">Support</h2>
<div class="outline-text-2" id="text-3">
</div><div id="outline-container-sec-3-1" class="outline-3">
<h3 id="sec-3-1">Text editor</h3>
<div class="outline-text-3" id="text-3-1">
<table class="table table-striped table-bordered table-hover table-condensed">
<colgroup>
<col class="left">
<col class="left">
<col class="left">
<col class="left">
<col class="left">
</colgroup>
<thead>
<tr>
<th scope="col" class="text-left">&#xa0;</th>
<th scope="col" class="text-left">emacs</th>
<th scope="col" class="text-left">vim</th>
<th scope="col" class="text-left">atom</th>
<th scope="col" class="text-left">vs-code</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left">Has Org-mode ?</td>
<td class="text-left">natively</td>
<td class="text-left">with <a href="https://github.com/jceb/vim-orgmode">this</a></td>
<td class="text-left">with <a href="https://atom.io/packages/org-mode">this</a></td>
<td class="text-left">with <a href="https://github.com/vscode-org-mode/vscode-org-mode">this</a></td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="outline-container-sec-3-2" class="outline-3">
<h3 id="sec-3-2">Git repository manager</h3>
<div class="outline-text-3" id="text-3-2">
<table class="table table-striped table-bordered table-hover table-condensed">
<colgroup>
<col class="left">
<col class="left">
<col class="left">
</colgroup>
<thead>
<tr>
<th scope="col" class="text-left">&#xa0;</th>
<th scope="col" class="text-left">GitHub</th>
<th scope="col" class="text-left">Gitlab</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-left">README</td>
<td class="text-left"></td>
<td class="text-left"></td>
</tr>
<tr>
<td class="text-left">wiki</td>
<td class="text-left"></td>
<td class="text-left"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="outline-container-sec-4" class="outline-2">
<h2 id="sec-4">Further documentation</h2>
<div class="outline-text-2" id="text-4">
<ul class="org-ul">
<li><a href="https://youtu.be/SzA2YODtgK4"><i>Getting Started with Org-Mode</i>, Harry Schwartz</a>
</li>
<li><a href="https://youtu.be/oJTwQvgfgMM"><i>Emacs Org-mode - a system for note-taking and project planning</i>, Carsten Dominik</a>
</li>
<li><a href="http://orgmode.org/en/">Org-mode website</a>
</li>
<li><a href="https://gist.github.com/tvdu29/64c46349d214e74c71f2a2f0121707a9">This page's source code</a>
</li>
</ul>
</div>
</div>
</div></div></div>
<footer id="postamble" class="">
<div><p class="author">Author: tmaze</p>
<p class="date">Created: 2018-11-27 Tue 18:44</p>
<p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 26.1 (<a href="http://orgmode.org">Org-mode</a> 9.1.9)</p>
</div>
</footer>
</body>
</html>

50
files/website.org Normal file
View File

@@ -0,0 +1,50 @@
# **************************************************************************** #
# #
# ::: :::::::: #
# website.org :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/11/23 16:49:24 by tmaze #+# #+# #
# Updated: 2018/11/27 18:48:06 by tmaze ### ########.fr #
# #
# **************************************************************************** #
#+TITLE: A Nice Website
#+AUTHOR: tmaze
#+OPTIONS: whn:nil toc:nil
** Why this website ?
Because of the =roger-skyline-1= project of École 42 Paris.
** How it's made
This website was done in Emacs using [[http://orgmode.org/en/][Org-mode]], a strong tool that let you type
your document as you please and typeset it auto-magically via multiple export
options (this file was exported to twitter bootstrap).
Its capabilities extend but are not limited to:
* easily formated tables and spredsheets
* TODO lists
* Calendar integration for deadlines, etc...
* Multiple export modules (like ODT, HTML, Twitter Bootstrap and LaTeX)
* Code Snippet typesetting
* Lists & CheckLists
** Support
*** Text editor
| | emacs | vim | atom | vs-code |
|----------------+----------+-----------+-----------+-----------|
| Has Org-mode ? | natively | with [[https://github.com/jceb/vim-orgmode][this]] | with [[https://atom.io/packages/org-mode][this]] | with [[https://github.com/vscode-org-mode/vscode-org-mode][this]] |
*** Git repository manager
| | GitHub | Gitlab |
|--------+--------+--------|
| README | ✓ | ✓ |
| wiki | ✓ | ✗ |
** Further documentation
- [[https://youtu.be/SzA2YODtgK4][/Getting Started with Org-Mode/, Harry Schwartz]]
- [[https://youtu.be/oJTwQvgfgMM][/Emacs Org-mode - a system for note-taking and project planning/, Carsten Dominik]]
- [[http://orgmode.org/en/][Org-mode website]]
- [[https://gist.github.com/tvdu29/64c46349d214e74c71f2a2f0121707a9][This page's source code]]