Skip to content

Instantly share code, notes, and snippets.

View biswarupadhikari's full-sized avatar

Biswarup Adhikari biswarupadhikari

View GitHub Profile
@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
@biswarupadhikari
biswarupadhikari / getFileHashCode.sh
Created August 7, 2012 02:43
How to Generate Sha1 Or md5 Value for a File File Hash Code
filepath="/home/testuser/MyRadio.jpg"
myfilehash=$(sha1sum $filepath)
echo "File Sha1 Value is $myfilehash"
myfilehash=$(md5sum $myfilepath)
echo "File MD5 Value is $myfilehash"
@biswarupadhikari
biswarupadhikari / gist:3304593
Created August 9, 2012 14:23
How to extract .tar.bz2 and .tar.gz file in Linux
Tar is an archiving utility in Linux. Lets see how can we extract various archived files in Linux using this utility. We will also see the meaning of the options provided with the commands. Type the following commands in terminal (Keyboard short cut: Ctrl+Alt+T in Ubuntu):
Extracting .tar.bz2:
tar xvjf filename.tar.bz2 location
Extracting .tar.gz:
tar xvzf filename.tar.gz location
Where:
x — extract
v — verbose (it will show the extracting files in the terminal)
@biswarupadhikari
biswarupadhikari / joomlaLoginValidator.php
Created August 10, 2012 07:08
How to validate Joomla Login
<?php
function validateLogin($username,$password){
jimport( 'joomla.user.authentication');
$auth = & JAuthentication::getInstance();
$credentials = array( 'username' => $username, 'password' => $password );
$options = array();
$response = $auth->authenticate($credentials, $options);
if ($response->status === JAUTHENTICATE_STATUS_SUCCESS) {
$response->status = true;
$user=JFactory::getUser($username);
@biswarupadhikari
biswarupadhikari / gist:3396638
Created August 19, 2012 17:42
Install Git-FTP
$ git clone http://github.com/resmo/git-ftp.git
$ cd git-ftp
$ git checkout master
$ sudo make install
@biswarupadhikari
biswarupadhikari / filename.js
Created September 6, 2012 06:02
Extract File Without Extension Via Javascript
var url = "http://example.com/index.htm";
var filename = url.match(/([^\/]+)(?=\.\w+$)/)[0];
@biswarupadhikari
biswarupadhikari / mod_youtube.xml
Created October 10, 2012 07:39
Joomla:How to add Module Parameter Joomla 2.5
<config>
<fields name="params">
<fieldset name="basic" label="Module Parameters" description="Module settings">
<field size="10" name="youtube_url" type="text" default="200" label="Youtube Video URL" description="" />
<field size="10" name="height" type="text" default="315" label="Height" description="" />
<field size="10" name="width" type="text" default="560" label="Width" description="" />
</fieldset>
</fields>
@biswarupadhikari
biswarupadhikari / gist:3880666
Created October 12, 2012 18:20
Joomla:Check Logged user in Frontend or In Backend
<?php
$app =& JFactory::getApplication();
if ($app->isAdmin()) {
echo "we are in the administrator";
} else {
echo "we are in the frontend site";
}
@biswarupadhikari
biswarupadhikari / gist:3969459
Created October 28, 2012 18:53
Backtrack5 GUI Not Showing Or startx not working
Run These Command
fix-splash
rm /root/.kde/cache-root/icon-cac­he.kcache
rm /root/.kde/cache-root/plasma_t­heme_Volatile.kcache
rm /root/.kde/cache-bt/icon-cache­.kcache
rm /root/.kde/cache-bt/plasma_the­me_Volatile.kcache
startx
@biswarupadhikari
biswarupadhikari / .htaccess
Created November 1, 2012 12:48
How to Password Protect Directory Usiing .htaccess file
AuthName "Secure Area"
AuthType Basic
AuthUserFile /home/adidac/.htpasswd
require valid-user