Skip to content

Instantly share code, notes, and snippets.

View nhalstead's full-sized avatar
👨‍💻
Something. Maybe cool

Noah Halstead nhalstead

👨‍💻
Something. Maybe cool
View GitHub Profile
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error
@hlashbrooke
hlashbrooke / functions.php
Last active January 25, 2020 19:20
Seriously Simple Speakers: Rename the 'Speakers' label to something else. In this example I have renamed the 'Speakers' to 'Guests' in both the plural and singular instances - you can make those labels anything you want by editing this code and adding it to your theme's functions.php file or a functionality plugin.
<?php
add_filter( 'ssp_speakers_plural_label', 'ssp_speakers_plural_label_custom' );
function ssp_speakers_plural_label_custom ( $label ) {
return 'Guests';
}
add_filter( 'ssp_speakers_single_label', 'ssp_speakers_single_label_custom' );
function ssp_speakers_single_label_custom ( $label ) {
return 'Guest';
}
@MattLoyeD
MattLoyeD / index.php
Last active May 27, 2020 18:02
GIF to MP4 in PHP (with Linux & ffmpeg)
<?php
/**
* @author: Matthieu Loye Deroubaix / @matloyed
* @website : http://www.agence-malttt.fr/
* Do what you want with this file :)
* Usage : http://gifme.domain.tld/?url=http://www.domain.tld/blablabla.gif
*/
@flashfoxter
flashfoxter / gist:e080baba0bd664ba9d376e4792ff69e6
Created June 16, 2016 11:21 — forked from hanssens/gist:8182406
Fix for the UnauthorizedAccessException in Xamarin Studio (MonoDevelop) when running a MVC 4/5 website on Mac OSX.

Fix for the UnauthorizedAccessException in Xamarin Studio

This is a fix for the UnauthorizedAccessException in Xamarin Studio (MonoDevelop) when running a MVC 4/5 website on Mac OSX.

The error:

System.UnauthorizedAccessException
Access to the path "/Library/Frameworks/Mono.framework/Versions/3.2.5/etc/mono/registry" is denied.
 
@mpeven
mpeven / captive_portal.sh
Last active January 10, 2023 00:47
iOS captive portal
# Captive portal setup
########################################################
sudo apt-get update -qq
sudo apt-get install -qq dnsmasq vim hostapd ufw dnsutils netstat-nat conntrack nginx php5 php5-common php5-fpm
sudo mkdir /usr/share/nginx/html/portal
sudo useradd nginx
sudo chown nginx:www-data /usr/share/nginx/html/portal
sudo chmod 755 /usr/share/nginx/html/portal
########################################################
@pitbulk
pitbulk / fixpw.php
Created June 7, 2016 11:40
This script sanitize @@@nopass@@@ passwords generated by OneLogin SAML plugin <= 2.1.8
<?php
/**
* This script search user with @@@nopass@@@ passwords and replace them by random passwords
*/
/** Sets up the WordPress Environment. */
require( dirname(__FILE__) . '/wp-load.php' );
$users = get_users();
@ethack
ethack / TypeClipboard.md
Last active May 4, 2025 03:07
Scripts that simulate typing the clipboard contents. Useful when pasting is not allowed.

It "types" the contents of the clipboard.

Why can't you just paste the contents you ask? Sometimes pasting just doesn't work.

  • One example is in system password fields on OSX.
  • Sometimes you're working in a VM and the clipboard isn't shared.
  • Other times you're working via Remote Desktop and again, the clipboard doesn't work in password boxes such as the system login prompts.
  • Connected via RDP and clipboard sharing is disabled and so is mounting of local drives. If the system doesn't have internet access there's no easy way to get things like payloads or Powershell scripts onto it... until now.

Windows

The Windows version is written in AutoHotKey and easily compiles to an executable. It's a single line script that maps Ctrl-Shift-V to type the clipboard.

@mxriverlynn
mxriverlynn / 1.js
Created May 15, 2016 22:00
custom error with clean stack trace
function createError(msg, status){
var err = new Error(msg);
err.status = status;
// uncomment this next line to get a clean stack trace in node.js
// Error.captureStackTrace(err, createError);
return err;
}
var err = createError("test", 500);
@niahoo
niahoo / delete-all-messages.js
Last active September 20, 2023 01:29
Delete all messages in a Discord channel
(function(){
// Paste your token between the quotes :
var authToken = '________________________________________'
// https://github.com/yanatan16/nanoajax
!function(t,e){function n(t){return t&&e.XDomainRequest&&!/MSIE 1/.test(navigator.userAgent)?new XDomainRequest:e.XMLHttpRequest?new XMLHttpRequest:void 0}function o(t,e,n){t[e]=t[e]||n}var r=["responseType","withCredentials","timeout","onprogress"];t.ajax=function(t,a){function s(t,e){return function(){c||(a(void 0===f.status?t:f.status,0===f.status?"Error":f.response||f.responseText||e,f),c=!0)}}var u=t.headers||{},i=t.body,d=t.method||(i?"POST":"GET"),c=!1,f=n(t.cors);f.open(d,t.url,!0);var l=f.onload=s(200);f.onreadystatechange=function(){4===f.readyState&&l()},f.onerror=s(null,"Error"),f.ontimeout=s(null,"Timeout"),f.onabort=s(null,"Abort"),i&&(o(u,"X-Requested-With","XMLHttpRequest"),e.FormData&&i instanceof e.FormData||o(u,"Content-Type","application/x-www-form-urlencoded"));for(var p,m=0,v=r.length;v>m;m++)p=r[m],void 0!==t[p]&&(f[p]=t[p]);for
#include <WinSock2.h>
#include <iostream>
#pragma comment (lib,"ws2_32.lib")
using namespace std;
WSADATA w;
DWORD dwTemp,FileSize = 0;
HANDLE io;