Skip to content

Instantly share code, notes, and snippets.

@icodus
icodus / iframe.html
Created October 31, 2020 00:59 — forked from cirocosta/iframe.html
Sending messages from child iframe to parent webpage
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>Botão</button>
<script type="text/javascript">
<!DOCTYPE html>
<html>
<head>
<title>Accordions</title>
<style type="text/css">
body {
margin: 0 auto;
max-width: 40em;
width: 88%;
@icodus
icodus / index.jsx
Created December 17, 2020 14:53 — forked from rhernandog/index.jsx
React & Recompose withProps - A simple example of using recompose's withProps
// styles for this are based on Bootstrap 3.3.7
import React, { Component } from "react";
import ReactDOM from "react-dom";
import { withProps } from "recompose";
const users = [
{ "name": "Homer Jay", "status": "pending" },
@icodus
icodus / index-cached.shtml
Created December 31, 2020 17:24 — forked from caquino/index-cached.shtml
Poors Main ESI
Cached: <!--# echo var="date_local" -->
@icodus
icodus / encrypted-session-nginx.php
Created February 27, 2021 02:01 — forked from siberex/encrypted-session-nginx.php
PHP encryption and decryption for Nginx Encrypted Session module
×××××××××××××××××××××××××××××××××××××
MOVED HERE:
https://github.com/siberex/RestyCrypt
×××××××××××××××××××××××××××××××××××××
<?php
/**
* Nginx Encrypted Session module
* Encryption and decryption with PHP
*
@icodus
icodus / encrypted-session-nginx.php
Created February 27, 2021 22:00 — forked from Alldebrid/encrypted-session-nginx.php
PHP encryption and decryption for Nginx Encrypted Session module
<?php
/**
* Nginx Encrypted Session module
* Encryption and decryption with PHP
*
* https://github.com/openresty/encrypted-session-nginx-module
*
*
* User: www.sib.li
* Date: 19.03.15
@icodus
icodus / certgen.sh
Created March 5, 2021 21:48 — forked from percybolmer/certgen.sh
Certificate generation script
#!/bin/bash
# generate ca.key
openssl genrsa -out ca.key 4096
# generate certificate
openssl req -new -x509 -key ca.key -sha256 -subj "/C=SE/ST=HL/O=Example, INC." -days 365 -out ca.cert
# generate the server key
openssl genrsa -out server.key 4096
# Generate the csr
openssl req -new -key server.key -out server.csr -config certificate.conf
@icodus
icodus / example.com.conf
Created March 14, 2021 02:25 — forked from a-vasyliev/example.com.conf
Nginx: proxy cache without utm_* parameters (remove query parameter, remove utm tags nginx)
server {
listen 443;
server_name example.com;
error_log /var/log/nginx/example_com_error.log warn;
ssl on;
ssl_certificate /etc/nginx/ssl/your.crt; #certificate chains
ssl_certificate_key /etc/nginx/ssl/your.key; #private key
@icodus
icodus / jenkins.js
Created March 16, 2021 19:03 — forked from atdt/jenkins.js
An implementation of Jenkins's one-at-a-time hash
// An implementation of Jenkins's one-at-a-time hash
// <http://en.wikipedia.org/wiki/Jenkins_hash_function>
function hashString(key) {
var hash = 0, i = key.length;
while (i--) {
hash += key.charCodeAt(i);
hash += (hash << 10);
hash ^= (hash >> 6);
}
@icodus
icodus / rule-24-ext-7g-context.conf
Last active March 25, 2021 23:46
7G bad request rule 24 pass images
if ( $request_uri ~* (/)((php|web)?shell|conf(ig)?|crossdomain|fileditor|locus7|nstview|php(get|remoteview|writer)|r57|remview|sshphp|storm7|webadmin)(.*)(\.)(svg|png|jpe?g) ) {
set $bad_request_7g 0${bad_request_7g};
}
if ( $bad_request_7g = 024 ){
set $bad_request_7g 0;
set $7g_drop_bad_request 0;
}