Skip to main content

Posts

Showing posts from September, 2013

JDBC and MySQL

Here is a quick reference to connect mysql database with java in linux environment. INSTALLATION: Hope jdk, mysql server and client are already installed on your box. then install the libmysql-java sudo apt-get install libmysql-java it will install the connector in your box or download the jar file manually from http://dev.mysql.com/downloads/connector/j/ if mysql-connector-java.jar is located in the /usr/share/java

Bulk rename in bash

here i found a very simple command flow to rename the files in a folder by sequence order i have list of *.png file with different names for example Monsters-University-Icon-5.png Monsters-University-James-P-Sullivan-Icon-2.png . . i need to rename in to Mon01.png Mon02.png . . here is a solutions #!/bin/bash a=1 for  i in *.png; do new=$(printf "Mon%02d" ${a}) mv ${i} ${new} let a=a+1 done it will do the magic..