Skip to content

Instantly share code, notes, and snippets.

View travstoll's full-sized avatar

Travis Stoll travstoll

View GitHub Profile
@travstoll
travstoll / create_issue.php
Created January 15, 2017 16:29
Create GitHub Issue in PHP with File_Get_Contents using GitHub API
<?
//personal auth token from your github.com account. doing this will eliminate having to use oauth everytime
$token = "zzzzzzzzYourPersonalGithubAccessTokenzzzzzzzz";
//post url, https://developer.github.com/v3/issues/
$url = "https://api.github.com/repos/octocat/some_repo/issues?access_token=" . $token;
//request details, removing slashes and sanitize content
$title = htmlspecialchars(stripslashes("Test Title''\s"), ENT_QUOTES);
$body = htmlspecialchars(stripslashes("Test Body'\'$%'s"), ENT_QUOTES);
@travstoll
travstoll / view_repos.php
Created January 15, 2017 16:38
View GitHub Repos in PHP with File_Get_Contents using GitHub API
<?
//post url
$url = "https://api.github.com/users/octocat/repos";
//set file_get_contents header info
$opts = [
'http' => [
'method' => 'GET',
'header' => [
@travstoll
travstoll / ldap_auth.php
Created January 17, 2017 23:03
Simple LDAP Authentication Shell
<?
$user = '<AD_User>'; // get from post
$ldappass = '<AD_Password>'; // associated password
// using ldap bind
$ldaprdn = $user . '@<domain>.local'; // ldap rdn or dn
$ldap_server = 'ldap://<domaindc>'; //domain controller
// connect to ldap server