Tag Archives: TYPE

Get the Blockid of the hard disks

[email protected]:~$ sudo blkid
[sudo] password for droidzone:
/dev/sda1: LABEL="Windows7" UUID="10909D8B909D77C4" TYPE="ntfs"
/dev/sda2: UUID="f3606d11-5fbc-4d31-846a-cc812e4cd53f" TYPE="ext4"
/dev/sda5: UUID="4cc50c11-af2a-4352-8dfa-c967deed997a" TYPE="swap"
/dev/sr1: LABEL="UDF Volume" TYPE="udf"
/dev/sdb1: LABEL="WindowsXP" UUID="E6BCC858BCC82541" TYPE="ntfs"
/dev/sdb2: LABEL="Windows8" UUID="94C0680DC067F440" TYPE="ntfs"
/dev/sdb5: LABEL="STORAGE" UUID="642C-370E" TYPE="vfat"
/dev/sdb6: LABEL="userdata" UUID="3ad6396d-9ab2-4435-a850-e03501810734" TYPE="ext4"
/dev/sdb7: LABEL="gentoo" UUID="f8960404-f785-464e-9c43-06777c679153" TYPE="ext4"
/dev/sdb8: UUID="ca39c78d-85ee-4db1-8589-45beb6cc62e8" TYPE="swap" [/code]

Create the mount point for the disk

sudo mkdir -p /hdd/windows7[/code]

Edit /etc/fstab as root

kdesudo kate /etc/fstab[/code]

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda2 during installation
UUID=f3606d11-5fbc-4d31-846a-cc812e4cd53f / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=4cc50c11-af2a-4352-8dfa-c967deed997a none swap sw 0 0
# swap was on /dev/sdb8 during installation
UUID=ca39c78d-85ee-4db1-8589-45beb6cc62e8 none swap sw 0 0
UUID=10909D8B909D77C4 /hdd/windows7 auto user,rw,auto,exec,nobootwait 0 0[/code]

The line added is:

UUID=10909D8B909D77C4 /hdd/windows7 auto user,rw,auto,exec,nobootwait 0 0[/code]

The following script can be run from the command line to get the Geo location for any ip:

Format:

ipinfo [ipaddress] json false[/code]

#!/bin/sh
#
###
### For assistance, please visit forum.ipinfodb.com
#
# Created by Eric Gamache on 2009-05-26
# Version 1.0 by Eric Gamache -- 2009-06-04
# Version 1.1 updated by Marc-Andre Caron -- 2009-06-08 .. Added timezone
# Version 1.2 updated by Eric Gamache -- 2009-06-08 .. fix minors bugs.
# Version 1.3 updated by Marc-Andre Caron -- 2010-02-11 .. new timezone support, reduced complexity of the script.
#
# This script is provided "as is", with absolutely no warranty expressed or
# implied. Any use is at your own risk. Permission to use or copy this
# script for any purpose is hereby granted without fee. Permission to
# modify the code and to distribute modified code is granted, provided
# the above notices are retained, and a notice that the code was modified
# is included with the above copyright notice.
#
###############################################
####
####
####
URL="http://api.ipinfodb.com/v2/ip_query.php?key=[enteryourkey]&ip="
#
WGET_OPTION="=-b -q --wait=3 --waitretry=2 --random-wait --limit-rate=9578 "
WGET_AGENT="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
#
ERROR=0
#
###############################################
if [ "$1" = "" ]; then
ERROR=1
else
IP=$1
HTTP_LINK_XML="$URL""$IP""&output=xml&timezone="
HTTP_LINK_JSON="$URL""$IP""&output=json&timezone="
fi
##############
if [ "$2" != "" ]; then
if [ "$2" != "json" ] && [ "$2" != "xml" ] ; then
ERROR=1
fi
TYPE="$2"
else
ERROR=1
fi
##############
if [ "$3" != "" ]; then
if [ "$3" != "true" ] && [ "$3" != "false" ] ; then
ERROR=1
fi
TIMEZONE="$3"
else
ERROR=1
fi
###############################################

###############################################
if [ "$ERROR" != "0" ]; then
echo " "
echo " usage : $0 IP TYPE TIMEZONE"
echo " Where IP is the IP to check"
echo " TYPE is the output type (xml|json)"
echo " TIMEZONE is to show timezone data or not (false|true)"
echo " Big thanks to the team of IPInfoDB (http://ipinfodb.com)"
exit
fi
###############################################
#
TST_wget=`wget > /dev/null 2>&1`
#
ErrorLevel=$?
#
if [ "$ErrorLevel" != 1 ] ; then
echo " ----"
echo " wget not found; please install it for proper operation."
echo " ----"
exit
fi
###############################################
###############################################
#######
#######
if [ "$TYPE" = "json" ]; then
JSON_Info=`wget -qO- --user-agent="$WGET_AGENT" $HTTP_LINK_JSON"$TIMEZONE" 2>&1`
echo "$JSON_Info"
else
XML_Info=`wget -qO- --user-agent="$WGET_AGENT" $HTTP_LINK_XML"$TIMEZONE" 2>&1`
echo "$XML_Info"
fi[/code]