Skip to content

Instantly share code, notes, and snippets.

View buonzz's full-sized avatar

Darwin Biler buonzz

View GitHub Profile
@buonzz
buonzz / install_composer.sh
Created March 29, 2014 22:00
install composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
@buonzz
buonzz / githubaccount.sh
Created March 29, 2014 22:05
setup github account
#setup first your info
git config --global user.name "your name"
git config --global user.email "your email"
# OPTIONAL use with caution!
# store your user/pass in .git-credentials in clear text when you enter it in your first push to github
git config credential.helper store
@buonzz
buonzz / member.php
Last active August 29, 2015 13:57
Member Class
<?php
class Member{
function getAccountID(){
return "123456";
}
}
@buonzz
buonzz / include_member.php
Last active August 29, 2015 13:57
include member
<?php
require "member.php";
var $m = new Member();
echo $m->getAccountID();
// outputs "123456"
@buonzz
buonzz / readfile.php
Created April 9, 2014 09:15
readfile
<?php
$file = 'monkey.gif';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
@buonzz
buonzz / download.php
Last active August 29, 2015 13:58
download file via mod_xsendfile
<?php
$file = 'monkey.gif';
if (file_exists($file)) {
//show the download dialog to the browser
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$file);
//send away and exit the script, Apache will handle the outputting of file contents
@buonzz
buonzz / install_glassfish.sh
Last active August 29, 2015 14:00
install glassfish application server
# install jdk first
yum install java-1.7.0-openjdk-devel
#download glassfish
wget http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip
# start the application server
bin/asadmin start-domain
@buonzz
buonzz / generate.bat
Last active August 29, 2015 14:01
generate diagrams for mysql database using SchemaSpy
# download schemaspy in here http://schemaspy.sourceforge.net/
java -jar schemaSpy_5.0.0.jar -t mysql -db mydb -host localhost -u root -o output -dp driver/mysql-connector-java-5.1.30-bin.jar
@buonzz
buonzz / set_nameserver.sh
Created June 29, 2014 03:27
avoid the nameserver to get overwritten when rebooted on centos
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
# add this two lines to overwrite the nameserver value
echo "nameserver 8.8.8.8" > /etc/resolv.conf
@buonzz
buonzz / json_account.json
Created July 7, 2014 00:20
json account
{
"name":"Darwin Biler",
"id": "123",
"date_created": "2009-12-12"
}