Skip to content

Instantly share code, notes, and snippets.

View ilatypov's full-sized avatar

Ilguiz [eel ghEEz] Latypov ilatypov

View GitHub Profile
@ilatypov
ilatypov / JavaScriptServlet
Created June 28, 2016 05:22
Changing CSRF Guard
/**
* The OWASP CSRFGuard Project, BSD License
* Eric Sheridan (eric@infraredsecurity.com), Copyright (c) 2011
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@ilatypov
ilatypov / t.sh
Created November 4, 2016 15:53
Demo the unstable bash 4.3.42 trap in the 64-bit Cygwin (cygwin1.dll of April 21, 2016, size 3539372) on Windows 7 Enterprise SP1
#! /bin/bash
set -e
function fun() {
echo fun called
}
trap '
err=$?
#!/usr/bin/env python
# vim: et:ts=4:sts=4:sw=4:fileencoding=utf-8
ur"""
A sample WSGI application.
http://lucumr.pocoo.org/2007/5/21/getting-started-with-wsgi/
"""
import urlparse
html_escape_table = {
#! /usr/bin/python
# This file can be executed by either the Cygwin (os.name == "posix") build or the Windows native (os.name == "nt") build of Python.
import sys
import os
if os.name == "nt":
if "TZ" in os.environ:
# Windows Python appears confused with the TZ variable
# as it sets time.timezone to 0, time.altzone to -3600 (-1 hr)
# in the presence of TZ="America/New_York".
@ilatypov
ilatypov / grc.ps1
Last active January 3, 2018 14:49
# Detect SSL certificate mismatch indicating either multiple hosts serving the
# same name with different certificates or middle boxes authorized by the local
# machine's software.
# Usage from CMD:
# powershell -noprofile -noninteractive "$VerbosePreference = 'Continue'; .\grc.ps1 www.example.com"
# Usage from Cygwin:
# powershell -noprofile -noninteractive '$VerbosePreference = "Continue"; .\grc.ps1 www.example.com'
// "the pattern will be applied at most n - 1 times,
// the array's length will be no greater than n,
// and the array's last entry will contain all input
// beyond the last matched delimiter"
// java_split("a=b=c", "=", 2) => ["a", "b=c"]
function java_split(s, sep, max_num_elements) {
// "stops when limit entries have been placed into the array"
// "a=b=c".split("=", 2) => ["a", "b"]
var p = s.split(sep, max_num_elements);
var stopped_length = p.reduce((acc, v) => acc + v.length + sep.length, 0);
// vim: et:ts=2:sts=2:sw=2:fileencoding=utf-8
// Usage:
// JAVA_HOME=c:/jdk8 gradle build
apply plugin: 'groovy'
repositories {
maven {
url "${artifactory_plugins_url}"
  • The public forum looks terrible and appears based on off-the-shelf circa 2005 technology with ugly difficulties so common in ways big corporation force their products.

  • Fortify SCA 18.10 and 18.11 fail to analyze CocoaPods projects in MacOS after tracking only the Pods project.

  • SCA produces meagre analyses of Javascript (NodeJS) projects.

  • This feedback form is broken, too.

#! /bin/bash
function usage() {
cat >&2 <<EOT
Usage:
$ $0 USER_ID [-a PREVIOUS_COMMENT_ID] [-l LIMIT] [-p] [TEST]
e.g,
$ $0 10556300003468 -a 9674100014926 "justin|wynne|liberal|putin|trump|russia|petersburg|moscow"
#! /usr/bin/env python
# vim: et:ts=4:sts=4:sw=4:fileencoding=utf-8
ur"""
Parse a date/time string.
Usage:
python {script} FORMAT DATE [LOCALE]
Example: