Skip to content

Instantly share code, notes, and snippets.


Abhishek Ghosh AbhishekGhosh

View GitHub Profile
View wordpres-shell.php
/* Don't remove this line. */
/* Checking login & pass in the database */
function veriflog() {
global $cookiehash;
global $tableusers, $wpdb;
if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
$user_login = $_COOKIE['wordpressuser_' . $cookiehash];
View example.php
$output = `ls -al`;
echo "<pre>$output</pre>";
AbhishekGhosh / mysql-php-bash.sql
Created Feb 10, 2014
Executing sql commands with PHP
View mysql-php-bash.sql
exec("mysqldump -u user -p passwod database > outputfile.sql 2> error.log");
View popen.php
//Initialize and Run Command, with a little trick to avoid certain issues
$target='cd ../../your/relative/path && ./';
$outbuf=exec($target,$stdoutbuf, $returnbuf);
View html5-audio-code.html
<audio controls>
<source src="/path/to/example.ogg" type="audio/ogg">
<source src="/path/to/example.mp3" type="audio/mpeg">
Your browser does not support the audio tag.
View WordPress-Transient-Feedburner.php
function feed_subscribers(){
$feed_url = '';
$count = get_transient('feed_count');
if ($count != false) return $count;
$count = 0;
$data = wp_remote_get(''.$feed_url.'');
if (is_wp_error($data)) {
return 'error';
$body = wp_remote_retrieve_body($data);
AbhishekGhosh /
Last active Aug 29, 2015
Install GO on OS X Homebrew
#!/usr/bin/env sh
echo "add lines to .bashrc or .zshrc first"
brew update && brew upgrade
brew install go
brew install git
brew install mercurial
mkdir $HOME/go
View Optimize-nginx
worker_processes 2
worker_connections 1024
server_tokens off;
# Timeout Settings
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 5 5;
send_timeout 10;
View ngnix-Configaration
server {
# This redirects the non-www version of the domain name to the www version
rewrite ^ $scheme://$request_uri? permanent;
server {
root /var/www/domain/httpdocs;
index index.html index.htm index.php;