Skip to content

Instantly share code, notes, and snippets.

View hypertexthero's full-sized avatar

Simon Griffee hypertexthero

View GitHub Profile

Recon and Attack Vectors from My Logs

This document contains excerpts from my web server logs collected over a period of 7 years that shows various kinds of recon and attack vectors.

There were a total of 37.2 million lines of logs out of which 1.1 million unique HTTP requests (Method + URI) were found.

$ sed 's/^.* - - \[.*\] "\(.*\) HTTP\/.*" .*/\1/' access.log > requests.txt
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@dwightgunning
dwightgunning / template_tags.py
Created February 18, 2016 00:55
[Cactus] Revised 'static' template that supports a 'static-url' config key to enable an external static url
#coding:utf-8
import os
import logging
from django.template.base import Library
from django.conf import settings
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
logger = logging.getLogger(__name__)
@jarmitage
jarmitage / himawari-8.py
Last active March 5, 2018 09:21
Himawari-8 Wallpaper Bot: Fresh images of the whole Earth from space, every 10 minutes
import urllib
import datetime as dt
import pytz
from PIL import Image
import numpy as np
import subprocess
import socket
import os
dir = '/FULL/PATH/TO/SCRIPT/DIR'
@Two9A
Two9A / starfield.html
Created April 19, 2015 16:45
The simplest star field you'll ever find
<title>Starfield</title>
<script>
addEventListener('load', function() {
var stars = [];
var ctx = field.getContext('2d');
var gen = function(z) {
return {
x: 0 | (Math.random() * 800 - 400),
y: 0 | (Math.random() * 600 - 300),
z: z || (0 | Math.random() * 15)
@moomoohk
moomoohk / generate_build.py
Created April 7, 2015 12:55
Cactus (http://cactusformac.com/) plugin that generates an external build folder that doesn't overwrite your git files. Perfect for usage with GitHub pages, just stick your .git in the generated build folder.
import distutils.dir_util
import shutil
import os
def copytree(src, dst):
for item in os.listdir(src):
s, d = os.path.join(src, item), os.path.join(dst, item)
if os.path.isdir(s):
shutil.copytree(s, d, False, None)
else:
@fizerkhan
fizerkhan / contact-form-servlet
Last active May 12, 2020 09:55
Google App Engine Servlet for Contact form
String name = req.getParameter("name");
String email = req.getParameter("email");
String message = req.getParameter("message");
// Create Mail message
Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("support@acme.com",
"Acme Support Team"));
@Kniyl
Kniyl / admin.py
Last active August 29, 2015 14:00
reusable django app to create django-modeltranslation fields into mezzanine models
from copy import deepcopy
from django.contrib import admin
from django.utils.translation import activate, get_language
from modeltranslation.admin import TranslationAdmin, TranslationTabularInline
from mezzanine.conf import settings
from mezzanine.core.admin import TabularDynamicInlineAdmin
applications = settings.INSTALLED_APPS
def save_obj_for_every_language(obj):
"""
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@lelandbatey
lelandbatey / ytwatch.sh
Last active December 29, 2015 01:38
ytwatch.sh - For when you don't want to deal with the Youtube interface. Script to automatically download a Youtube video then open it in VLC media player.
#!/bin/bash
#This requires:
# youtube-dl (pip install youtube-dl)
# vlc (sudo apt-get install vlc)
#
# Usage:
#
# ytwatch http://www.youtube.com/watch?v=dMH0bHeiRNg
#