Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts

Sunday, April 03, 2011

Basic linux commands

List down my basic linux commands as my reference

Basic
  • cd  folder      
  • cd ..
  • cd ../..
  • pwd       -->show path
  • man xx  -->manual of command xx (eg: man rm)
  • cp          --> copy
  • rm -rf    -->force to remove (-f), including directory (-r)
  • rm -i      -->remove with prompt
  • mv x1 x2 -->rename or move file into a directory
  • uname -a -->check linux version & machine info (print system information)
  • du -ah .  -->check total used disk space
  • df -ah .   -->check disk usage, can know total used & available free disk space
  • top         --> to check processes that are running 
  • jobs
  • ps           --&gt show running process
  • grep xx    --> to grep xx from a file or process
  • kill -9  PID --> kill the process with PID number, which can get from top
  • ln -s xx1 xx2  -->soft link command 
  • usermount    --> A graphical tool to mount, unmount and format filesystems
  • cd /mnt/      -->mount directory
  • cd /media/  --> media mounted directory eg usb
  • pushd
  • popd



editor
  • vi
  • vim
  • nedit
  • emacs
  • tkdiff    (make comparison between two files)


 Tar command
  • man tar
  • tar -xvf    file.tar
  • tar -xvfz  file.tar.gz
  • tar -xvfj   file tar.bz2
  • tar -cvf    create.tar   folder/
Admin

  • su           -->super user (root)
  • sudo  xx --> 
  • ldd      -->check dynamic link  (eg #ldd /usr/bin/vim)
  • rpm -ivh xxx.rpm
  • yum install  xxx 
  • yum search xxx


network 
  • /sbin/ifconfig     -->showing network
  • /sbin/iwconfig   -->showing wireless network
  • /sbin/iwlist       --> list of wireless network 
  • ping www.google.com
To restart network:
type # /etc/init.d/network restart

To start Linux network service:
# /etc/init.d/network start

To stop Linux network service: [type whole path]
# /etc/init.d/network stop


#/sbin/service network restart


setup hosts

vi /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
127.0.0.1               circuit.localdomain circuit

alternative way

vi /etc/sysconfig/network

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME="circuit "



.bashrc   or .cshrc

add this
  •  export PATH=$PATH:/sbin:/usr/sbin         #will include /sbin/ command like ifconfig

Install program path
It is better to save into this path because all user can use them
  • /usr/local/bin/


Boot file
  • store in /boot/grub
 Auto Mount file
  • /etc/fstab
 LABEL=/                 /                       ext3    defaults        1 1
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-sda7         swap                    swap    defaults        0 0
/dev/sda8               /app                    ext3    defaults        0 0
/dev/sda3               /mnt/win_c              ntfs-3g auto    0 0
/dev/sda5               /mnt/win_f              ntfs-3g auto    0 0

 secure copy
  • scp -r directory_tobe_copy username@my_local_pc_IP:.  ( "." to home )
  • scp -r directory_tobe_copy username@my_local_pc_IP:/app/.  ( copy to /app/ ) 
  • scp -r directory_tobe_copy my_local_pc_IP:/app/.  ( same username & copy to /app/ )
  SSH
  • ssh username@remote_pc_IP  (diff username)
  • ssh remote_pc_IP       (same username)

VNC
download realvnc from webpage
untar it to install

enable gnome in vnc

cd .vnc
vi xstartup

add the following change in the last line

#twm &  (commend out the twm by)
exec gnome-session &   (add this)


VI

Sunday, February 07, 2010

Setup Linux Wireless Access WPA_supplicant

I would like to post how I managed to get internet connection in my Linux CentOS 5.4 environment. I have spent many times to figure out the setup since I am new in linux wireless. Before this, I also encounter problem to install Broadcom BCM4328 driver in my linux too (headache). Over here I only focus on wireless setup for WPA (WiFi Protected Access) wireless access point. Do not confuse WPA with either WAP (wireless access point) & WEP (Wired Equivalent Privacy). WPA is intended to replace old WEP system due to the poor security reason. It can be easily sniff in with aircrack-ng, which is a prevalent hacking too to grab password/key. However WPA can be also cracked by aircrack easily... I still do not know yet.





To access wireless with WEP encription, the conventional method.
My wireless setup is eth1 (yours might be eth0, wlan0, etc)
If you cannot use the command, then add /sbin/ before the command
example: #sudo /sbin/iwlist eth1 scanning

1. #sudo iwlist eth1 scanning [to scan available wireless access]

eth1 Scan completed :
Cell 01 - Address: 00:55:55:B7:55:0C
ESSID:"myhomewireless"
Mode:Managed
Frequency:2.462 GHz (Channel 11)
Quality:4/5 Signal level:-63 dBm Noise level:-90 dBm
IE: WPA Version 18960
Group Cipher : Proprietary
Pairwise Ciphers (68) : IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (1) : TKIP
Authentication Suites (1) : PSK
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s; 6 Mb/s; 9 Mb/s
12 Mb/s; 48 Mb/s

From here, it is clearly shown that it is a WPA encription and not WEP

2. #sudo iwconfig essid myhomewireless key s:string_of_wep_password
The "s:" to indicate string instead of hexa values

it prompted me :
Error for wireless request "Set Encode" (8B2A) :
SET failed on device eth1 ; Invalid argument.

it is due to the router uses WPA instead of WEP key

3. #sudo iwconfig [to check whether I have connected to
myhomewireless]
lo no wireless extensions.

