Skip to content

Instantly share code, notes, and snippets.

View samsulmaarif's full-sized avatar

Samsul Ma'arif samsulmaarif

View GitHub Profile
@samsulmaarif
samsulmaarif / jenkins.conf
Created September 7, 2018 03:11
Jenkins behind nginx reverse proxy
server {
listen 80;
server_name jenkins.samsul.web.id;
return 301 https://$host$request_uri;
}
server {
listen 80;
server_name jenkins.samsul.web.id;
@samsulmaarif
samsulmaarif / .htaccess
Created October 2, 2018 11:47 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
from bottle import Bottle,route,run
from bottle import get, post, request
app = Bottle()
usernames = ["username", "user"]
passwords = ["password", "pass"]
def check_login(username, password):
if username in usernames and password in passwords:
return True

Moodle

MOODLE (singkatan dari Modular Object-Oriented Dynamic Learning Environment) adalah paket perangkat lunak yang diproduksi untuk kegiatan belajar berbasis internet dan situs web yang menggunakan prinsip social constructionist pedagogy.

Hardware Requirement

  • Disk space: 200MB for the Moodle code, plus as much as you need to store content. 5GB is probably a realistic minimum.
  • Processor: 1GHz (min), 2GHz dual core or more recommended.
  • Memory: 512MB (min), 1GB or more is recommended. 8GB plus is likely on a large production server
  • Consider separate servers for the web "front ends" and the database. It is much easier to "tune"
Day 1 :
- Berkenalan dengan GNU/Linux
- Instalasi (Demo)
- Linux Basic
- basic command
- vim text edirot
- change hostname
- search with find command
- compress file
#!/bin/bash
#
# DOT Indonesia - dot.co.id
# Daily backup Script
# Samsul Ma'arif <mail@samsul.web.id>
#
#set -x
TODAY=`date +"%Y-%m-%d"`
@samsulmaarif
samsulmaarif / vhost_ssl.conf
Created November 16, 2018 03:19
Addition config for apache/httpd security headers
SSLCertificateChainFile /etc/ssl/klien/klien-intermediate.crt
#Header set Set-Cookie HttpOnly;Secure
Header always edit Set-Cookie (.*) "$1;HttpOnly;Secure"
Header always set X-XSS-Protection "1; mode=block"
Header always set x-Frame-Options "SAMEORIGIN"
Header always set X-Content-Type-Options "nosniff"
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
Header always set Content-Security-Policy "default-src 'self' https://static.zdassets.com https://ekr.zdassets.com https://*.zopim.com wss://*.zopim.com https://*.zopim.org https://*.zopim.io; font-src 'self' data: https://*.zopim.com https://fonts.gstatic.com ; img-src 'self' data: https://*.zopim.com https://www.google-analytics.com https://*.zopim.io https://stats.g.doubleclick.net http://*.klien.co.id; script-src * https://static.zdassets.com https://ekr.zdassets.com https://*.zopim.com wss://*.zopim.com https://*.zopim.org https://*.zopim.io https://www.googletagmanager.com www.google-analytics.com 'unsafe-inline' 'unsafe
@samsulmaarif
samsulmaarif / docker-clean.sh
Created December 17, 2018 15:56
Cleaning Up Docker stuff (image, volume, container)
#!/bin/bash
#docker ps -a | awk -F' ' '{print $1}' | grep -v CONTAINER | xargs docker rm
docker ps --all -q -f status=exited | xargs docker rm
docker images | awk -F' ' '{print $3}' | xargs docker rmi
docker volume ls -qf dangling=true | xargs -r docker volume rm
@samsulmaarif
samsulmaarif / snmpd.conf
Last active January 4, 2019 06:59
SNMP agent for local device
###############################################################################
#
# EXAMPLE.conf:
# An example configuration file for configuring the Net-SNMP agent ('snmpd')
# See the 'snmpd.conf(5)' man page for details
#
# Some entries are deliberately commented out, and will need to be explicitly activated
#
###############################################################################
#
@samsulmaarif
samsulmaarif / swarm.yml
Created January 28, 2019 16:37 — forked from MetalArend/swarm.yml
Run a GitLab Runner on your Swarm
version: '3.4'
secrets:
# Find your registration token at: "Your project" > "Settings" > "CI/CD" > "Runners settings" > "Specific Runners" (look for registration token)
# Register it as `GITLAB_REGISTRATION_TOKEN`: `docker secret create GITLAB_REGISTRATION_TOKEN YOUR_REGISTRATION_TOKEN`
GITLAB_REGISTRATION_TOKEN:
external: true
# Find your personal access token at: "Your user account" > "Settings" > "Access Tokens" > "Create personal access token" (for api)
# Register it as `GITLAB_PERSONAL_ACCESS_TOKEN`: `docker secret create GITLAB_PERSONAL_ACCESS_TOKEN <YOUR ACCESS TOKEN>`