Skip to content

Instantly share code, notes, and snippets.

@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@jakebathman
jakebathman / logslaravel.sh
Created August 19, 2018 00:06
Tail Laravel logs and filter out the stack traces
tail -f -n 450 storage/logs/laravel*.log \
| grep -i -E \
"^\[\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}:\d{2}\]|Next [\w\W]+?\:" \
--color
@flowchartsman
flowchartsman / kali_osx_persistence_wifi.md
Last active June 14, 2023 13:00 — forked from widdowquinn/kali_osx_persistence_wifi.md
Kali Linux Live USB with encrypted persistence and wireless on Macbook Pro/Air without networking.

Kali Linux Bootable USB with Persistence and Wireless on OSX

Tutorials for running live Kali on OSX often require you have networking on your laptop to apt install the drivers, but without an ethernet adapter you're not going to be able to do that, so this tutorial will cover a method of doing this manually, using another thumbdrive or external data source.

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP.

@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@loilo
loilo / magic-methods.js
Last active April 25, 2024 13:58
PHP Magic Methods in JavaScript
function magicMethods (clazz) {
// A toggle switch for the __isset method
// Needed to control "prop in instance" inside of getters
let issetEnabled = true
const classHandler = Object.create(null)
// Trap for class instantiation
classHandler.construct = (target, args, receiver) => {
// Wrapped class instance
@Zenexer
Zenexer / escapeshellrce.md
Last active November 2, 2023 06:09
Security Advisory: PHP's escapeshellcmd and escapeshellarg are insecure

Paul Buonopane paul@namepros.com at NamePros
PGP: https://keybase.io/zenexer

I'm working on cleaning up this advisory so that it's more informative at a glance. Suggestions are welcome.

This advisory addresses the underlying PHP vulnerabilities behind Dawid Golunski's [CVE-2016-10033][CVE-2016-10033], [CVE-2016-10045][CVE-2016-10045], and [CVE-2016-10074][CVE-2016-10074]. It assumes prior understanding of these vulnerabilities.

This advisory does not yet have associated CVE identifiers.

Summary

@sepehr
sepehr / pgp.md
Last active November 18, 2023 19:11
PGP Guide

PGP Guide

GPG vs PGP

PGP can refer to two things:

The Pretty Good Privacy software originally written by Phil Zimmermann, and now owned by Symantec. The formats for keys, encrypted messages and message signatures defined by that software. These have now been formalised as the OpenPGP standard. The GPG software is an independent implementation of the OpenPGP standards, so you can use it to exchange encrypted messages with people using other OpenPGP implementations (e.g. Symantec's PGP).

@sepehr
sepehr / ubuntu-web.md
Last active August 23, 2023 04:28
Webserver recipe for Ubuntu 14.04

Webserver setup recipe for Ubuntu 14.04 LTS

A few notes:

  • All commands should be run as root unless specified otherwise.
  • Commands that sould be run locally have a local$ prefix.

Initial setup

Hostname

@sepehr
sepehr / osx-kong.sh
Last active June 12, 2018 01:54
OSX: Kong Installation
#!/bin/bash
#
# The homebrew formula of kong has a lot of version incompatibilities. So
# we install kong directly from Luarocks.
#
# Kong only works with Cassandra 2.1.x/2.2.x, the latest brew formula for
# cassandra is 3.x. We need to tap homebrew/versions and install cassandra22
# instead.
#
@tsmsogn
tsmsogn / new_gist_file.php
Created July 31, 2015 01:40
[php]base64_url_encode() and base64_url_decode
<?php
// From: http://stackoverflow.com/questions/1374753/passing-base64-encoded-strings-in-url
function base64_url_encode($input) {
return strtr(base64_encode($input), '+/=', '-_,');
}
function base64_url_decode($input) {
return base64_decode(strtr($input, '-_,', '+/='));
}