eth0 no wireless extensions.

eth1 IEEE 802.11abgn ESSID:"
myhomewireless" Nickname:"localhost.localdomain"
Mode:Ad-Hoc Frequency:2.412 GHz Cell: 1A:87:D5:5F:B9:8F
Bit Rate=2 Mb/s Tx-Power:32 dBm
Retry min limit:7 RTS thr:off Fragment thr:off
Power Managementmode:All packets received
Link Quality=5/5 Signal level=-57 dBm Noise level=-89 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

sit0 no wireless extensions.


Although it has been connected to the intended essid but i still cannot browse internet!!!

4. #dhclient eth1 [to automatically get IP]

-----------------------------------------------------------------------
In order to access WPA, few thing need to be setup
Change to superuser by #su

1.
#cd /etc/wpa_supplicant
# cp wpa_supplicant.conf wpa_supplicant.conf.origin [backup the original one]
# vi wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
ssid="
myhomewireless"
key_mgmt=WPA-PSK
psk="
string_of_wpa_password"
}


Note: need to put " "

2.
make association
#wpa_supplicant -B -dd -ieth1 -c /etc/wpa_supplicant/wpa_supplicant.conf

Note: sometime cannot override the file because the file is in use. Can delete the file in /var/run/wpa_supplicant/eth1 & execute step2 again.


3.
#dhclient eth1
[to automatically get IP]

4. invoke browser like firefox. Cheer!!

------------------------------------------------------------

If still cannot connect, mostly due to previous setup.
check
1. vi /etc/sysconfig/network-scripts/keys-eth1 [make sure it is blank, it stores WEP password]

2. vi /etc/sysconfig/network-scripts/ifcfg-eth1

# Broadcom Corporation BCM4328 802.11a/b/g/n
DEVICE=eth1
BOOTPROTO=dhcp
ONBOOT=no
HWADDR=00:22:68:c0:c5:81
NETMASK=
DHCP_HOSTNAME=
IPADDR=
BONDING_OPTS=
DOMAIN=
MASTER=
TYPE=Wireless
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ESSID=
myhomewireless
CHANNEL=
MODE=Master
SECURITYMODE=off
RATE=auto

Just make sure correct essid & mode to Master.
Setup the mode to Master, since I use WAP encription for dedicated router (not multiple router)
------------------------------------------------
after restart the linux, here are the step

