Wednesday, September 24, 2008

compress decompress files in Linux

http://linuxtuts.blogspot.com/2008/02/handling-archives-in-linux.html
 How to compress/decompress files in Linux.
Zip files
To compress of decompress zip files you must have the following programs installed in your computer

zip to compress files
unzip to decompress files

here are the commands
to zip a single file

$zip archive_name.zip file_name 

to zip a single folder use the folder name instead of file_name

$zip -r archive_name.zip folder_name 

to zip multiple files use

$zip archive_name.zip file1 file2 file3 file4 file5 

you can also zip a combination of files and folders into one zip file like this

$zip -r archive_name.zip file1 file3 file4 folder_name1/ folder2/ folder3/ 

to unzip a file u need unzip program installed in your system

$unzip file.zip

to view data in the zip file use

$unzip -v file.zip

Rar files
You need the rar program from rarlabs.com to compress/decompress these files or you can use unrar or unrar-nonfree packages

$rar -a file.rar /folder/

to uncompress use

$rar -x file.rar

to view the data in the file use

$rar -v file.rar

Tar Files
to compress files into a tar archive use

$tar cvf file.tar folder/ *

to unpack or to uncompress us

$tar -xvf file.tar

to view data in the tar file use

$tar -tvf file

Here the 'v' is optional, it just gives verbose output

Tar.gz files
to compress into .tar.gz use

$tar czvf file.tar.gz folder

to uncompress use

$tar xzvf file.tar.gz

to view data in the tar.gz file use

tar tzvf file.tar.gz

bz2 files
to compress into bz2 format use bzip2

$bzip2 file

above command will create an archive named file.bz2. Also bz2 works on only files.
So if you want to compress a folder you have to pack it into a tar file first and use bzip2 on it.
to uncompress or unpack use

$bzip2 -d file.bz2

tar.bz2 files
to compress into a tar.bz2 file use

$tar cjvf file.tar.bz2 folder

to uncompress tar.bz2 files use

$tar -xjvf file.tar.bz2

to view data in the file use

$tar -tjvf file.tar.bz2

Friday, September 19, 2008

gentoo install from harddisk

dig from gentoo install guide
http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml

grub load untared minimal live cd

======

1. for windows system (fat32): install grub for dos
cp grld to C:\
add "c:\grldr="grub"" to the last of boot.ini file

2. configure menu.lst
need to uncompress *.sqashfs folder to partition
uncompress isolinux folder
set it to :

kernel (hd0,0)/boot/gentoo/gentoo root=/dev/ram0 init=/linuxrc dokeymap
looptype=squashfs loop=/image.squashfs cdroot vga=791
splash=silent,theme:livecd-2007.0 CONSOLE=/dev/tty1 nox
initrd (hd0,0)/boot/gentoo/gentoo.igz


c:\boot.ini
c:\grldr
c:\menu.lst
c:\boot\gentoo\gentoo
c:\boot\gentoo\gentoo.igz
x:\livecd
x:\image.squashfs


if it is grub for linux , just need to set menu.lst file correctly.


(The following specs and the timing information should help you determine
a rough estimate of the time you need to complete your install)


# grep bogo /proc/cpuinfo
bogomips : 3337.81

# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 1100 MB in 2.00 seconds = 549.97 MB/sec
Timing buffered disk reads: 224 MB in 3.01 seconds = 74.36 MB/sec

# grep MemTotal /proc/meminfo
MemTotal: 509248 kB


livecd root # ifconfig eth0 192.168.1.10/24
livecd root # route add default gw 192.168.1.1
livecd root # echo nameserver 192.168.1.1 > /etc/resolv.conf



(ext2 is all you need on the /boot partition)
livecd ~ # mke2fs /dev/sda1

