Saturday, December 20, 2008

Install Open Office 3

Get openoffice 3 for Ubuntu
http://ooo.mirror.dkm.cz/pub/openoffice/stable/3.0.0/OOo_3.0.0_LinuxIntel_install_en-US_deb.tar.gz

>sudo dpkg -i *.deb
>cd desktop-integration
>sudo dpkg -i openoffice.org3.0-debian-menus_3.0-9354_all.deb

Saturday, November 22, 2008

subreport in jasper report

Subreport jasper:

so fun!

1. Create new report called "subreport1"
2. Open master report, drag subrreport component into Visual
3. Do some instructions, attend at Prarmeter of subreport, set it equal one of parameters or fields in master report. It's very very important.

good luck!

Thursday, October 9, 2008

install flash plugin firefox ubuntu

cd /usr/lib/firefox-3.0.3/plugins
sudo ln -s /usr/lib/flashplugin-nonfree/libflashplayer.so

Tuesday, September 16, 2008

install convert html to pdf

sudo apt-get install libchm-bin
sudo apt-get install htmldoc

Java plug in firefox

cd /usr/lib/firefox-3.0.1/plugins
sudo ln -s /usr/lib/jvm/jdk1.6.0/jre/plugin/i386/ns7/libjavaplugin_oji.so

Thursday, September 4, 2008

share guest user right


1. cmd/gpedit.msc
2. config the same image
3. cmd/gpupdate /force

Thursday, August 21, 2008

Turn Your Ubuntu Hardy to Mac OSX Leopard

Turn Your Ubuntu Hardy to Mac OSX Leopard

You can’t really turn a Linux system to a Mac, but you definitely can make your Ubuntu Hardy looks like a Mac OSX Leopard.

If you want to change this

ubuntu-desktop-original into

ubuntu-leopard-screenshot , follow the steps below.

Before we start…

First, create a folder in your Home and name it Mac_files. Download the following files to the Mac_files folder.

Using Archive manager, extract the three Mac4Lin zip files Modified Mac4Lin theme and Mac4Lin wallpaper to the Mac_files folder.

Apply Mac OSX Leopard Theme

Go to System->Preferences->Appearance.

appearance

Select Install and select the Mac4Lin GTK theme (/home/username/Mac_files/Mac4Lin_v0.4/GTK Metacity Theme/Mac4Lin_GTK_v0.4.tar.gz).

appearance-select-gtk-theme

Next, click Install again and select the Mac4Lin icon theme. (/home/username/Mac_files/Mac4Lin_Icons_Part2_v0.4.tar.gz /home/username/Mac_files/Mac4Lin_Icons_modified.tar.gz). When prompted, select “Apply new themes“.

Click Install again and select the Mac4Lin mouse cursor theme. (/home/username/Mac_files/Mac4Lin_v0.4/GTK Cursor Theme/Mac4Lin_Cursors_v0.4.tar.gz). Select “Apply new themes” when prompted.

appearance-cursor-apply-theme

Click ‘customize’ and choose Mac4Lin_GTK_v0.4. Go to the “Window border” tab, choose Mac4Lin_GTK_v0.4. Click Close.

appearance-customize

On the top, go to the Background tab. Click Add and select the Leopard wallpaper. (/home/username/Mac_files/Wallpapers/Leopard.jpg). Click Close to terminate the Appearance window

appearance-select-wallpaper

Install the Dock (Avant Window Navigator)

Open a terminal (Applications->Accessories->Terminal) and type

gksu gedit /etc/apt/sources.list

and add the following lines to the end of the file:

deb http://ppa.launchpad.net/awn-testing/ubuntu hardy main
deb-src http://ppa.launchpad.net/awn-testing/ubuntu hardy main

Save and close the file. In your terminal, type

sudo apt-get update
sudo apt-get install avant-window-navigator-trunk awn-manager-trunk awn-extras-applets-trunk

Go to System->Preferences->AWN manager. On the left, click on the Theme. On the right, click Add and navigate to the Mac_files folder. Select the Elegant_glass.tgz file. Check the bullet beside the Elegant glass theme and click Apply.

awn-select-theme

Next on the left, click on the Applet icon. On the right, scroll down to the stack Applet. Highlight it, then click Activate. This will add the Mac Leopard stack to your dock.

awn-select-applet

Before you launch the AWN, remove the bottom panel from the desktop first. Right click on the bottom panel and select “delete this panel”. Open AWN via Applications->Accessories->Avant Window Navigator. Once it is activated, you can simply drag and drop the applications into the dock.

Install OSX Fonts

Open a terminal and type the following:

sudo apt-get install msttcorefonts

This will Install the Microsoft core fonts.

Next, copy the OSX fonts to the fonts folder

