This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum install libxml2-devel | |
yum install libxslt-devel | |
yum install python-devel | |
pip install MySQL-python | |
pip install scrapy==0.18.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Client Side Upload | |
* AT : Server VPS Nufaza CloudKilat | |
* IP : 103.23.20.154 | |
* PATH : /var/www/adminer/upload.php | |
*/ | |
set_time_limit(600); | |
$file_name_with_full_path = realpath('./tesfile.txt'); | |
// echo $file_name_with_full_path; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function addForeignKeys(Table $table) | |
{ | |
$database = $table->getDatabase(); | |
$stmt = $this->dbh->query("SELECT ccu1.TABLE_NAME, ccu1.COLUMN_NAME, ccu2.TABLE_NAME AS FK_TABLE_NAME, ccu2.COLUMN_NAME AS FK_COLUMN_NAME, ccu1.CONSTRAINT_NAME | |
FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu1 INNER JOIN | |
INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc1 ON tc1.CONSTRAINT_NAME = ccu1.CONSTRAINT_NAME AND | |
CONSTRAINT_TYPE = 'Foreign Key' INNER JOIN | |
INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS rc1 ON rc1.CONSTRAINT_NAME = tc1.CONSTRAINT_NAME INNER JOIN | |
INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu2 ON ccu2.CONSTRAINT_NAME = rc1.UNIQUE_CONSTRAINT_NAME |
#Tutorial Install Candy
##1. Java
Go to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
(12-05-2014)
Choose the latest linux 64 bit rpm then download using wget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* * ** | |
* | |
* This script converts an existing MySQL database to migrations in Laravel 4. | |
* | |
* 1. Place this file inside app/controllers/ | |
* | |
* 2. In this file, edit the index() method to customize this script to your needs. | |
* - inside $migrate->ignore(), you pass in an array of table |
Well, for hours i have been so frustated why my insert file does not work, so this is the solution.
I use MariaDB 10.0.14
LOAD DATA local INFILE "/tmp/pengguna.csv" INTO TABLE pengguna_dapodik_tokudb FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' ( `username`, `password`, `nama`, `sekolah_id`, `sekolah_nama`, `kabupaten_kota_id`, `kabupaten_kota_nama`, `propinsi_id`, `propinsi_nama` );
Well, I'm too lazy to doing some command just for change the configuration, here is the script. The logic is simple, change app port
from 80
into 8313
, and make the port 80
maintenance. And to revert it, change app port
from 8313
into 80
, and make the maintenance.conf
disable by change it into extension .confs
.
To use it, make sure the filename just look like below, and then chmod a+x *.sh
. Then ./maintenance.sh
to make it maintenance mode or ./demaintenance.sh
to revert.
#!/bin/bash
# @name : Maintenance script for CRM App
[root@sim2-p2tk ~]# time sysbench --test=/usr/share/doc/sysbench/tests/db/oltp.lua --mysql-table-engine=innodb --oltp-table-size=250000 --mysql-user=testdb --mysql-password=testpw --mysql-socket=/var/lib/mysql/mysql.sock prepare
sysbench 0.5: multi-threaded system evaluation benchmark
Creating table 'sbtest1'...
Inserting 250000 records into 'sbtest1'
real 0m11.455s
user 0m3.805s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
now="$(date +'%Y_%m_%d_%H_%M')" | |
filename_app="CRM_APP_$now".tar.gz | |
filename_db="CRM_DB_$now".sql.gz | |
backupfolder="/home/backup" | |
backupfolder_app="/var/www/website" | |
fullpathbackupfile_db="$backupfolder/$filename_db" | |
fullpathbackupfile_app="$backupfolder/$filename_app" | |
# execute mysql | |
mysqldump -u user -pPasswd -h xxx.xxx.xxx.xxx databases | gzip -9 > "$fullpathbackupfile_db" |
OlderNewer