Friday, October 16, 2009

ASCII Character Chart with Decimal, Binary and Hexadecimal Conversions

Character Name

Char

Code

Decimal

Binary

Hex

Null

NUL

Ctrl @

0

00000000

00

Start of Heading

SOH

Ctrl A

1

00000001

01

Start of Text

STX

Ctrl B

2

00000010

02

End of Text

ETX

Ctrl C

3

00000011

03

End of Transmit

EOT

Ctrl D

4

00000100

04

Enquiry

ENQ

Ctrl E

5

00000101

05

Acknowledge

ACK

Ctrl F

6

00000110

06

Bell

BEL

Ctrl G

7

00000111

07

Back Space

BS

Ctrl H

8

00001000

08

Horizontal Tab

TAB

Ctrl I

9

00001001

09

Line Feed

LF

Ctrl J

10

00001010

0A

Vertical Tab

VT

Ctrl K

11

00001011

0B

Form Feed

FF

Ctrl L

12

00001100

0C

Carriage Return

CR

Ctrl M

13

00001101

0D

Shift Out

SO

Ctrl N

14

00001110

0E

Shift In

SI

Ctrl O

15

00001111

0F

Data Line Escape

DLE

Ctrl P

16

00010000

10

Device Control 1

DC1

Ctrl Q

17

00010001

11

Device Control 2

DC2

Ctrl R

18

00010010

12

Device Control 3

DC3

Ctrl S

19

00010011

13

Device Control 4

DC4

Ctrl T

20

00010100

14

Negative Acknowledge

NAK

Ctrl U

21

00010101

15

Synchronous Idle

SYN

Ctrl V

22

00010110

16

End of Transmit Block

ETB

Ctrl W

23

00010111

17

Cancel

CAN

Ctrl X

24

00011000

18

End of Medium

EM

Ctrl Y

25

00011001

19

Substitute

SUB

Ctrl Z

26

00011010

1A

Escape

ESC

Ctrl [

27

00011011

1B

File Separator

FS

Ctrl \

28

00011100

1C

Group Separator

GS

Ctrl ]

29

00011101

1D

Record Separator

RS

Ctrl ^

30

00011110

1E

Unit Separator

US

Ctrl _

31

00011111

1F

Space

32

00100000

20

Exclamation Point

!

Shift 1

33

00100001

21

Double Quote

"

Shift ‘

34

00100010

22

Pound/Number Sign

#

Shift 3

35

00100011

23

Dollar Sign

$

Shift 4

36

00100100

24

Percent Sign

%

Shift 5

37

00100101

25

Ampersand

&

Shift 7

38

00100110

26

Single Quote

39

00100111

27

Left Parenthesis

(

Shift 9

40

00101000

28

Right Parenthesis

)

Shift 0

41

00101001

29

Asterisk

*

Shift 8

42

00101010

2A

Plus Sign

+

Shift =

43

00101011

2B

Comma

,

,

44

00101100

2C

Hyphen / Minus Sign

-

-

45

00101101

2D

Period

.

.

46

00101110

2E

Forward Slash

/

/

47

00101111

2F

Zero Digit

0

0

48

00110000

30

One Digit

1

1

49

00110001

31

Two Digit

2

2

50

00110010

32

Three Digit

3

3

51

00110011

33

Four Digit

4

4

52

00110100

34

Five Digit

5

5

53

00110101

35

Six Digit

6

6

54

00110110

36

Seven Digit

7

7

55

00110111

37

Eight Digit

8

8

56

00111000

38

Nine Digit

9

9

57

00111001

39

Colon

:

Shift ;

58

00111010

3A

Semicolon

;

;

59

00111011

3B

Less-Than Sign

<

Shift ,

60

00111100

3C

Equals Sign

=

=

61

00111101

3D

Greater-Than Sign

>

Shift .

62

00111110

3E

Question Mark

?

Shift /

63

00111111

3F

At Sign

@

Shift 2

64

01000000

40

Capital A

A

Shift A

65

01000001

41

Capital B

B

Shift B

66

01000010

42

Capital C

C

Shift C

67

01000011

43

Capital D

D

Shift D

68

01000100

44

Capital E

E

Shift E

69

01000101

45

Capital F

F

Shift F

70

01000110

46

Capital G

G

Shift G

71

01000111

47

Capital H

H

Shift H

72

01001000

48

Capital I

I

Shift I

73

01001001

49

Capital J

J

Shift J

74

01001010

4A

Capital K

K

Shift K

75

01001011

4B

Capital L

L

Shift L

76

01001100

4C

Capital M

M

Shift M

77

01001101

4D

Capital N

N

Shift N

78

01001110

4E

Capital O

O

Shift O

79

01001111

4F

Capital P

P

Shift P

80

01010000

50

Capital Q

Q

Shift Q

81

01010001

51

Capital R

R

Shift R

82

01010010

52

Capital S

S

Shift S

83

01010011

53

Capital T

T

Shift T

84

01010100

54

Capital U

U

Shift U

85

01010101

55

Capital V

V

Shift V

86

01010110

56

Capital W

W

Shift W

87

01010111

57

Capital X

X

Shift X

88

01011000

58

Capital Y

Y

Shift Y

89

01011001

59

Capital Z

Z

Shift Z

90

01011010

5A

Left Bracket

[

[

91

01011011

5B

Backward Slash

\

\

92

01011100

5C

Right Bracket

]

]

93

01011101

5D

Caret

^

Shift 6

94

01011110

5E

Underscore

_

Shift -

95

01011111

5F

Back Quote

`

`

96

01100000

60

Lower-case A

a

A

97

01100001

61

Lower-case B

b

B

98

01100010

62

Lower-case C

c

C

99

01100011

63

Lower-case D

d

D

100

01100100

64

Lower-case E

e

E

101

01100101

65

Lower-case F

f

F

102

01100110

66

Lower-case G

g

G

103

01100111

67

Lower-case H

h

H

104

01101000

68

Lower-case I

I

I

105

01101001

69

Lower-case J

j

J

106

01101010

6A

Lower-case K

k

K

107

01101011

6B

Lower-case L

l

L

108

01101100

6C

Lower-case M

m

M

109

01101101

6D

Lower-case N

n

N

110

01101110

6E

Lower-case O

o

O

111

01101111

6F

Lower-case P

p

P

112

01110000

70

Lower-case Q

q

Q

113

01110001

71

Lower-case R

r

R

114

01110010

72

Lower-case S

s

S

115

01110011

73

Lower-case T

t

T

116

01110100

74

Lower-case U

u

U

117

01110101

75

Lower-case V

v

V

118

01110110

76

Lower-case W

w

W

119

01110111

77

Lower-case X

x

X

120

01111000

78

Lower-case Y

y

Y

121

01111001

79

Lower-case Z

z

Z

122

01111010

7A

Left Brace

{

Shift [

123

01111011

7B

Vertical Bar

|

Shift \

124

01111100

7C

Right Brace

}

Shift ]

125

01111101

7D

Tilde

~

