Skip to content

Instantly share code, notes, and snippets.

View vishnu1991's full-sized avatar
🎯
Focusing

Vishnu vishnu1991

🎯
Focusing
View GitHub Profile
@alobato
alobato / facebook-dl
Created September 18, 2014 17:15
Download a Facebook video with one line
# Ex.: https://www.facebook.com/video.php?v=469066063208329
video=469066063208329; curl -s $(curl -s https://www.facebook.com/video.php?v=$video | grep -o 'https.*thumbnail_src' | sed 's/\\u00253A/:/g' | sed 's/\\u00255C\\u00252F/\//g' | sed 's/\\u002526/\&/g' | sed 's/\\u00253D/=/g' | sed 's/\\u00253F/?/g' | sed 's/\\u002522\\u00252C\\u002522thumbnail_src//g') > $video.mp4
@hnq90
hnq90 / CheckEmoji.php
Created November 26, 2014 10:18
Check Emoji exist in string
/**
* Check emoji from string
*
* @return bool if existed emoji in string
*/
function checkEmoji($str)
{
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
preg_match($regexEmoticons, $str, $matches_emo);
if (!empty($matches_emo[0])) {
@dgp
dgp / youtube api video category id list
Created June 11, 2015 05:57
youtube api video category id list
2 - Autos & Vehicles
1 - Film & Animation
10 - Music
15 - Pets & Animals
17 - Sports
18 - Short Movies
19 - Travel & Events
20 - Gaming
21 - Videoblogging
22 - People & Blogs
@battis
battis / emoji.php
Last active October 5, 2021 20:15
Trying to store/retrieve/display Unicode emoji in a MySQL database
<?php
// MySQL schema
/*
CREATE TABLE `test` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`text` text,
`blob` blob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
[
{
"author": "Abraham Lincoln",
"quote": "Things may come to those who wait, but only the things left by those who hustle.",
"image": "http://upload.wikimedia.org/wikipedia/commons/1/1b/Abraham_Lincoln_November_1863.jpg"
},
{
"author": "Adam Smith",
"quote": "The great secret of education is to direct vanity to proper objects.",
@unnikked
unnikked / index.php
Created January 5, 2016 22:02
InlineDuckBot
<?php
require("./vendor/autoload.php");
define('BOT_TOKEN', 'token');
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/');
function apiRequestWebhook($method, $parameters) {
if (!is_string($method)) {
error_log("Method name must be a string\n");
@AbhishekGhosh
AbhishekGhosh / mailportcheck.php
Created February 27, 2016 22:41
Check Port 25, 465, 587 whether open via PHP
<?php
// 5 is the timeout in seconds
// 25 is port, other ports you may check are 465 and 587
$fp = fsockopen('127.0.0.1', 25, $errno, $errstr, 5);
if (!$fp) {
} else {
fclose($fp);
}
?>
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@visitdigital
visitdigital / webhook.php
Last active September 20, 2022 02:51
Very Simple Facebook Chat Bot PHP Webhook Script Example
<?php
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
// Set this Verify Token Value on your Facebook App
if ($verify_token === 'testtoken') {
echo $challenge;
}
$input = json_decode(file_get_contents('php://input'), true);
@numberwhun
numberwhun / Penetration testing sample test cases
Created July 2, 2016 03:21
Penetration testing sample test cases
Penetration testing sample test cases (test scenarios):
Remember this is not functional testing. In Pentest your goal is to find security holes in the system. Below are some generic test cases and not necessarily applicable for all applications.
1) Check if web application is able to identify spam attacks on contact forms used in the website.
2) Proxy server – Check if network traffic is monitored by proxy appliances. Proxy server make it difficult for hackers to get internal details of the network thus protecting the system from external attacks.
3) Spam email filters – Verify if incoming and outgoing email traffic is filtered and unsolicited emails are blocked. Many email clients come with in-build spam filters which needs to be configured as per your needs. These configuration rules can be applied on email headers, subject or body.
4) Firewall – Make sure entire network or computers are protected with Firewall. Firewall can be a software or hardware to block unauthorized access to system. Firewall can p