Skip to content

Instantly share code, notes, and snippets.

@DecentM
DecentM / cloudflare-ban.sh
Created January 25, 2016 12:53 — forked from bdtech/cloudflare-ban.sh
OSSEC active response to block an IP at the Cloudflare reverse proxy level who triggers errors in short time frame in nginx logs. Required: Ossec config: sample to block IPs with multiple 500 errors or 400 errors within a minute or two timeframe. /var/ossec/etc/ossec.conf <command> <name>cloudflare-ban</name> <executable>cloudflare-ban.sh</execu…
#!/bin/sh
# Adds an IP to Cloudflare IP block list
# Path: /var/ossec/active-response/bin/cloudflare-ban.sh
#
ACTION=$1
USER=$2
IP=$3
PWD=`pwd`
TKN='CF API KEY'
@DecentM
DecentM / alternatingrows.css
Last active July 31, 2016 17:30
Three alternating Bootstrap row pairs in emmet
((div.row.block-content>div.col-xs-12.col-md-6.col-lg-8.text-content>p{This is row $ on the left}^div.col-xs-12.col-md-6.col-lg-4.img-content>div.imgholder)+(div.row.block-content>div.col-xs-12.col-md-6.col-lg-8.col-md-push-6.col-lg-push-4.text-content>p{This is row $ on the right}^div.col-xs-12.col-md-6.col-lg-4.col-md-pull-6.col-lg-pull-8.img-content>div.imgholder))*3
((div.row.fixedbg>div.container>div.row.block-content>div.col-xs-12.col-md-6.col-lg-8.text-content>p{This is row $ on the left}^div.col-xs-12.col-md-6.col-lg-4.img-content>div.imgholder.staticbg)+(div.row.fixedbg>div.container>div.row.block-content>div.col-xs-12.col-md-6.col-lg-8.col-md-push-6.col-lg-push-4.text-content>p{This is row $ on the right}^div.col-xs-12.col-md-6.col-lg-4.col-md-pull-6.col-lg-pull-8.img-content>div.imgholder.staticbg))*3
@DecentM
DecentM / nginx.conf
Created August 25, 2016 20:47 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@DecentM
DecentM / keybase.md
Created September 20, 2016 18:17
Keybase proof

Keybase proof

I hereby claim:

  • I am decentm on github.
  • I am decentm (https://keybase.io/decentm) on keybase.
  • I have a public key ASA5d5PTvVJaZg4q3SGnnjq7KDvhNq08JP_KTLD_Q0DBRQo

To claim this, I am signing this object:

@DecentM
DecentM / material-userstyles-old.css
Last active December 18, 2016 01:28
This is the old version of my userstyle, Material Userstyles. This version is now under the Public Domain. Some amount of work is required to get it working.
@namespace url(http://www.w3.org/1999/xhtml);
/* Material Userstyles v1.0 by DecentM */
@-moz-document regexp("https?\:\/\/forum.userstyles.org.*") {
#advanced-search,
#advanced-search *,
#related,
#related li:not(.more),
#show-advanced-search,
#style-info,
@DecentM
DecentM / material-userstyles-v2.css
Last active December 18, 2016 01:51
The previuos version of my theme "Material Userstyles", now under the public domain. A bit of tweaking is required for it to be able to have custom colors.
@namespace url(http://www.w3.org/1999/xhtml);
/* Material Userstyles v2.0 by DecentM */
@-moz-document regexp("https?\:\/\/userstyles.org.*") {
/*!
* Bootstrap v4.0.0-alpha.4 (http://getbootstrap.com)
* Copyright 2011-2016 The Bootstrap Authors
* Copyright 2011-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*//*! normalize.css v4.0.0 | MIT License | github.com/necolas/normalize.css */ html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:ita
@DecentM
DecentM / vpn-lan.sh
Created August 23, 2017 19:23
Forward 10.20.0.0/16 from my VPN to LAN
iptables -I FORWARD -i tun0 -o enxb827ebf29db7 -s 10.8.0.0/24 -d 10.20.0.0/16 -m conntrack --ctstate NEW -j ACCEPT
iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -I POSTROUTING -o eth0 -s 10.8.0.0/24 -j MASQUERADE
@DecentM
DecentM / ouc-cla.md
Created January 4, 2018 11:28
OpenUserCSS CLA

OpenUserCSS Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by OpenUserCSS or its affiliates (“OpenUserCSS”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to OpenUserCSS in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact decentm+contrib@openusercss.org.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to OpenUserCS

@DecentM
DecentM / test.user.css
Created January 5, 2018 15:35
test.user.css
/* ==userstyle==
@name Title
@description <b>Bold</b> - Not bold
@version 0.0.1
@namespace https://openusercss.org/theme/5a4605de961b8c0b001f2476
@homepageURL https://openusercss.org/theme/5a4605de961b8c0b001f2476
@author Something
==/userstyle== */
@DecentM
DecentM / xvfb-run.sh
Created February 10, 2018 22:03 — forked from tyleramos/xvfb-run.sh
XVFB Run Bash script
#!/bin/sh
# $Id: xvfb-run 2027 2004-11-16 14:54:16Z branden $
# This script starts an instance of Xvfb, the "fake" X server, runs a command
# with that server available, and kills the X server when done. The return
# value of the command becomes the return value of this script, except in cases
# where this script encounters an error.
#
# If anyone is using this to build a Debian package, make sure the package