Skip to content

Instantly share code, notes, and snippets.

🤓

Lewis Cowles Lewiscowles1986

🤓
Block or report user

Report or block Lewiscowles1986

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active Nov 20, 2019
Raspberry Pi 3 access-point-setup
View rPi3-ap-setup.sh
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@Lewiscowles1986
Lewiscowles1986 / script.js
Last active Nov 10, 2019
Prev Next JS injection
View script.js
/*
* Used via https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld
* to embed JS in all web-pages that are compliant to enable keyboard-navigation of blog posts
*/
(function() {
window.addEventListener('keydown', function(e) {
switch(e.key) {
case 'Left': // IE11 BS
case 'ArrowLeft':
var link = document.querySelector('a[rel="prev"], .prev, #previtem');
View .bashrc
export EDITOR="code --wait"
# export EDITOR="codium --wait"
# export EDITOR="atom --wait"
# export EDITOR="nano --wait"
# export EDITOR="vi --wait"
# export EDITOR="sublime --wait"
@Lewiscowles1986
Lewiscowles1986 / rPi3-php7-setup.sh
Last active Nov 8, 2019
Raspberry Pi PHP7, Nginx 1.9 Installer
View rPi3-php7-setup.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
@Lewiscowles1986
Lewiscowles1986 / redirection.function.php
Last active Oct 24, 2019
PHP Redirect PHP, JS, HTML Meta Tag
View redirection.function.php
<?php
const OPTION_DEFAULTS = [
'lang' => 'en',
'meta' => true,
'js' => true,
'title' => 'Redirection notice',
'link_sentence' => 'If you are not redirected automatically, follow <a href="%s">%s</a>',
'link_label' => 'this link',
'head_extra' => '<link rel="stylesheet" href="/css/style.css" />',
@Lewiscowles1986
Lewiscowles1986 / ra-7601U-USB-build-inst.sh
Last active Sep 3, 2019
install ralink 7601U USB N+150 wireless driver (Ubuntu 14.04 or Kernel 3.13+)
View ra-7601U-USB-build-inst.sh
#!/bin/sh
#setup dependencies
sudo apt-get install --reinstall linux-headers-generic build-essential
#get patched drivers
wget http://www.lewiscowles.co.uk/dls/MT7601U-14.04-patched.tar -O - | tar -x
cd MT7601U-14.04-patched
# build and install
@Lewiscowles1986
Lewiscowles1986 / dh-diagram.svg
Last active Apr 27, 2019
SSH with asymmetric key UML Sequence
View dh-diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lewiscowles1986
Lewiscowles1986 / README.md
Last active Apr 17, 2019
Playstation 2 EU USB "The Buzz" controller
View README.md

"The Buzz" Playstation 2 EU USB controller

Using tool "Simple HID Write"

  • W: Write
  • R: Read
W 00 {FF} 00 00 00 // controller 1 red light activate
W 00 {00} 00 00 00 // controller 1 red light deactivate
@Lewiscowles1986
Lewiscowles1986 / script.js
Created May 20, 2018
Anonymous Upload images to Imgur V3 JS
View script.js
var ImgurAPIKey = 'YEAH-IM-NOT-GIVING-THAT';
window.addEventListener('paste', function(e) {
function eventPreventDefault(e) {
e.preventDefault();
}
function getClipboardData(e) {
return window.clipboardData || e.clipboardData;
}
@Lewiscowles1986
Lewiscowles1986 / README.md
Last active Mar 26, 2019
Replay against system to test stability
View README.md

Utility to replay HTTP requests on a service

This utility helps replay a statistically significant number of HTTP requests against a service (serially) which are enough to give significance to two-decimal places.

Usage

replay-http {url} [{headers_path} {payload_path} {http_method}]

Parameters

You can’t perform that action at this time.