cd /usr/share/fonts
sudo tar xvzf /home/username/Mac_files/Mac4Lin_v0.4/Fonts/OSX_Fonts.tar.gz

Configure the fonts:

cd/
sudo tar xvjpf /home/username/Mac_files/Mac4Lin_v0.4/Fonts/fontconfig.tbz -C /etc/fonts

Open the Appearance window (System->Preferences->Appearance) and select Fonts tab. Select the following fonts according to the image below. Click Close.

appearance-configure-fonts

Change the traffic light window control to the left

In the terminal, type

gconf-editor

This will bring up the gconf-editor window. Scroll down to App->Metacity->general. On the right, double click on the button_layout and change the content to ‘close,minimize,maximize:menu’ (without the quote). Click Ok and close the gconf-editor.

gconf-editor

gconf-editor2

Change the menubar

Remove all the icon and applications on the left side of the top panel. Right-click on the icon and select ‘Remove from panel‘. You will left with something like this:

menubar-remove-icon

On the right of the top panel, remove the logout icon. Still on the right hand side of the top panel, right click and select ‘Add to panel‘. Scroll down the list and add ‘Search for files‘. This will add the spotlight icon to the panel.

menubar-add-search

On the extreme left, right-click and select ‘Add to panel‘. Scroll down the list and add ‘Main Menu‘. This will add the apple icon on the left. You can now log out and shut down from the Apple dropdown menu (same as Mac OSX).

menubar-add-mainmenu

Next, we are going to install globalmenu so as to display the menubar for each application. In your terminal,

cd Mac_files
wget http://gnome2-globalmenu.googlecode.com/files/gnome-globalmenu-0.4-svn964.tar.gz
tar zxvf gnome-globalmenu-0.4-svn964.tar.gz
cd globalmenu
sudo dpkg -i *.deb

If you have any errors when installing the package, try

sudo dpkg -i –force-overwrite *.deb

If you are having some installation problems with the gnome-globalmenu-applet, try

sudo apt-get install -f

Once finished, right click on the top panel and select ‘Add to panel‘. Scroll down the list and add ‘Global Menu Applet‘.

menubar-add-globalmenu

You might not see anything initially. Log out and log in again, you should now see the menubar for each application showing on the panel.

If your globalmenu is of a different shade of grey from the rest of the panel (as shown in the image below), right click on any empty space on the panel and select ‘Properties‘. Go to Background tab and select ‘Background image’. Under the selection, go to /home/username/.themes/Mac4Lin_GTK_v0.4/gtk-2.0/Panel and select panel-bg.png. Click OK. (Updated: If you can’t find the .themes folder, right-click and select ‘show hidden files‘.)

globalmenu-w-darkbg

Drag the globalmenu to the left just beside the Apple icon. Right click on the globalmenu and select ‘Preferences’. Tick the box beside ‘Display the title of the current application‘ and put maximum width 100. Select the font to be Lucida Grande Bold. Click Apply and OK. You should now have a desktop that resemble Mac Leopard.

globalmenu-preferences

menubar-with-globalmenu

Configuring the Login screen

Click on the Apple icon, go to System->Administration->Login Window. On the Local tab, click Add. Navigate to the path /filesystem/home/username/Mac_files/Mac4Lin_v0.4/GDM Theme and select the file Mac4Lin_GDM_v0.4.tar.gz. Check the box beside the newly installed theme to activate it.

install-login-screen

Underneath, there is a color selection field, select it and key in the number E5E5E5 into the color code field.

login-screen-color

Click Ok. Log out. You should see the login screen as the diagram below.

login-screen

Configure usplash screen

usplash is the screen that you see when your computer is booting up. We are going to change it to show the white apple screen. In your terminal,

sudo apt-get install startupmanager

Go to System->Administration->Start-Up Manager Go to Appearance tab. Click on the ‘Manage bootloader theme‘. Click Add and navigate to the file /filesystem/home/username/Mac_files/Mac4Lin_v0.4/GRUB Splash/appleblack.xpm.gz. Check the box “Use background image for bootloader menu” and select ‘appleblack”.

startupmanager-configuration

startupmanager-addtheme

Next, click “Manage usplash theme”. Click Add and add the file /filesystem/home/username/Mac_files/Mac4Lin_v0.4/USplash Theme/osx-splash.so. Click OK. Select OSX-splash from the dropdown box.

Now reboot. You should see the following images:

bootloader

usplash

Creating Dashboard effect

We will use a combination of screenlets and Compiz widget plugin to achieve the dashboard effect.

Install Screenlets

sudo apt-get install screenlets compizconfig-settings-manager

Go to System->Preferences->Advanced Desktop Effect Setting. On the Left, click on Desktop. On the right, put a check beside ‘Widget layer’