Shift `

126

01111110

7E

Delta

D

127

01111111

7F

Source : http://www.pcguide.com/res/tablesASCII-c.html

Wednesday, October 14, 2009

Printing char value in binary mode at C programing language

Print a char value(ch variable here) in binary:
printf("%c%c%c%c%c%c%c%c",
(bitMap[i]&0x80)?'1':'0',
(bitMap[i]&0x40)?'1':'0',
(bitMap[i]&0x20)?'1':'0',
(bitMap[i]&0x10)?'1':'0',
(bitMap[i]&0x08)?'1':'0',
(bitMap[i]&0x04)?'1':'0',
(bitMap[i]&0x02)?'1':'0',
(bitMap[i]&0x01)?'1':'0');
__________________

Monday, October 12, 2009

VHDL Operators

** exponentiation, numeric ** integer, result numeric
abs absolute value, abs numeric, result numeric
not complement, not logic or boolean, result same

* multiplication, numeric * numeric, result numeric
/ division, numeric / numeric, result numeric
mod modulo, integer mod integer, result integer
rem remainder, integer rem integer, result integer

+ unary plus, + numeric, result numeric
- unary minus, - numeric, result numeric

+ addition, numeric + numeric, result numeric
- subtraction, numeric - numeric, result numeric
& concatenation, array or element & array or element,
result array

sll shift left logical, logical array sll integer, result same
srl shift right logical, logical array srl integer, result same
sla shift left arithmetic, logical array sla integer, result same
sra shift right arithmetic, logical array sra integer, result same
rol rotate left, logical array rol integer, result same
ror rotate right, logical array ror integer, result same

= test for equality, result is boolean
/= test for inequality, result is boolean
< test for less than, result is boolean
<= test for less than or equal, result is boolean
> test for greater than, result is boolean
>= test for greater than or equal, result is boolean

and logical and, logical array or boolean, result is same
or logical or, logical array or boolean, result is same
nand logical complement of and, logical array or boolean, result is same
nor logical complement of or, logical array or boolean, result is same
xor logical exclusive or, logical array or boolean, result is same
xnor logical complement of exclusive or, logical array or boolean, result is same

Source

Sunday, October 11, 2009

Keyboard shortcuts for Copy, Cut and Paste

Copy keyboard shortcut : Ctrl + c
Cut keyboard shortcut : Ctrl + x
Paste keyboard shortcut : Ctrl + v
you have to hold Ctrl keyboard and then press the following key ...

Thursday, October 08, 2009

Find Your Mac OS X Version

The first step in securing your Mac is to know what OS version is installed. Use the following steps to find your Mac OS X version.
  1. From the Apple menu, select About This Mac.
  2. The version number will appear in the window.

Source for both picture & text(http://www.cmu.edu)

Wednesday, September 30, 2009

chmod Recursive permission change (i.e. in the directory and its sub-directories)

If you have a folder with a lot of files and sub-folders inside it and you want to change permission on all the files, then you should run chmod command(changing permission to xxx) with a -R at the end.

chmod -R 777 (folder name)

in case you got the error that you do not have permission, you have to login as root(su command and then password)at Ubuntu run :

sudo chmod -R 777 (folder name)

Tuesday, September 29, 2009

compiling and installing software from Source Code

Some software is distributed in "Source form". This means you download a file containing all the source code for the application you want to install, unpack it, and compile it on your system. Compiling is the process of turning the source code into an executable binary. The common myth and newbie assumption is that this is very hard todo, or it is only for programmers. Wrong. It is a fairly straight forward process, and you will find that a lot of software you install will need to be built from source.

Typically applications you must compile from source will come as a ".tar.gz", ".tar.bz2", or ".zip" file.

You'll probably want to operate from inside your home directory. If your user is (for example) username, your home directory will be /home/username/. For the rest of this section we will assume you have downloaded your zip file to /home/username/src. If you do not have a src directory, you can create it with the following "mkdir" (make directory) command:

Code:
mkdir /home/username/src/
So, we have our source package in /home/username/src/.

Change to the /home/username/src/ directory with the "cd" (change directory) command like so:

Code:
cd /home/username/src/
Use the "ls" (list directory contents) command, to see the file is present:

Code:
ls

We now need to unzip the zipped file, this is done differently depending on the file extension.

for files ending in .tar.gz, use:
Code:
tar -zxvf 
(replacing with the name of the file).

for files ending in .tar.bz2, use:
Code:
tar -jxvf 
for files ending in .zip, use:
Code:
unzip 
You should now have a new directory, containing all of the source files. To confirm it exists, and to get its name, use the "ls" command again.
Code:
ls
we now need to go into the new directory, so use the cd command:
Code:
cd 



This is where things will differ. Some packages will have an INSTALL or README file which will contain installation instructions. use "ls" to see if the software has an install or readme file. If it does have one, you can use the "more" command to read it, like so:
Code:
more INSTALL
Generally, the final 3 stages are as follows:
- Configure the installation
- Compile the software
- Install the binaries

The pre-installation configuration is done by executing ./configure:
Code:
./configure
This will perform some requirements testing on your system, and create a "Makefile" which will explain to the "make" utility how the software should be compiled. If you receive any error messages during this stage, you may wish to search the forums to see if they have been found and resolved by someone else already, if not, feel free to post a question on the forums - Please include all of the output including any error messages, and some details about your system - what distro you are using, what are you trying to install etc etc


The next stage is to compile the software, this is done using "make". When you run "make" it will read the instructions in the Makefile and build the application binaries.
Code:
make

The final stage is to install these binaries, ie, copy them to a more permanent location. Typically only the "root" user can do this, so you will need to swich to the root user with the "su" command:
Code:
su
Once you are root, install the binaries using the "make" command, followed by "install", like so:
Code:
make install
That is it! Check the user documentation of the software you installed for details of how to run the application.

Remember that if you have any problems, please post in the most relevant section of the forums. - When posting, remember to include as much info as possible, including all output and error messages.
SOURCE

Special characters, Java ...

If you are wondering how to check special characters in Java with a char variable,you can look @ the meaningless program down here.This program just shows you how to compare special characters with a char variable.
/********************************************
*********************************************
********** Special Char check ***************
*********************************************
********************************************/
public void checkSpecialChar(String aText){
Char character = aText.charAt(0);

if (character == '<') {
System.out.println(aText);
}
else if (character == '>') {
System.out.println(aText);
}
else if (character == '&') {
System.out.println(aText);
}
else if (character == '\"') {
System.out.println(aText);
}
else if (character == '\t') {
System.out.println(aText);
}
else if (character == '!') {
System.out.println(aText);
}
else if (character == '#') {
System.out.println(aText);
}
else if (character == '$') {
System.out.println(aText);
}
else if (character == '%') {
System.out.println(aText);
}
else if (character == '\'') {
System.out.println(aText);
}
else if (character == '(') {
System.out.println(aText);
}
else if (character == ')') {
System.out.println(aText);
}
else if (character == '*') {
System.out.println(aText);
}
else if (character == '+') {
System.out.println(aText);
}
else if (character == ',') {
System.out.println(aText);
}
else if (character == '-') {
System.out.println(aText);
}
else if (character == '.') {
System.out.println(aText);
}
else if (character == '/') {
System.out.println(aText);
}
else if (character == ':') {
System.out.println(aText);
}
else if (character == ';') {
System.out.println(aText);
}
else if (character == '=') {
System.out.println(aText);
}
else if (character == '?') {
System.out.println(aText);
}
else if (character == '@') {
System.out.println(aText);
}
else if (character == '[') {
System.out.println(aText);
}
else if (character == '\\') {
System.out.println(aText);
}
else if (character == ']') {
System.out.println(aText);
}
else if (character == '^') {
System.out.println(aText);
}
else if (character == '_') {
System.out.println(aText);
}
else if (character == '`') {
System.out.println(aText);
}
else if (character == '{') {
System.out.println(aText);
}
else if (character == '|') {
System.out.println(aText);
}
else if (character == '}') {
System.out.println(aText);
}
else if (character == '~') {
System.out.println(aText);
}
else {
//the char is not a special one
//add it to the result as is
System.out.println(aText);
}
}//end of checkSpecialChar(String )
/********************************************
*********************************************
******* End of Special Char check **********
*********************************************
********************************************/
Edited from this source