(Let's use ext3 on the main partition)
livecd ~ # mke2fs -j /dev/sda3

(Create and activate swap)
livecd ~ # mkswap /dev/sda2 && swapon /dev/sda2



livecd ~ # mount /dev/sda3 /mnt/gentoo
livecd ~ # mkdir /mnt/gentoo/boot
livecd ~ # mount /dev/sda1 /mnt/gentoo/boot
livecd ~ # cd /mnt/gentoo


Howto make partition changes visible to the kernel without reboot

(very important if you cannot reboot your system but changed partition during installation )

Install parted in debian

#apt-get install parted

Now this will install partprobe and parted.Partprobe inform the OS of partition table changes. partprobe is a program that informs the operating system kernel of partition table changes, by requesting that the operating system re-read the
partition table.

Syntax

partprobe [-d] [-s] [devices...]

-d Donât update the kernel.
-s Show a summary of devices and their partitions.
-h Show summary of options.
-v Show version of program.

Using partprobe

#partprobe

(Check the clock)
livecd gentoo # date
Mon Mar 6 00:14:13 UTC 2006

(Set the current date and time if required)
livecd gentoo # date 030600162006 (Format is MMDDhhmmYYYY)
Mon Mar 6 00:16:00 UTC 2006

livecd gentoo # links http://www.gentoo.org/main/en/mirrors.xml
(Pick a mirror, move to the releases/x86/2008.0/stages/ directory, highlight the
stage3 of your choice, probably the i686 stage3 and press D to download it)


(Or download it directly with wget without choosing a nearby mirror)
livecd gentoo # wget ftp://gentoo.osuosl.org/pub/gentoo/releases/x86/2008.0/stages/stage3-i686*tar.bz2

livecd gentoo # time tar xjpf stage3*

real 1m14.157s
user 1m2.920s
sys 0m7.530s

livecd gentoo # cd /mnt/gentoo/usr
livecd usr # links http://www.gentoo.org/main/en/mirrors.xml
(Pick a mirror, move to the snapshots/ directory,
highlight portage-latest.tar.bz2 and press D to download it)


(Or download it directly with wget without choosing a nearby mirror)
livecd gentoo # cd /mnt/gentoo/usr
livecd usr # wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2

livecd usr # time tar xjf portage-lat*

real 0m40.523s
user 0m28.280s
sys 0m8.240s

livecd usr # cd /
livecd / # mount -t proc proc /mnt/gentoo/proc
livecd / # cp -L /etc/resolv.conf /mnt/gentoo/etc/
livecd / # chroot /mnt/gentoo /bin/bash
livecd / # env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...


livecd / # ls /usr/share/zoneinfo
(Using Brussels as an example)
livecd / # cp /usr/share/zoneinfo/Europe/Brussels /etc/localtime

livecd / # date
Wed Mar 8 00:46:05 CET 2006

livecd / # cd /etc
livecd etc # echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts
livecd etc # sed -i -e 's/HOSTNAME.*/HOSTNAME="mybox"/' conf.d/hostname
(Use defined host name and check)
livecd etc # hostname mybox
livecd etc # hostname -f
mybox.at.myplace



livecd etc # time emerge gentoo-sources

real 2m51.435s
user 0m58.220s
sys 0m29.890s
livecd etc # cd /usr/src/linux
livecd linux # make menuconfig
(Configure your kernel)
livecd linux # time make -j2

(Elapsed time depends highly on the options you selected)
real 3m51.962s (so fast ........ impossible .... -_-! )
user 3m27.060s
sys 0m24.310s





livecd linux # make modules_install
livecd linux # cp arch/i386/boot/bzImage /boot/kernel


livecd linux # cd /etc
livecd etc # nano -w fstab
/dev/sda1 /boot ext2 noauto,noatime 1 2
/dev/sda3 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0



livecd etc # cd conf.d
livecd conf.d # echo 'config_eth0=( "192.168.1.10/24" )' >> net
livecd conf.d # echo 'routes_eth0=( "default via 192.168.1.1" )' >> net
livecd conf.d # rc-update add net.eth0 default
(If you compiled your network card driver as a module,
add it to /etc/modules.autoload.d/kernel-2.6)

livecd conf.d # echo r8169 >> /etc/modules.autoload.d/kernel-2.6
(If you want to reconnect via ssh after you have rebooted your new box)
livecd conf.d # rc-update add sshd default




livecd conf.d # passwd
New UNIX password: type_the_password
Retype new UNIX password: type_the_password_again
passwd: password updated successfully



livecd conf.d # nano -w /etc/conf.d/clock
TIMEZONE="Europe/Brussels"


livecd conf.d # nano -w /etc/rc.conf
livecd conf.d # nano -w /etc/conf.d/rc
livecd conf.d # nano -w /etc/conf.d/keymaps





livecd conf.d # time emerge syslog-ng vixie-cron

real 1m54.099s
user 1m2.630s
sys 0m34.620s
livecd conf.d # rc-update add syslog-ng default
livecd conf.d # rc-update add vixie-cron default


livecd conf.d # emerge xfsprogs (If you use the XFS file system)
livecd conf.d # emerge jfsutils (If you use the JFS file system)
livecd conf.d # emerge reiserfsprogs (If you use the Reiser file system)
livecd conf.d # emerge dhcpcd (If you need a DHCP client)
livecd conf.d # emerge ppp (If you need PPPoE ADSL connectivity)

livecd conf.d # time emerge grub

real 1m4.634s
user 0m39.460s
sys 0m15.280s
livecd conf.d # nano -w /boot/grub/grub.conf


default 0
timeout 10

title Gentoo
root (hd0,0)
kernel /boot/kernel root=/dev/sda3



livecd conf.d # grub
Probing devices to guess BIOS drives. This may take a long time.

grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs__5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
grub/menu.lst"... succeeded
Done.

grub> quit


livecd conf.d # exit
livecd / # umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo
livecd / # reboot
(Don't forget to remove the CD)



(Clean up your known_hosts file because your new box
has generated a new definitive hostkey)

$ nano -w ~/.ssh/known_hosts
(Look for the IP of your new PC and delete the line,
then save the file and exit nano)


(Use the IP address of your new box)
$ ssh root@192.168.1.10
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
RSA key fingerprint is 96:e7:2d:12:ac:9c:b0:94:90:9f:40:89:b0:45:26:8f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.10' (RSA) to the list of known hosts.
Password: type_the_password

mybox ~ # adduser -g users -G lp,wheel,audio,cdrom,portage,cron -m john
mybox ~ # passwd john
New UNIX password: Set John's password
Retype new UNIX password: Type John's password again
passwd: password updated successfully

mybox ~ # emerge mirrorselect
mybox ~ # mirrorselect -i -o >> /etc/make.conf
mybox ~ # mirrorselect -i -r -o >> /etc/make.conf
(Usually, (the number of processors + 1) is a good value)
mybox ~ # echo 'MAKEOPTS="-j2"' >> /etc/make.conf


mybox ~ # emerge -vpe world
(Portage displays the packages and their USE flags, as an example, let's
disable ipv6 and fortran, and enable unicode)

mybox ~ # echo 'USE="nptl nptlonly -ipv6 -fortran unicode"' >> /etc/make.conf

mybox ~ # cd /etc
mybox etc # nano -w locale.gen
mybox etc # locale-gen

mybox etc # nano -w make.conf
(Set -march to your CPU type in CFLAGS)
CFLAGS="-O2 -march=athlon-xp -pipe"
(Add the following line)
FEATURES="ccache"
(Only add the following if you know what you're doing)
ACCEPT_KEYWORDS="~x86"

(Install ccache)
mybox etc # emerge ccache

(Please note that the switch to ~x86 causes many packages to be upgraded)
mybox etc # emerge -vpuD --newuse world
(Take a good look at the package list and their USE flags,
remove blocking packages if any, and start the lengthy process)

mybox etc # time emerge -vuD --newuse world
(79 packages have been (re)compiled)

real 180m13.276s
user 121m22.905s
sys 36m31.472s


(Remerge libtool to avoid further potential problems)



mybox etc # emerge --oneshot libtool

(Update config files, make sure you do not let dispatch-conf
update config files you have edited)

mybox etc # dispatch-conf

(If perl has been updated, you should run the perl-cleaner script)
mybox etc # time perl-cleaner all
real 1m6.495s
user 0m42.699s
sys 0m10.641s



(In case of a major upgrade of python, you should run the python-updater script)
mybox etc # python-updater










Thursday, September 18, 2008

SCIM bug fix for Ubuntu 7.10

http://samiux.wordpress.com/2007/11/06/scim-bug-fix-for-ubuntu-710/

After you have upgrade or install Ubuntu 7.10, you may find that you cannot edit or change the folder name under the Gnome. It is the bug of SCIM. You can fix it by following steps :

sudo nano /etc/X11/xinit/xinput.d/scim

The entries of GTK_IM_MODULE and QT_IM_MODULE should change to "SCIM" instead of xim :

GTK_IM_MODULE="SCIM"
QT_IM_MODULE="SCIM"

Log out and re-login or press "Ctrl"+"Alt"+"Backspace" to reload the X Window.

That's all!

Saturday, September 13, 2008

Chinese Sir name in English (Cantonese)



安--Ann 包/鲍--Paul 蔡--Choi/Tsai 陈--Chen/Chan/Tan

戴/代--Day 邓--Teng/Tang 丁--Ting 董--Tung

窦--Tou 杜--To/Du 范--Fan/Van 费--Fei

冯--Fung 高--Gao 恭--Kung 古--Ku/Koo

关--Kwan 郭--Kwok 海--Hay 韩--Hon

郝--Howe 洪--Hung 胡--Hu 黄--Wong

姜/江/蒋--Chiang/Kwong 讦--Gan 金--King 柯--Kor

孔--Kong/Kung 雷--Rae/Ray 黎--Lai 李--Lee

梁--Leung 廖--Liu 林--Lim 刘--Lau

卢--Lu 伦--Lun 罗--Lo/Law/Lam/Rowe 吕--Lui

马--Ma 麦--Mak 满--Man/Mai 莫--Mok

牛--New 区--Au 潘--Pan 裴--Bae

彭--Phang 卜--Pu 齐/戚--Chyi/Chi 乔--Joe

瞿--Chu 任--Yum 申/沈--Shen 施--Shi

宋--Soung 苏--Sue/Se 孙--Sun/Suen 邰--Tai

谭--Tam 汤/唐--Town/Towne 陶--Tao 童--Tung

王--Wong 温/文--Chin/Vane/Man 巫/吴/伍--Wu/NG 萧/肖--Shaw/Siu

夏--Har(Summer) 解/谢--Tse 熊--Hsiung 徐/许--Hui/Hsu

阎/严--Yim 杨--Young 姚--Yao 叶--Yip/Yeh

尹--Yi 游--You 于/余/俞/庾--Yue 袁--Yuan

岳--Yue 张/章--Cheung/Chang 赵--Chao/Chiu 曾/郑--Tsang/Cheng

钟--Chung 周--Chau/Chou/Chow 朱--Chu


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
再发个字母表顺序的
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

A:
艾--Ai
安--Ann/An
敖--Ao

B:
巴--Pa
白--Pai
包/鲍--Paul/Pao
班--Pan
贝--Pei
毕--Pih
卞--Bein
卜/薄--Po/Pu
步--Poo
百里--Pai-li

C:
蔡/柴--Tsia/Choi/Tsai
曹/晁/巢--Chao/Chiao/Tsao
岑--Cheng
崔--Tsui
查--Cha
常--Chiong
车--Che
陈--Chen/Chan/Tan
成/程--Cheng
池--Chi
褚/楚--Chu
淳于--Chwen-yu

D:
戴/代--Day/Tai
邓--Teng/Tang/Tung
狄--Ti
刁--Tiao
丁--Ting/T
董/东--Tung/Tong
窦--Tou
杜--To/Du/Too
段--Tuan
端木--Duan-mu
东郭--Tung-kuo
东方--Tung-fang

E:

F:
范/樊--Fan/Van
房/方--Fang
费--Fei
冯/凤/封--Fung/Fong
符/傅--Fu/Foo

G:
盖--Kai
甘--Kan
高/郜--Gao/Kao
葛--Keh
耿--Keng
弓/宫/龚/恭--Kung
勾--Kou
古/谷/顾--Ku/Koo
桂--Kwei
管/关--Kuan/Kwan
郭/国--Kwok/Kuo
公孙--Kung-sun
公羊--Kung-yang
公冶--Kung-yeh
谷梁--Ku-liang

H:
海--Hay
韩--Hon/Han
杭--Hang
郝--Hoa/Howe
何/贺--Ho
桓--Won
侯--Hou
洪--Hung
胡/扈--Hu/Hoo
花/华--Hua
宦--Huan
黄--Wong/Hwang
霍--Huo
皇甫--Hwang-fu
呼延--Hu-yen

I:

J:
纪/翼/季/吉/嵇/汲/籍/姬--Chi
居--Chu
贾--Chia
翦/简--Jen/Jane/Chieh
蒋/姜/江/--Chiang/Kwong
焦--Chiao
金/靳--Jin/King
景/荆--King/Ching
讦--Gan

K:
阚--Kan
康--Kang
柯--Kor/Ko
孔--Kong/Kung
寇--Ker
蒯--Kuai
匡--Kuang

L:
赖--Lai
蓝--Lan
郎--Long
劳--Lao
乐--Loh
雷--Rae/Ray/Lei
冷--Leng
黎/郦/利/李--Lee/Li/Lai/Li
连--Lien
廖--Liu/Liao
梁--Leung/Liang
林/蔺--Lim/Lin
凌--Lin
柳/刘--Liu/Lau
龙--Long
楼/娄--Lou
卢/路/陆鲁--Lu/Loo
伦--Lun
罗/骆--Loh/Lo/Law/Lam/Rowe
吕--Lui/Lu
令狐--Lin-hoo

M:
马/麻--Ma
麦--Mai/Mak
满--Man/Mai
毛--Mao
梅--Mei
孟/蒙--Mong/Meng
米/宓--Mi
苗/缪--Miau/Miao
闵--Min
穆/慕--Moo/Mo
莫--Mok/Mo
万俟--Moh-chi
慕容--Mo-yung

N:
倪--Nee
甯--Ning
聂--Nieh
牛--New/Niu
农--Long
南宫--Nan-kung


欧/区--Au/Ou
欧阳--Ou-yang

P:
潘--Pang/Pan
庞--Pang
裴--Pei/Bae
彭--Phang/Pong
皮--Pee
平--Ping
浦/蒲/卜--Poo/Pu
濮阳--Poo-yang

Q:
祁/戚/齐--Chi/Chyi/Chi/Chih
钱--Chien
乔--Chiao/Joe
秦--Ching
裘/仇/邱--Chiu
屈/曲/瞿--Chiu/Chu

R:
冉--Yien
饶--Yau
任--Jen/Yum
容/荣--Yung
阮--Yuen
芮--Nei

S:
司--Sze
桑--Sang
沙--Sa
邵--Shao
单/山--San
尚/商--Sang/Shang
沈/申--Shen
盛--Shen
史/施/师/石--Shih/Shi
苏/宿/舒--Sue/Se/Soo/Hsu
孙--Sun/Suen
宋--Song/Soung
司空--Sze-kung
司马--Sze-ma
司徒--Sze-to
单于--San-yu
上官--Sang-kuan
申屠--Shen-tu

T:
谈--Tan
汤/唐--Town/Towne/Tang
邰--Tai
谭--Tan/Tam
陶--Tao
藤--Teng
田--Tien
童--Tung
屠--Tu
澹台--Tan-tai
拓拔--Toh-bah

U:

V:

W:
万--Wan
王/汪--Wong
魏/卫/韦--Wei
温/文/闻--Wen/Chin/Vane/Man
翁--Ong
吴/伍/巫/武/邬/乌--Wu/NG/Woo

X:
奚/席--Hsi/Chi
夏--Har/Hsia/(Summer)
肖/萧--Shaw/Siu/Hsiao
项/向--Hsiang
解/谢--Tse/Shieh
辛--Hsing
刑--Hsing
熊--Hsiung/Hsiun
许/徐/荀--Shun/Hui/Hsu
宣--Hsuan
薛--Hsueh
西门--See-men
夏侯--Hsia-hou
轩辕--Hsuan-yuen

Y:
燕/晏/阎/严/颜--Yim/Yen
杨/羊/养--Young/Yang
姚--Yao/Yau
叶--Yip/Yeh/Yih
伊/易/羿--Yih/E
殷/阴/尹--Yi/Yin/Ying
应--Ying
尤/游--Yu/You
俞/庾/于/余/虞/郁/余/禹--Yue/Yu
袁/元--Yuan/Yuen
岳--Yue
云--Wing
尉迟--Yu-chi
宇文--Yu-wen

Z:
藏--Chang
曾/郑--Tsang/Cheng/Tseng
訾--Zi
宗--Chung
左/卓--Cho/Tso
翟--Chia
詹--Chan
甄--Chen
湛--Tsan
张/章--Cheung/Chang
赵/肇/招--Chao/Chiu/Chiao/Chioa
周/邹--Chau/Chou/Chow
钟--Chung
祖/竺/朱/诸/祝--Chu/Chuh
庄--Chong
钟离--Chung-li
诸葛--Chu-keh

Friday, September 12, 2008

vim settings

http://arioch.unomaha.edu/~jclark/vim.html


In vi you made a file named .exrc, in vim it is .vimrc, you may have both if you want. If there is no .vimrc, but there is a .exrc vim will use those settings and run in vi compatible mode, which will disable most of the vim enhancements.

On vulcan my .vimrc ( ~jclark/.vimrc ) is world readable so that you can copy and/or read it.

Here is an example .vimrc
I left out a map example since they don't display very well in html


" Here are John's
" vimrc settings
set wm=8 " set wrapmargin
set nohls " turn off highlight on search
set et " turn on expand tab
" colorscheme adjustments :hi lists the symbols and values for this
colo evening " change the colorscheme
" make the preprocessor stuff a lighter color
hi PreProc ctermfg=yellow
hi Constant cterm=underline,bold ctermfg=9
" turn on comment continuation for C style comments
set fo+=r " formatoptions r adds new comment line automagically
" only apply on C comments, and mail forwarding "> "
set com=s1:/*,mb:*,ex:*/,:>,fb:-
"
" AUTO-COMMANDS
" for Makefiles
" added some special formatting in Makefiles
autocmd BufEnter ?akefile* set noet ts=8 sw=8 nocindent list lcs=tab:>-,trail:x
" for source code
autocmd BufEnter *.cpp,*.h,*.c,*.java,*.pl set et ts=4 sw=4 cindent
" change the filetype
autocmd BufEnter *.pro,*.prolog set et ts=4 sw=4 cindent ft=prolog
" for html
autocmd BufEnter *.html set et ts=4 sw=4 wm=8 nocindent
"
" abbreviations
ab teh the
ab tomarrow tomorrow
" The man plugin does lookup with control-k, or :Man
runtime ftplugin/man.vim

Saturday, September 06, 2008

Economy of Australia (from wikipedia)

http://en.wikipedia.org/wiki/Economy_of_Australia

Economy of Australia
Currency Australian Dollar ($A or A$, AU$ or $AU, AUD)
Fiscal year 1 July - 30 June
Trade organisations APEC, WTO and OECD
Statistics
GDP (PPP) around A$1 trillion (2007-2008) (17th)
GDP growth 2.7% (2nd Quarter 2008) [1]
GDP per capita $32,900 (2006 est.)
GDP by sector agriculture: 3.8% industry: 26.2% services: 70% (2005 est.)
Inflation (CPI) 4.5% (Q4 2007/08) [2]
Population
below poverty line
NA%
Gini index 30.5 (2000) [3]
Labour force 10.66 million (2006 est.)
Labour force
by occupation
agriculture (3.6%), mining (1.1%), industry (20.2%), services (75.1%) (May 2005 est.)
Unemployment 4.3% (July 2008) [4]
Main industries mining, industrial and transportation equipment, food processing, chemicals, steel
External
Exports A$215.8 billion (2006-2007) [5]
Export goods coal, gold, meat, wool, alumina, iron ore, wheat, machinery and transport equipment
Main export partners Japan 20.3%, China 11.5%, South Korea 7.9%, US 6.7%, New Zealand 6.5%, India 5% (2005)
Imports A$227.8 billion (2006-2007) [6]
Import goods machinery and transport equipment, computers and office machines, telecommunication equipment and parts; crude oil and petroleum products
Main import partners US 13.9%, China 13.7%, Japan 11%, Singapore 5.6%, Germany 5.6% (2005)
Public finances
Public debt $585.1 billion
Revenues A$319.46 billion (2008-2009)
Expenses A$292.47 billion (2008-2009)
Economic aid donor: ODA, $2.5 billion (2005/06 Budget) [7]
Main data source: CIA World Factbook
All values, unless otherwise stated, are in US dollars