Tuesday, June 23, 2009

Split lossless audio (ape, flac, wv, wav) by cue file in Ubuntu

1. install 2 thing
sudo apt-get install cuetools shntool
2. for Monkey’s Audio,install

sudo apt-get install flac wavpack


3. extract by
cuebreakpoints sample.cue | shnsplit -o flac sample.flac


Refer to : http://aidanjm.wordpress.com/2007/02/15/split-lossless-audio-ape-flac-wv-wav-by-cue-file/

java web applcation to mysql connection

1. go to sun Glassfish enterprise server -> Resources -> JDBC - > Connection Pools
2. click new -> fill in the blank
eq: name = [name of the database]
Resource Type= javax.sql.DataSource
Database Vendor = MySQL
3. click next
eq : set the additional setting according the context

Tuesday, May 5, 2009

copy to server using sftp

To use this,must had jsch library(ask me if u want)
JSch jsch = new JSch();

Channel channel = null;
ChannelSftp c = null;

//First Create a JSch session
System.out.println("Creating session.");
try {
//Create a session sending through our username and password

Session session = jsch.getSession([ftpusername], [ftphost], [getFtpPort]);

System.out.println("Session created.");
session.setPassword([ftppassword]);
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
System.out.println("Session connected.");
//Open the SFTP channel
System.out.println("Opening Channel.");
channel =session.openChannel("sftp");
channel.connect();
c = (ChannelSftp) channel;
} catch (Exception e) {
System.err.println("Unable to connect to FTP server. " + e.toString());
System.exit(1);
throw e;

}

System.out.println("Changing to FTP remote dir: " + [ftpremotedirectory]);
c.cd([ftpremotedirectory]);


String fileToTransmit = [filetocopy];
try {
File f = new File(fileToTransmit);
System.out.println("Storing file as remote filename: " + f.getName());
c.put(new FileInputStream(f), f.getName());
} catch (Exception e) {
System.err.println("Storing remote file failed. " + e.toString());
throw e;
}

Thursday, April 23, 2009

View Gif in jsp

can't display gif in jsp, the solution to this problem is simple. it only need 2 thing that is a jsp page to display the image and a servlet to write the image.

in jsp
..
img src=[point to servlet?id=xxx.gif]
..

example: ...img src=controller?action=viewGif&id=card.gif

in servlet


String gif = request.getParameter("id");
response.setContentType("image/gif");
OutputStream out = response.getOutputStream();
FileInputStream in = new FileInputStream(Props.getCardDest() + gif);
int size = in.available();
byte[] content = new byte[size];
in.read(content);
out.write(content);
in.close();
out.close();


that is..it took me a lot time to know about it...

Tuesday, January 13, 2009

CELCOM BROADBAND + huawei e160e

finally after waiting for 4 day after i register celcom broadband on last Friday, it finally active. To use the modem,need to do some configuration like below :

  1. Then go to Settings again, select Choose Connection Type and choose 3G only. This is to ensure that the device will only connect to 3G network.
  2. Go to Settings one more time and choose Network Connection Settings.
    i. Click New and enter the profile name. Eg: Celcom 3G.
    ii. Authetication - number: *99#; Username: ; Password:
    iii. DNS Settings choose Dynamic.
    iv. APN and Additional Settings: Static; APN: celcom3g
    v. IP Settings: Dynamic
    vi. Authetication Protocol: CHAP
    vii. WINS Settings: Dynamic
  3. Click on Save button and Ok to accept the configuration.
  4. Finally, click Connect and start surfing with your Celcom 3G broadband.


Monday, October 27, 2008

Invalid Update Control CFT File, AVG 8.0?

My AVG can't not update, don't what happen. so i went online and found a solve that it by deleting/remove
CTF temp files in C:\Documents and Settings\All Users\Application Data\Avg8\update\download.
or use this tools del_avg_ctf.zip to delete the ctf.

refer to :
http://www.winhelponline.com/blog/error-invalid-update-control-ctf-file-when-updating-avg-anti-virus-80/

Wednesday, September 10, 2008

Get free stuff from online

if don't have money, and want to had get for free but unlegally, just visit to go to site as below.
mostly it will use rapidshared or megaupload.

1. Hugewarez
2. Phazeddl
3. PhazeMp3
4. dllbay
5. dllshark
6. united-dll
7. warezflow
8. ddlgold
9. katz
10. ddl2
11. ddlspot
12. xCrawl
13. warezfactor
14.downloadwarez
15. http://www.ertx.com/
16. Download Place
17. www.taringa.net (in spanish,so u had to use google to translate it)
18. MegaUpload
19. Final4Ever
11. rapidsharebloggers.com
12. warez-tv
13. tehparadox
14.mechodownload

anyway,download anything at you own risk..