You dont need to boot to check your eamil, FAST LINUX

Some time ago a company called DeviceVM started to embed Linux into the motherboards of personal computers with the objective to provide an alternative operating system that boots up in a few seconds.

The objective is not to replace the main operating system, which in most cases is still Microsoft Windows, but to enable users to perform common tasks, such as checking email, browsing the Internet, or making a VoIP call immediately after turning on the computer, without the painful process of waiting for the regular OS to be fully up and running.

ASUS has been adopting Splashtop early on and includes it now on most of its motherboards. It is incorporated in the flash memory firmware. Besides the Linux kernel, this includes drivers, networking tools, and various frequently used applications.

Saturday, September 26, 2009

RAR @ Fedora ...

By default, Rar is not available in Fedora 10. If all you need to do is extract files from a Rar archive, unrar from RPM Fusion's YUM repositories will work. If you need to create Rar archives, then you will have to download and install the complete Rar package from DAG. The instructions below show you how.

Only Need to Extract Files?

First, install RPM Fusion's free and nonfree YUM repositories. For detailed information about installing RPM Fusion, see: http://rpmfusion.org/Configuration

su -c "rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm"

su -c "rpm -Uvh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm"

Next, install the unrar packages from RPMFusion's nonfree repository.

su -c "yum install unrar"

Done! You now have unrar in /usr/bin/unrar. This binary can only extract files from Rar archives. Use this command to see all available options:

/usr/bin/unrar -?

Need to Create Rar Archives?

First, download the source RPM from DAG: http://dag.wieers.com/rpm/packages/rar

wget -c http://dag.wieers.com/rpm/packages/rar/rar-3.5.1-1.rf.src.rpm

Now, install the source RPM. This will create a $HOME/rpmbuild tree. Please note that you do not need to be root.

rpm -iv rar-3.5.1-1.rf.src.rpm

Next, build a binary package in $HOME/rpmbuild. Again, no need to be root.

rpmbuild -bb ~/rpmbuild/SPECS/rar.spec

Finally, install the built RPM as root:

su -c "rpm -Uvh $HOME/rpmbuild/RPMS/$(arch)/rar-3.5.1-1.rf.x86_64.rpm"

Done! You now have rar in /usr/bin/rar. This binary can build and extract Rar files. Use this command to see all available options:

/usr/bin/rar -?

Thursday, September 24, 2009

Flash Fix @ Ubuntu ...

My flash If you want to completely remove all flash plugins(& install again later), run the following command and then delete the related plugins inside ~/.mozilla/plugins, if there are any:

Code:
sudo apt-get remove swfdec-mozilla
sudo apt-get remove mozilla-plugin-gnash
sudo apt-get remove adobe-flashplugin
sudo apt-get remove flashplugin-nonfree
Keep in mind this will also remove flash plugin from Opera, since it's not Firefox that installed the flash plugin. The flash plugin installation is generic for all browsers.