ccsm-widget-setting

Go to Accessories->Screenlets. Activate the widgets that you want to display. Right click on the widget and select ‘Properties’. Go to Options tab and select ‘Treat as widget’. Do this for all the widgets that you have activated.

screenlets-as-widget

You can now see your dashboard in action by pressing F9.

dashboard-effect

Done. You have completed the transformation of your Ubuntu desktop to Mac OSX Leopard.

Some screenshots:

ubuntu-leopard-screenshot-big

screenshot-w-stack

Wednesday, July 30, 2008

Install Vistat after Linux

This tutorial guides you through the steps of installing Windows Vista on a computer which already have an Ubuntu installation.
I wrote this tutorial because I haven't found a "Ubuntu/Vista dual-boot" that works when Ubuntu is already installed. There are only tutorials saying "Install Vista first, then Ubuntu!".
But if you have a working Ubuntu and you don't want to reinstall everything?! Then read this...
Most of you out there have propably heard of Windows Vista: the next generation of Windows from MS that is going to replace XP as desktop standard. It is still in beta stage and is not for stable enough to use as your primary os. That is why you should have a dual-boot install.
Microsoft has made Vista a public beta, meaning that you can download it for free(!) and try out (but only use it for a year or so...)
As primary OS I use the brilliant Linux distribution Ubuntu Dapper Drake. Now I wanted to make my computer able to start both Ubuntu and Windows Vista...
Before leaving Ubuntu you have to prepare your harddrive. It can be done with gparted. In a Terminal:
> sudo apt-get install gparted
> sudo gparted Or if you prefer to do it in a gui:

  • Start Synaptic, find and install gparted

  • System -> Administration -> Gnome-partition editor

There are lots of guides to help you partition your harddrive. resize your partitions and leave room (unallocated) for Vista. It needs at least 15 GB space. I recommend 20+ GB. I installed Vista on a second harddrive, but a single drive with lot of space would do it.

  • Download the dvd-image ( 4GB )

  • Burn it to a dvd with your favourite burn-app (GnomeBaker), put it in the drive and restart your computer

  • Go on with installing Windows Vista!

Vista is easy to install, almost as easy as Ubuntu. During the install choose the empty space to create a new ntfs partition.
By experience I know that Microsoft don't care about the user; they will just run over you. The installer for Vista is a good example of that. It deleted my Ubuntu loader (GRUB). Next time I booted the machine it loaded Vista. I got no option to start Ubuntu. The same will happen to you, my friend. But do not fear! Ubuntu is a Linux distro, and you can always make Linux work again.
Well, hopefully Vista is working now. You can play around with it for a while if you want. I got addicted to a small game called Inkball...
Here is more info about GRUB's way of naming the disks.

Now stop playing! You must have your Ubuntu to work again. Microsoft erased GRUB and replaced it with it's own crappy loader (wich cannot load Linux). It's time to get GRUB back into the MBR. Find your Ubuntu Live-CD (other Live discs may also work) and boot it. Then launch a terminal:
> sudo grub

