This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"AllowedHeaders": [], | |
"AllowedMethods": [ | |
"GET" | |
], | |
"AllowedOrigins": [ | |
"*" | |
], | |
"ExposeHeaders": [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/php | |
<?php | |
// AbuseIPDB API v2 Key | |
$api_key = 'xxx'; | |
// AbuseIPDB API v2 Endpoint | |
$api_endpoint = 'https://api.abuseipdb.com/api/v2/'; | |
// AbuseIPDB User ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// required Facebook PHP SDK v4.0.9 or later. | |
// include required files form Facebook SDK | |
require_once( 'Facebook/HttpClients/FacebookHttpable.php' ); | |
require_once( 'Facebook/HttpClients/FacebookCurl.php' ); | |
require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' ); | |
require_once( 'Facebook/Entities/AccessToken.php' ); | |
require_once( 'Facebook/Entities/SignedRequest.php' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include composer packages | |
include "vendor/autoload.php"; | |
// Create new Landscape PDF | |
$pdf = new FPDI('l'); | |
// Reference the PDF you want to use (use relative path) | |
$pagecount = $pdf->setSourceFile( 'certificate.pdf' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { | |
$iPod = stripos( $_SERVER['HTTP_USER_AGENT'], "iPod" ); | |
$iPhone = stripos( $_SERVER['HTTP_USER_AGENT'], "iPhone" ); | |
$iPad = stripos( $_SERVER['HTTP_USER_AGENT'], "iPad" ); | |
$Android = stripos( $_SERVER['HTTP_USER_AGENT'], "Android" ); | |
$webOS = stripos( $_SERVER['HTTP_USER_AGENT'], "webOS" ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Account Suspended</title> | |
<!-- Fonts --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// post to page | |
$page_post = (new FacebookRequest( $session, 'POST', '/'. $page_id .'/feed', array( | |
'access_token' => $access_token, | |
'name' => 'Facebook API: Posting As A Page using Graph API v2.x and PHP SDK 4.0.x', | |
'link' => 'https://www.webniraj.com/2014/08/23/facebook-api-posting-as-a-page-using-graph-api-v2-x-and-php-sdk-4-0-x/', | |
'caption' => 'The Facebook API lets you post to Pages you administrate via the API. This tutorial shows you how to achieve this using the Facebook PHP SDK v4.0.x and Graph API 2.x.', | |
'message' => 'Check out my new blog post!', | |
) ))->execute()->getGraphObject()->asArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell Script to Update AWS EC2 Security Groups | |
# Note that existing IP rules will be deleted | |
# CONFIG - Only edit the below lines to setup the script | |
# =============================== | |
# AWS Profile Name | |
profile="name1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "VisualEditor0", | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:RevokeSecurityGroupIngress", | |
"ec2:AuthorizeSecurityGroupEgress", | |
"ec2:AuthorizeSecurityGroupIngress", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# replicate_db.sh (c) by Niraj Shah | |
# replicate_db.sh is licensed under a | |
# Creative Commons Attribution-ShareAlike 4.0 International License. | |
# You should have received a copy of the license along with this | |
# work. If not, see <http://creativecommons.org/licenses/by-sa/4.0/>. | |
# https://www.webniraj.com/2017/01/13/replicating-a-remote-mysql-database-to-local-environment-server/ |
NewerOlder