Skip to content

Instantly share code, notes, and snippets.

View manniru's full-sized avatar

MUHAMMAD MANNIR AHMAD manniru

View GitHub Profile
@NARKOZ
NARKOZ / db_backup.sh
Created October 23, 2010 18:15
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
@phpleo
phpleo / php en Ubuntu (instalacion)
Created December 6, 2010 02:42
Instalando SQL-Lite
$ sudo aptitude install php5-sqlite
@basham
basham / nodejs-rfid.js
Last active May 1, 2024 12:56
Use NodeJS to read RFID ids through the USB serial stream.
/*
DESCRIPTION
-----------
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum:
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699
CODE REPOSITORY
---------------
https://gist.github.com/806605
@mtigas
mtigas / LICENSE.txt
Created February 9, 2011 20:07
Script that allows batch-downloading a person's full Facebook photo collection.
Copyright 2011 Mike Tigas. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
of conditions and the following disclaimer in the documentation and/or other materials
@IamSmith
IamSmith / FullExample.php
Created April 8, 2011 17:53
Fully working example
<?php
require_once("PHPExcel/PHPExcel.php");
$phpExcel = new PHPExcel();
$styleArray = array(
'font' => array(
'bold' => true,
)
);
@ihumanable
ihumanable / Excel.php
Last active February 6, 2024 06:24
Simple Excel Writer in PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @link https://gist.github.com/ihumanable/929039/edit
* @license Unlicensed
* @version 1.0
*/
class Excel {
@eegrok
eegrok / vpn-setup.txt
Created May 4, 2011 22:26
set up VPN from scratch
#partially from:
#http://openvpn.net/index.php/open-source/documentation/miscellaneous/78-static-key-mini-howto.html
# in this I refer to the server and the client -- really the only difference here is that the 'server'
# needs to have a publicly accessible IP, and be configured to allow UDP port 1194 to connect inbound
iptables -A INPUT -s <put-client-public-ip-address-here> -p udp -m udp --dport 1194 -j ACCEPT
# other than that, they can communicate both ways, assuming the client firewall is configured to allow it
# (to firewall the client to prevent all server connections, see below)
# don't forget to save your iptables configurations after making them -- https://gist.github.com/958060
#on server, make sure openvpn is installed (on ubuntu it's simply: aptitude install openvpn)
# to install on rhel5, follow this: https://gist.github.com/957868
https://dl-ssl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B739A42D5-7A93-1BFE-A053-81D56ACD6752%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dfalse%26installdataindex%3Ddefaultbrowser/update2/installers/ChromeStandaloneSetup.exe
@DmitrySkiba
DmitrySkiba / gist:1017293
Created June 9, 2011 17:52
JNIpp: getting IMEI from native code on Android
/* There is no native way to get IMEI, so we have to call
* Java classes through JNI.
*
* But fear not: JNIpp (github.com/DmitrySkiba/itoa-jnipp) makes
* this task much easier.
*
* To get IMEI we need to perform the following calls:
*
* TelephonyManager telephony=(TelephonyManager)
* context.getSystemService(Context.TELEPHONY_SERVICE);
@nikhgupta
nikhgupta / cpanel-backup-script.php
Created July 8, 2011 11:02
cPanel Backup Script
<?php
// PHP script to allow periodic cPanel backups automatically, optionally to a remote FTP server.
// This script contains passwords. KEEP ACCESS TO THIS FILE SECURE! (place it in your home dir, not /www/)
// ********* THE FOLLOWING ITEMS NEED TO BE CONFIGURED *********
// Info required for cPanel access
$cpuser = "username"; // Username used to login to CPanel
$cppass = "password"; // Password used to login to CPanel