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
@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 / 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 / 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
// 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()));