grub> root ( Now you will see a list of available harddrives if you have several (In my case hd0,hd1). Choose the one where you have ubuntu (probably hd0)
grub> root (hd0, This time you should see a list of partitions and their filesystems on the drive. This is what it may look like:
grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 2, Filesystem type is ext2fs, partition type 0x83
Note the number of your Ubuntu partition (with ext2fs filesystem). Also remember (or write down) the partition number with an unknown filesystem 0x07; that is your Vista on an ntfs partition. Now set grub's root to the right partition (In my case (hd0,2)) and then install grub to mbr.
grub> root (hd0,2)
grub> setup (hd0)
grub> quit Now restart your computer! You should see GRUB loading and you are able to boot Ubuntu. The last you have to do now is to add Vista to the GRUB list. Once again, fire up a terminal:
> gksudo gedit /boot/grub/menu.lst At the bottom of the file add the following:
title Microsoft Windows Vista Beta 2
root (hd0,0) #Remember Vistas partition number?
savedefault
makeactive
chainloader +1
Save the file and restart your machine to see if it's working. Hopefully it is. It worked fine for me. Now enjoy your dual boot system!

Tuesday, June 24, 2008

view log ettercap

using etterlog to view ettercap log.

etterlog -T logfile

Saturday, June 14, 2008

Fix MBR boot VISTA

Use Vista Recovery Disk, it can be dowloaded at:
http://coblitz.codeen.org/neosmart.net/downloads/guides/Vista_Repair/Vista_Recovery_Disc_x86.iso

* Boot up your computer using Microsoft Windows Vista Bootable disk. (Check your BIOS setup)
* When you see the 1st Windows Vista installation screen appear, please configure your 'language' preferences.
* When prompted, click 'Repair your computer'.
* Startup Repair will automatically detect a problem. When prompted, click 'Repair and restart', and then restart your computer from the Windows Vista bootable disk. If Startup Repair does not automatically detect a problem, continue to the next step.
* click 'Repair Your Computer'.
* Click Command Prompt from the System Recovery Options.
* BootRec.exe provides the following command-line options:

* /FixMbr. Re-writes the master boot record (MBR) of the system partition to start Windows Vista. This won’t overwrite the existing partition table.

* /FixBoot. Writes a boot sector onto the system partition to start Windows Vista.

* /ScanOs. Scans all disks for Windows Vista installations and displays them to you. Oddly, this didn’t work for me, even on a test system that was starting just fine.

* /RebuildBcd. Scans all disks for Windows Vista installations and prompts you to pick the ones you want to add to the BCD.

* Type 'BootRec.exe /fixmbr' and press Enter.
* Congratulations! You're done.

Basically your Linux GRUB will go away. We recommend you look at GUID Partition Table.

Change MAC Ubuntu

sudo ifconfig wlan0 hw ether <>

Friday, June 6, 2008

enable SSL

After installing, you need to uncomment some code to enable SSL dissection. Open up a terminal window and type “nano /usr/local/etc/etter.conf”, without the quotes. Scroll down using your arrow keys until you find this piece of code:

# if you use iptables:
# redir_command_on = “iptables -t nat -A PREROUTING -i %iface -p tcp –dport %port -j REDIRECT –to-port %rport”
# redir_command_off = “iptables -t nat -D PREROUTING -i %iface -p tcp –dport %port -j REDIRECT –to-port %rport”

You need to uncomment the last two lines.

# if you use iptables:
redir_command_on = “iptables -t nat -A PREROUTING -i %iface -p tcp –dport %port -j REDIRECT –to-port %rport”
redir_command_off = “iptables -t nat -D PREROUTING -i %iface -p tcp –dport %port -j REDIRECT –to-port %rport”

Tuesday, May 20, 2008

Jasper Report Unicode

Wow! Report using Vietnamese!

Haha!

Copy font Unicode to classpath of IReport, set properties of PDF Font to Arial, Encoding to H-Unicodde,
Open file jrxml, update pdfFontName="arial.ttf"
that's all!

In Netbeans, point classpath to Font Unicode Folder.

Remember, using .jasper file when using JasperFillManager , if you want to use .jrxml, please compile it first.

so fun! I'm very happy about Jasper Report!

Code examples:

public void createServletReport(String fileName, String reportname, Map parameters, Connection con, HttpServletResponse response){
try{
JasperPrint print = JasperFillManager.fillReport(reportDir + File.separator + fileName, parameters, con);

OutputStream ouputStream = response.getOutputStream();

JRExporter exporter = null;

response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=\""+reportname+"\"");
exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, ouputStream);

exporter.exportReport();
}catch(Exception e){
System.out.println(e);
}
}

Saturday, May 10, 2008

Install font unicode on Hardy

Open terminal, type:
cd /usr/share/fonts/truetype
sudo mkdir unicode
sudo cp pathto_ttffontsdir /usr/share/fonts/truetype/unicode
sudo chmod 755 /usr/share/fonts/truetype/unicode
sudo nautilus
sudo fc-cache -f -v

Sunday, April 27, 2008

Config VNC Ubuntu

Now install x11vnc, you can do this with apt-get or Synaptics, this package is available in the Community Maintained (Universe) repository.

Now with x11vnc installed, you will need to create a password file:

sudo x11vnc -storepasswd yourpasswordhere /etc/x11vnc.pass

Then configure GDM to run x11vnc when at loading time:

sudo gedit /etc/gdm/Init/Default

and this line to the file:

/usr/bin/x11vnc -rfbauth /etc/x11vnc.pass -o /tmp/x11vnc.log -forever -bg -rfbport 5900

(you can change the port and other parameters)

So far so good, but if you restart your pc at this stage you’ll only be able to login, then the GDM will kill your session. To avoid this we must change another file:

sudo gedit /etc/gdm/gdm.conf

now search for this line :

#KillInitClients=true

And change it to this:

KillInitClients=false

Restart you PC and now you have VNC at login time.

Firewall: 5800, 5900

Sunday, April 20, 2008

Setup X3100 Compiz

Open terminal:
sudo gedit /usr/bin/compiz

Add sign # begin the line:

#T="$T 8086:2982 8086:2992 8086:29a2 8086:2a02 8086:2a12" # intel 965
#T="$T 8086:2972" # i965 (x3000)


Then reboot computer!

Note: you have to update newest driver for X3100 using deb packages

http://packages.ubuntu.com

search: xserver-xorg-video-intel