Skip to content

Instantly share code, notes, and snippets.

View hussnainsheikh's full-sized avatar
🎯
Focusing

Sheikh Hussnain hussnainsheikh

🎯
Focusing
View GitHub Profile
@hussnainsheikh
hussnainsheikh / showtables.php
Created September 21, 2017 15:03
This is simple PHP script which shows all the tables of a database. You just need to provide database details. It can be helpful if we just have database details and do not know about the database tables.
<?php
$db = 'database'; //Database name
$host = 'host'; //Hostname or Server ip
$user = 'database_user'; //Database user
$pass = 'password'; //Database user password
$con = mysql_connect($host,$user,$pass);
if($con){
@hussnainsheikh
hussnainsheikh / simple_calculator.html
Created October 17, 2017 19:54
Simple basic Calculator using javaScript. Functions addition, subtraction, multiplication and division with maintaining history of previous answer.
<!-- Basic calculator using javaScript -->
<html>
<head>
<title>Calculator</title>
<style type="text/css">
.field{
padding: 4px;
border-radius: 4px;
border: solid black 1px;
margin: 3px;
@hussnainsheikh
hussnainsheikh / simple_calculator_using_jquery.html
Created November 2, 2017 19:12
Simple basic Calculator using jQuery. It includes addition, subtraction, multiplication and division. It also keep record of previous answers. Enjoy!
<!-- Basic calculator using jQuery -->
<html>
<head>
<title>Calculator</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<style type="text/css">
.field{
padding: 4px;
border-radius: 4px;
border: solid black 1px;
@hussnainsheikh
hussnainsheikh / Transfer_with_extraction.php
Last active November 6, 2017 07:21 — forked from musamamasood/transfer.php
Transfer files to server with publicly accessible zip file with extraction using PHP Copy and PHP ZipArchive. You just have to change the $remote_file_url and then upload this file on destination server and execute the file.
<?PHP
/**
* Transfer Files Server to Server using PHP Copy and PHP ZipArchive
* @link http://glowLogix.com
*/
/* Source File URL */
$remote_file_url = 'http://example.com/filename.zip';
/* New file name and path for this file */
@hussnainsheikh
hussnainsheikh / tables_backup.php
Created November 6, 2017 08:08
Back up database tables.
<?php
$dbhost = 'DB_Host'; // Database Host
$dbuser = 'DB_User'; // Database User
$dbpass = 'DBUser_Password'; // Database User Password
$db='DB_Name'; // Database Name
$i=0;
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($db);
@hussnainsheikh
hussnainsheikh / show_columns.php
Created December 19, 2017 07:14
Simple PHP script to show columns name of a database table.
<?php
$db = 'Database'; //Database name
$host = 'Database_host'; //Hostname or Server ip
$user = 'USER'; //Database user
$pass = 'Password'; //Database user password
$con = mysql_connect($host,$user,$pass);
if($con){
@hussnainsheikh
hussnainsheikh / show_databases.php
Created December 19, 2017 12:47
Simplet php script to show all DATABASES which are created on a host. Enjoy!
<?php
$host = 'HOST'; //Hostname or Server ip
$user = 'USER'; //Database user
$pass = 'PASS'; //Database user password
$con = mysql_connect($host,$user,$pass);
if($con){
$count = 0;
@hussnainsheikh
hussnainsheikh / shopify_delete_all_products.php
Last active February 6, 2018 08:28
Simple PHP script to delete all products from Shopify store using a private App(Api key and Pass). Just replace your App info and enjoy. Thanks
<?php
/**
*
*/
class ShopifyProducts{
public function getProducts($count = false, $page){
$apikey = 'API_KEY'; //Replace with your's
$pass = 'PASS'; //Replace with your's
$store = 'STORE_URL'; //Replace with your's
if ($count == true) {
@hussnainsheikh
hussnainsheikh / Programs.cpp
Last active February 17, 2018 20:44
Simple Problems solution in C++. Please find the comment below for Problem statements.
Program No 1:
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{

How to install mysql on ubuntu (which works)

first delete it in case a root password was previously created:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

then install it: