Skip to content

Instantly share code, notes, and snippets.

View dodyagung's full-sized avatar
🏠
Working from home

Dody dodyagung

🏠
Working from home
View GitHub Profile
// WITH PARAMETER
JdbcProperties.connectDb();
Connection c = JdbcProperties.conn;
try {
String reportName = "Report/r_detail_payroll.jasper";
String imgPath = "Report/PST02.jpg";
InputStream fis = this.getClass().getClassLoader().getResourceAsStream(reportName);
InputStream is = this.getClass().getClassLoader().getResourceAsStream(imgPath);
Map params = new HashMap();
params.put("start", dateFormat.format(start.getDate()));
@dodyagung
dodyagung / Create htpasswd file for nginx (without apache)
Created July 12, 2014 05:07
Create htpasswd file for nginx (without apache)
If you're like me, and use Nginx instead of Apache, you could eventually face this problem: Create an htpasswd file (for htaccess "authentication").
To create your file, without installing Apache, just run:
$ printf "USER:$(openssl passwd -crypt PASSWORD)\n" >> .htpasswd
Replace USER and PASSWORD for your user and password :)
source : https://coderwall.com/p/zvvgna
@dodyagung
dodyagung / MYSQL AUTO LEADING ID
Last active August 29, 2015 14:04
MYSQL AUTO LEADING ID
/* TRX1409240002 */
SELECT
CONCAT(
'TRX',
DATE_FORMAT(CURDATE(), '%y%m%d'),
IF(
SUBSTR(MAX(id),8,2) = DATE_FORMAT(CURDATE(), '%d'),
LPAD(
SUBSTR(MAX(id),10,4) + 1,
@dodyagung
dodyagung / Install Nginx 1.6.1 on Centos 6.5
Last active August 29, 2015 14:05
Install Nginx 1.6.1 on Centos 6.5
rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
yum update
yum install nginx -y
vi /etc/nginx/nginx.conf
error_log /dev/null crit;
access_log /dev/null main;
@dodyagung
dodyagung / Install Varnish 3.0.5 on Centos 6.5
Last active August 29, 2015 14:05
Install Varnish 3.0.5 on Centos 6.5
rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-3.0.el6.rpm
yum update
yum install varnish
chkconfig --levels 235 varnish on
service varnish restart
@dodyagung
dodyagung / Install MySQL 5.5 on Centos 6.5
Created September 1, 2014 17:10
Install MySQL 5.5 on Centos 6.5
rpm -Uvh http://kartolo.sby.datautama.net.id/EPEL/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum update
yum install mysql mysql-server
service mysqld start
/usr/bin/mysql_secure_installation
@dodyagung
dodyagung / Install PHP-FPM + APC on Centos 6.5
Last active August 29, 2015 14:05
Install PHP-FPM + APC on Centos 6.5
rpm -Uvh http://kartolo.sby.datautama.net.id/EPEL/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum update
yum install php-fpm php-mysql php-pecl-apc php-mcrypt --enablerepo=remi,epel
vi /etc/php.ini
cgi.fix_pathinfo=0
@dodyagung
dodyagung / PHP weekdays
Created October 16, 2014 07:37
PHP weekdays
<?php
$now = date('j F Y');
echo 'now = ' . $now . '<br />';
$mod = strtotime($now . " + 10 weekdays");
echo 'next 10 weekdays = ' . date('j F Y', $mod);
?>
ANDROID_HOME C:\Program Files\Android\android-sdk
ANT_HOME D:\Apps\apache-ant-1.9.4
JAVA_HOME C:\Program Files\Java\jdk1.7.0_71
PATH C:\Users\Dody\AppData\Roaming\npm;
%ANT_HOME%\bin;
%ANDROID_HOME%/tools;
%ANDROID_HOME%/platform-tools
@dodyagung
dodyagung / How Do I Start Oracle Service in UNIX or Linux?
Created December 5, 2016 04:00
How Do I Start Oracle Service in UNIX or Linux?
---- Copied from https://www.cyberciti.biz/faq/how-do-i-start-oracle-service-in-unix/ ----
How To Startup Oracle Database on a Unix/Linux
Use the su - username command to login as oracle user. Open the Terminal or login using ssh and type the following command to login
$ su - oracle
Start Oracle server in UNIX/Linux
Now, use the lsnrctl command to start service (usually located at /home/oracle/oracle/product/10.2.0/db_1/bin directory):
$ lsnrctl start