Nevertheless, I believe your problems is due to conflicting plugins. So before trying to remove all flash plugins, try this(IT WORKED FOR ME):

Code:
sudo apt-get remove swfdec-mozilla
sudo apt-get remove mozilla-plugin-gnash
sudo apt-get remove adobe-flashplugin
sudo apt-get remove flashplugin-nonfree
sudo apt-get install flashplugin-nonfree
From my experience, flash does not play well on any browser. Nevertheless, you might experience better performance with Firefox 3.5.3, which is faster than Opera. The alpha releases of Chromium and Firefox 3.6.1a are the best for flash.

You can also try to improve your flash experience using my tutorial Firefox optimization and troubleshooting thread.
Source : Ubuntu Forums

Wednesday, September 23, 2009

List of installed programs or packages on Ubuntu

List installed (ii) programs (packages):
$ dpkg -l

$ dpkg -l | less

$ dpkg -l | grep nano

See also
$ ls -l /usr/bin | less

$ man dpkg

Setting up gmail account

Got trouble setting up your Google account with default(most of linux distrobutions) Evolution Email client ?

If so, check this tutorial out ...

Tip before reading : My problem was that the gmail account is not just your account name but the full Gmail email address(account@gmail.com)

Monday, September 14, 2009

Removing a printer @ VISTA

HINT : Don't bother yelling at the printer why the hell that you can not remove it !!! Do not blame Vista for it like I did neithere !!! Do not curse Microsoft neithere ... Simply printer has hanged somewhere and there are some documents still in the queeue(My case, other users had it, so I could not see it) and that's the reason you dont get to remove it ...

Microsoft hint : You can't remove a printer if you have items in the print queue. If items are waiting to print when you try to remove a printer, Windows will wait until printing is complete, and then remove the printer. If you have permission to manage documents on the printer, you can also cancel all print jobs and then try to remove the printer again.

Tuesday, September 08, 2009

Automatically Mounting Windows SMB Shares in Ubuntu v3

This post was something I was looking for a long time, to make some shared windows disks auto mounted on my Linux ... I found this today and I posted it on my weblog as well(with sourcing back to the main article) to have it for future use ... Here is kind of my online notebook, that I share with all the people all around the world ;-) and this note is one of the most useful ones ...
------------------------------------------------------------
This post is an update to two posts I wrote previously on how to make your network shares mount automatically when you start up your Ubuntu Linux computer. In this method we modify the fstab file so that when all the file systems are mounted the network shares are mounted as well.

This method works for me in Ubuntu Gusty Gibbon 7.10 and is probably the most secure. I have only tested this on a wired connection, so I don’t know exactly what will happen if you use this method when using a wireless connection.

First you have to install smbfs:

sudo apt-get install smbfs

Then create a folder inside of the /media directory to mount the share on:

sudo mkdir /media/Storage

You can call it whatever you want, I call it Storage. If you change the name remember to change it below when we edit the fstab file.

Create a credentials file in /root so that you can save your password and have it protected by the root account:

sudo gedit /root/.cifscredentials

Add the following information to the file, but change Guest to your SMB username and add your SMB password.

username=Guest
password=

Note: If your fileserver allows Guest access you can just leave the file as above. If it is password protected you have to put in your username and password.

Save and close the .cifscredentials file.

Now open up your fstab file so that you can add mounting instructions:

sudo gedit /etc/fstab

Add the following line to the bottom of the file:

//192.168.0.10/SHARENAME /media/Storage cifs auto,iocharset=utf8,uid=USER,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0

You have to change the following information:
Change 192.168.0.10 to the IP address or DNS name of your server
Change SHARENAME to the share you want to mount
Change USER to your Ubuntu username

The file_mode=0775,dir_mode=0775 part sets the mounted directory as read/write for all users so long as the SMB username you set in .cifscredentials has read/write access.

Now save the file and run the following command to test to see if you mount now works:

sudo mount -a

If that worked you should see a new drive icon on your desktop that lets you access your share. Now try rebooting and see if your shares mount automatically. If everything went as planned you will have a nice little drive mounted on your desktop every time you start up.

SMB Shares with Spaces in the Names

If you have a share with a space in the path you can replace the space with \040. For example:

//192.168.0.10/Storage\040130 /media/Storage\040130 cifs auto,iocharset=utf8,uid=matt,gid=users,credentials=/root/.cifscredentials,file_mode=0775,dir_mode=0775 0 0

This mounts my 130GB drive on my fileserver to a local directory called Storage 130.

SOURCE

Saturday, September 05, 2009

VLC on Feodra ...

$> su -
#> rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
#> yum install vlc
#> yum install mozilla-vlc (optionnal)