1. #su
2. #iwlist eth1 scanning
3. #wpa_supplicant -B -dd -ieth1 -c /etc/wpa_supplicant/wpa_supplicant.conf
4 #dhclient eth1
5 #firefox &

---------------------------------------

Hope it helps!! cheers!

Tuesday, January 12, 2010

Cannot dual boot after reinstalling Window Vista

Last week, I tried to reinstall Window Vista in my Dell Vostro 1510 laptop because I found it very slow and I guess there were some systems corrupted. I also found that Window Vista allow reinstall Window without deleting old data file (not choosing formatting harddisk). The system will put all files into a folder named Window.old. Later I got to manually delete those folders in Window.old because they take up a lot of disk space. Besides this, I got to reinstall all the programs again.

After that, I realized my laptop not able to dual boot as I got before this. I used to have Window and Linux dual boot system. After some searching and try out. Here are the steps.

1. Prepare a Linux bootable CD. I used CentOS, which are same to RedHat Enterprise version. Reboot laptop.

2. In the linux screen, choose F5 and type "linux rescue". It is easier step since the CD will auto-mount the Linux that I installed previously.

3. Choose Language, keyboard setting. Choose no network setup.

4. It comes to rescue environment setup. "The rescue environment will now attempt to find your Linux installation and mount it under the directory /mnt/sysimage"
Choose continue

5. After that, you will reach a terminal. Type: chroot /mnt/sysimage . Before this, the user name is unknow (can check by whoami command). After the chroot /mnt/sysimage command, you can recheck who is the user again by whoami command.

