Skip to content

Instantly share code, notes, and snippets.

View biswarupadhikari's full-sized avatar

Biswarup Adhikari biswarupadhikari

View GitHub Profile
@biswarupadhikari
biswarupadhikari / Phonegap Content URI To File Path
Created July 12, 2012 23:02
Phonegap Content URI To File Path
String ActualFilePath=this.getRealPathFromURI(Uri.parse("content://media/external/images/media/8"));
private String getRealPathFromURI(Uri contentURI) {
Cursor cursor = this.cordova.getActivity().getContentResolver().query(contentURI, null, null, null, null);
cursor.moveToFirst();
int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
return cursor.getString(idx);
}
@biswarupadhikari
biswarupadhikari / load multiple tmpl file in default.php
Created July 14, 2012 18:10
How to load multiple tmpl file into default.php file in Joomla
create multiple file inside view
admin/views/helloworlds/index.html
admin/views/helloworlds/view.html.php
admin/views/helloworlds/tmpl/index.html
admin/views/helloworlds/tmpl/default.php
admin/views/helloworlds/tmpl/default_head.php
admin/views/helloworlds/tmpl/default_body.php
admin/views/helloworlds/tmpl/default_foot.php
@biswarupadhikari
biswarupadhikari / API.java
Created July 22, 2012 18:30
How Parse PHP JSON DATA BY JAVA
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
public class API {
private String webPageUrl="";
public API(String URL){
@biswarupadhikari
biswarupadhikari / API.java
Created July 22, 2012 18:19
How to get URL content using Java
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
public class API {
private String webPageUrl="";
public API(String URL){
@biswarupadhikari
biswarupadhikari / user.sh
Created July 29, 2012 02:13
How to get Logged Username In Linux
echo $LOGNAME
@biswarupadhikari
biswarupadhikari / rc.local
Created July 29, 2012 02:16
How to Run your ShellScript as Root in Startup
Modify file
/etc/init.d/rc.local
appened your script code into the file
@biswarupadhikari
biswarupadhikari / mysql.jsp
Created July 30, 2012 06:56
How to insert Data Into Mysql In JSP
<%@page import="java.sql.*"%>
<%@page import="com.mysql.jdbc.PreparedStatement"%>
<%@page import="com.mysql.jdbc.Connection"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
@biswarupadhikari
biswarupadhikari / checkDir.sh
Created August 1, 2012 20:09
How to check a Directory Exist or Not In Shell Script
############ If Directory Exist ###############
if [ -d "$DIRECTORY" ]; then
# Control will enter here if $DIRECTORY exists.
fi
############ If Directory NOT Exist ###############
if [ ! -d "$DIRECTORY" ]; then
# Control will enter here if $DIRECTORY doesn't exist.
@biswarupadhikari
biswarupadhikari / mysqlInShell.sh
Created August 1, 2012 20:11
How to Run Mysql Query In Shell Script
dbHost="localhost"
dbUsername="root"
dbPass="rootwdp"
dbName="test"
dbTbl="users"
userCol="username"
passCol="password"
$username="user1"
$password="pass123"
mysql -u $dbUsername -p"$dbPass" $dbName -e "INSERT INTO $dbTbl($userCol,$passCol) VALUES('$username','$password')";
@biswarupadhikari
biswarupadhikari / gist:3250304
Created August 3, 2012 18:37
How to Convert .BIN/.CUE Files to .ISO in Ubuntu
Install bchunk using the following command
sudo aptitude install bchunk
This will complete the installation.
Using bchunk
bchunk syntax