Skip to content

Instantly share code, notes, and snippets.

View ebta's full-sized avatar

Ebta Setiawan ebta

View GitHub Profile
<?php
header('HTTP/1.1 403 Forbidden');
?>
<html>
<head>
<title>Congratulations! You have been DENIED access</title>
</head>
<body>
<font size="4">You have been denied access because of the following reasons:<br /><br />
1.) Too many failed login attempts, so you are likely brute forcing through logins.<br />
@ebta
ebta / filterArray.js
Last active October 14, 2019 08:30 — forked from jherax/filterArray.js
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects by custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {
@ebta
ebta / gist:37aab281e37c71810b6ef2f34cbe4cdf
Created August 13, 2020 07:49 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ebta
ebta / grayscale.md
Last active November 22, 2020 14:45 — forked from anderflash/grayscale.sh
Convert PDF to Grayscale using ghostscript

Install ghostscript from yout terminal : sudo apt install ghostscript, then create file, for example pdf2gray.sh and copy paste the script bellow. Add execution access using chmod +x pdf2gray.sh

#!/bin/bash

gs \
 -sOutputFile=$2 \
 -sDEVICE=pdfwrite \
 -sColorConversionStrategy=Gray \
 -dProcessColorModel=/DeviceGray \
 -dCompatibilityLevel=1.4 \

Create a Software RAID 1 setup for your 2-disk server on Ubuntu Server 20.04

Let's start with the basics: the official guide by Ubuntu (https://ubuntu.com/server/docs/installation-advanced) is outdated/wrong.

Now on to the solution:

  • Select "Custom storage layout" when you reach the storage step of the installer
  • If the disks have existing partitions, click on each disk under AVAILABLE DEVICES and then select REFORMAT. This will (temporarily) wipe out the partitions.
  • Now select the 1st disk to add as "boot" disk (same menu that had REFORMAT in).
  • Do the same with the 2nd disk.
@ebta
ebta / embedded-file-viewer.md
Last active March 26, 2024 06:43 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@ebta
ebta / server.conf
Created March 26, 2021 04:43 — forked from laurenorsini/server.conf
OpenVPN configuration for /etc/openvpn/server.conf
local 192.168.2.0 # SWAP THIS NUMBER WITH YOUR RASPBERRY PI IP ADDRESS
dev tun
proto udp #Some people prefer to use tcp. Don't change it if you don't know.
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Server.crt # SWAP WITH YOUR CRT NAME
key /etc/openvpn/easy-rsa/keys/Server.key # SWAP WITH YOUR KEY NAME
dh /etc/openvpn/easy-rsa/keys/dh1024.pem # If you changed to 2048, change that here!
server 10.8.0.0 255.255.255.0
# server and remote endpoints
@ebta
ebta / codeiginter-server-config.md
Created June 15, 2021 02:33 — forked from yidas/codeiginter-server-config.md
Codeigniter 3 server configuration for Nginx & Apache

Codeigniter 3 server configuration for Nginx & Apache

Web Server Site Configuration

Recommended Apache Configuration

Use the following configuration in Apache's httpd.conf file or within a virtual host configuration. Note that you should set DocumentRoot and ServerName fit to your environment:

@ebta
ebta / php-fpm-pools-optimize.md
Last active June 3, 2024 00:51 — forked from holmberd/php-pools.md
Adjusting (Optimizing) child processes for php fpm pools (Nginx) - PHP 7.4

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log