6. type:
sudo grub [go to the grub> prompt]
find /boot/grub/stage1 [it shows the first stage system -->showing (hd0,5) for my setup
root (hd0,5) [type according to the previous result]
setup (hd0) [reinstall grub into hd0,5]
quit [exit]
quit [reboot]

7 reboot the system. Can see the dual boot page.



Tuesday, April 07, 2009

USB3 Super Speed 5Gbps (10x faster than USB2.0

USB3.0 Logo with SuperSpeed

USB (universal serial bus) is one of the most sucessful device that can live up today because of its portablity and low cost. Recently, USB3 specification (Rev 1.0) had been released by www.usb.org in Nov 2008. It is a exciting news which I have been waiting, because I was working with USB design when I was working in Intel. This new USB3 transfer rate is 5Gbps, which is around 10x faster than USB2.0 (480Mbps), and it is dubbed with Super Speed to distinguish with High-Speed in USB2.0. In other words, bulky file sizes like video can be transferred in short period. Besides this, it is also backward compatible to USB2.0 (480Mbps High-Speed) and USB1.1 (12Mbps Full-Speed and 1.5Mbps Low-Speed). In other advantage is that it supports bidirectional transfer as shown in the USB3 stylish logo with two opposite arrows. It employs dual-simplex way to achieve bidirectional transfer.

Pat Gelsinger (Intel’s Senior Vice-President) displayed USB3.0 (source: apcmag.com)

USB3.0 using optical link

Initially USB3.0 used optical link which can easily achieve good signal quality. However, due to higher production cost, it was dropped off. It uses normal electrical cables with one UTP (unshielded twisted pair) and 2 sets of SDP (shielded differential pair).

USB3.0 cable

In order to support bidirectional transfer by dual-simplex structure, USB connector comprises 5 additional pins. They are Rx differential plus and minus pins, Tx differential plus and minus pins, and ground drain pins sitting at the middle of of Tx and Rx links as shown in the diagram below. This ground drain pin serve as current return path to Tx and Rx links and provides sheilding effect between Tx and Rx. Of course, due to backward compatible, it also contains the old version pins which are D+, D-, Power and Ground pins. They are 9 pins in total. (therefore backward compatible is kinda costly)


USB3.0 type A connector

Apart from that, USB3 no longer implements polling technique as in USB2.0. Polling techniques is like the USB host controller is always asking or checking for data at the down stream (mainly because USB is host initiative). It generates some traffic, therefore power consumption cannot be reduced althought in idle mode. USB3 uses asynchronous traffic flow resulting in power saving in idle mode.

In the physical layer, it uses 8B10B coding and AC coupling as in PCIe. Some people said USB3.0 just like a mini PCIe version. There is a clock and data recovery specification to be complied. Besides this, it requires to support spread spectrum clocking SSC due to EMI concerns.

As in the electrical signalling, Tx and Rx employ current-mode driver with deemphasis requirement. The Tx has two modes, they are full-swing mode and low-power mode. In the low-power mode, the Tx can allow to send low swing to reduce power consumption.

For more information, you could download the specification from www.usb.org

Saturday, January 31, 2009

CentOS

Dell Vostro 1510 Laptop

Last few days, I installed CentOS Linux into my Dell Vostro 1510 laptop. Initially I intended to install Redhat Enterprise Linux (RHEL) Version 5 but I didn't. Why did I opt for CentOS over the other Linux distribution? It was mainly because I just followed my friend advice who was expert in Linux. He said that CentOS Kernel was exactly same and compatible to Redhat Enterprise Linux version. Some more it was completely free and allowed users to make Linux update. It was my first time to install linux into my own laptor with dual boot system.

Prepare to install CentOS

What are the steps?
  1. First, download the latest CentOS ISO file (4.2Gbytes) from www.centos.org, choosing x86_64.
  2. After that burn the ISO file into DVD.
  3. Of course, have to make sure there are free space in my harddisk. I allocated about 40Gbytes for that.
  4. Put the DVD into DVD rom and restart my laptop. (have to make sure that the first boot is using DVD rom instead of hard disk. You may choose it in BIOS setup)
  5. then the start up screen will be appeared. press enter to proceed.
  6. To test the DVD, you can skip it if you are sure that the DVD is workable
  7. Choose language...
  8. Choose "use free space on selected drives and create default layout" to install if you do not plan to customize harddisk (the easiest method)
  9. then just click on forward button... pretty easy in fact.. along the way, the system will ask you to insert root password
Welcome page (1st time log in)

My CentOS desktop

After that, I have to modify a file in /etc/boot/grub/grub.conf so that I can make my laptop dual boot. To do so, I have to be root user (type su in terminal).



Have fun :)

Wednesday, January 21, 2009

Anandtech.com & Tom hardware


I would like to introduce a good webpage called Anandtech- your source of hardware analysis and news. It always publishs the latest news about computer related products such as microprocessors, chipsets, memories, video cards, motherboards, digital cameras news. Besides this, it also makes product comparisons, for example, the comparison of micoprocessor performance in between Intel and AMD. The more impressive words about the stiff competition is "The return of the Jedi". Moreover, the website also gives comments and introduction about computer products.

GeForce GTX 285


45nm Phenom II X4 940 at 3.0GHz and the 920 at 2.8GHz

Nahalem Architecture

Nahalem Chip Floorplan

If you are computer mania then it is a good site to keep abreast of computer latest development.

Source of the above pictures: anandtech.com


The other good website about computer news and products is Tom's Hardware. The specialty of the site is doing some strange tests on mircoprocessor. Besides this, it also guides you how to overclock microprocessors .

Microprocessor too hot? (source: tomhardware)

Required giant fan to cool down processor? who makes processor angry? (source: tomhardware)


stress test on AMD and Intel processors (source: tomhardware)

I personally think that Anadtech is much better than Tom's hardware because it give more relevent information. But sometime, I do check on Tom's hardware to see some weird stuff..

endless battle between AMD and Intel

Thursday, November 20, 2008

How to open .pps file in Power Point Form

There is a way to open .pps file into non-slideshow form as you open .ppt files. Do you know what .pps file is? It is a slide show format file when you open it.

The actual way is plain and easy. Just open microsoft power point programme and then open the .pps file from the programme. It will be in non-slideshow format. Got it?