This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
cloneElement, | |
useState, | |
useEffect, | |
useRef, | |
HTMLAttributes, | |
ReactElement | |
} from "react"; | |
//////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// XPath CheatSheet | |
// To test XPath in your Chrome Debugger: $x('/html/body') | |
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/ | |
// 0. XPath Examples. | |
// More: http://xpath.alephzarro.com/content/cheatsheet.html | |
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for nginx: location ~ ^/wp-json/ { return 404; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Something like this: | |
+----------+ +-----------+ | |
| |+----SSH+-->| | | |
| A | | B | | |
|+--------+| | | | |
Internet <-++-+PROXY<++<SSH Tunnel--+ | | |
|+--------+| | | | |
+----------+ +-----------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failed attempts by username: | |
grep "Invalid user " /var/log/auth.log | cut -d' ' -f8 | awk '{a[$0]++}END{for(i in a)print i,a[i]}' | sort -k 2 -n -r | head -n 100 | |
IP address of each attempt: | |
grep "Invalid user " /var/log/auth.log | cut -d' ' -f10 | awk '{a[$0]++}END{for(i in a)print i,a[i]}' | sort -k 2 -n -r | head -n 100 | |
Filter for brute-force interactive SSH logins: | |
grep sshd.\*Failed /var/log/auth.log | less | |
Look for failed connections (i.e. no login attempted, could be a port scanner, etc.): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
let gamepad = null; | |
let loopInterval = null; | |
window.addEventListener("gamepadconnected", connectHandler); | |
window.addEventListener("gamepaddisconnected", disconnectHandler); | |
function connectHandler(e) { | |
if (!gamepad) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* right click on an entry in the network log, select Copy All as Har | |
* type in console: x = [paste] | |
* paste the following JS code into the console | |
* copy the output, paste into a file | |
* then wget -i [that file] | |
*/ | |
(function(logObj, mime) { | |
var results = []; | |
logObj.log.entries.forEach(function (entry) { | |
if (mime && entry.response.content.mimeType !== mime) return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var selector = 'img' // Replace this with the selector for the element you want to make transformable | |
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() { | |
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() { | |
(function() { | |
var $, applyTransform, getTransform, makeTransformable; | |
$ = jQuery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSBin: http://jsbin.com/kekoli/edit?js,console | |
import {observable, observe} from "mobx"; | |
const person = observable({ | |
firstName: "Maarten", | |
lastName: "Luther" | |
}); | |
const disposer = observe(person, (change) => { | |
console.log(`${change.type} '${change.name}' from '${change.oldValue}' to '${change.object[change.name]}'`); |