2010-12-30

2010-12-23

Install Jdownloader in Ubuntu 10.10/10.04/9.10 using Ubuntu PPA

12/23/2010 09:55:00 AM Posted by Hoàng Dũng No comments
JDownloader is open source, platform independent and written completely in Java. It simplifies downloading files from One-Click-Hosters like Rapidshare.com or Megaupload.com - not only for users with a premium account but also for users who don’t pay. It offers downloading in multiple paralell streams, captcha recognition, automatical file extraction and much more. Of course, JDownloader is absolutely free of charge. Additionally, many “link encryption” sites are supported - so you just paste the “encrypted” links and JD does the rest. JDownloader can import CCF, RSDF and the new DLC files.


Install Jdownloader in Ubuntu 10.10/10.04/9.10

Open the terminal and run the following command
sudo add-apt-repository ppa:jd-team/jdownloader
sudo apt-get update
sudo apt-get install jdownloader

2010-12-22

Great themes for Ubuntu 10.10 Maverick Meerkat and Ubuntu 10.04 Lucid Lynx | Updated

12/22/2010 09:27:00 AM Posted by Hoàng Dũng No comments
(Last updated : 03-11-2010 ) This is a collection of great themes for Ubuntu 10.10 Maverick Meerkat, these themes are from Besigi project a blog of François Vogelweith,on the blog exist a collection of wonderful gnome themes for Ubuntu . The installation is easy , just add the repository and then install the theme you like or  the whole collection with one command.
Now i will show you the steps you have to follow to install the themes.

I - Add Bisigi repository

- For Ubuntu 10.04 Lucid Lynx and Ubuntu 10.10 Maverick Meerkat:
Open terminal and and add the stable repository
sudo add-apt-repository ppa:bisigi/ppa
- For other ubuntu releases ,open the source list :
sudo gedit /etc/apt/sources.list
add these 2 lines at the end of the sources.list:
For Ubuntu 9.10 Karmic Koala :
deb http://ppa.launchpad.net/bisigi/ppa/ubuntu karmic main

deb-src http://ppa.launchpad.net/bisigi/ppa/ubuntu karmic main
For Ubuntu9.04 Jaunty jackalope :
deb http://ppa.launchpad.net/bisigi/ppa/ubuntu jaunty main 
deb-src http://ppa.launchpad.net/bisigi/ppa/ubuntu jaunty main
after open the terminal and add the repository verification ke
gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE && gpg -a --export 881574DE | sudo apt-key add -


II- Update and install Bisigi Themes

sudo apt-get update

Now, To install all themes use this command :
sudo apt-get install bisigi-themes
If you want to install the themes one by one ,then you will have to type the command correspondent to the theme you want to install (first follow the steps above to add the repositories) :

1-Showtime for Gnome :

sudo apt-get install showtime-theme 


2- Balanzan

sudo apt-get install balanzan-theme 

2-Infinity

sudo apt-get install infinity-theme 

3-Wild shine

 sudo apt-get install wild-shine-theme 

4-Exotic

sudo apt-get install exotic-theme

5- Tropical

sudo apt-get install tropical-theme 


6-Bamboo Zen

sudo apt-get install bamboo-zen-theme


7- Ubuntu sunrise

  sudo apt-get install ubuntu-sunrise-theme 

8- Aqua Dreams

sudo apt-get install aquadreams-theme 
To remove thethemes you have to use the command :
sudo apt-get remove theme-name 

9- Orange

Orange is A New theme from Bisigi blog,This theme is lightweigh one with just 2 Mo, and it is based on a beautifull wallpaper the umar123.
sudo apt-get install orange-theme 

10- Ellanna


Ellana , is the latest theme that bring us the famous Bisigi project. This theme is a little bit special. First of all, it’s the first theme drawn for women. And it’s the first theme, which is a special command too.
sudo apt-get install ellanna-theme 

11- Airlines :


This is the first theme based on a walltime (wallpaper that change during the day).
It includes:

- 1 wallpaper
- 1 GTK theme
- 1 Metacity theme
- 1 icons pack

Install Airlines :
sudo aptitude install airlines-theme

12-Eco

This theme has been designed to be used in dark rooms. The various components are darker than is other bisigi themes! It includes
  • 1 Wallpaper: created by Leo L.
  • 2 Gtk theme (only one packaged in the repository)
  • 2 Metacity theme (only one package in the repository)
  • 1 Metacity theme
  • 1 Icons pack

13- Split:

Split is both sophisticated and delicate. A new at Bisigi, the theme combines monochromatic schemes with grey’s contrast. Icons are modern and classic. The wallpaper follows the “natural” tendency and harmonically compliments the theme.
It includes:
  • 1 Wallpaper
  • 1 Gtk theme
  • 1 Metacity theme
  • 1 Metacity theme
  • 1 Icons pack
split-head
Install Split:
sudo apt-get install split -theme

If you have a Tip, tutorial, Idea or anything you want to share with unixmen readers, you can send it to : tips[a]unixmen.com or use our contact form Thanks



 
Due to an issue in our comment system, Comments are disabled temporary for this post
 


Links : http://www.bisigi-project.org/

2010-12-21

Anti XSS

12/21/2010 10:05:00 AM Posted by Hoàng Dũng No comments
xss-threat3
Cùng với nhu cầu viết các ứng dụng ngày càng mở rộng chức năng cho người dùng, thì các chức năng cho phép thành viên post nội dung là một thao tác tất yếu. Tuy nhiên, cho phép thành viên gởi nội dung sẽ làm phát sinh rất nhiều nguy cơ đe dọa tới sự an toàn của website, trong đó có một mối đe dọa rất phổ biến đó là tấn công Cross-Site Scripting (XSS).
sql_inj_xss
Nói sơ qua về tấn công XSS. XSS hiện tồn tại 2 hình thức là Stored XSS và Reflected XSS. Stored XSS là hình thức tấn công mà ở đó cho phép kẻ tấn công có thể chèn một đoạn script nguy hiểm (thường là Javascript) vào website của chúng ta thông qua một chức năng nào đó (vd: viết lời bình, guestbook, gởi bài..), để từ đó khi các thành viên khác truy cập website sẽ bị dính mã độc từ kẻ tấn công này, các mã độc này thường được lưu lại trong database của website chúng ta nên gọi là Stored. Stored XSS phát sinh do chúng ta không lọc dữ liệu do thành viên gởi lên một cách đúng đắn, khiến cho mã độc được lưu vào Database của website.
stored xss
Hình thức thứ 2 là Reflected XSS. Trong hình thức này, kẻ tấn công thường gắn thêm đoạn mã độc vào URL của website chúng ta và gởi đến nạn nhân, nếu nạn nhân truy cập URL đó thì sẽ bị dính mã độc. Điều này xảy ra do ta không chú ý filter input từ URL của website mình.
xss-attack-reflected
Tấn công XSS là tấn công nguy hiểm, cho phép kẻ tấn công ăn cắp thông tin trên máy nạn nhân thông qua javascript như ăn cắp cookie, chèn mã độc để chiến quyền điều khiển…
—————————————–


Như vậy, để phòng chống tốt nhất XSS là theo nguyên tắc FIEO (Filter Input, Escape Output). Để làm việc này thì hiện tại có khá nhiều bộ lọc để chúng ta lựa chọn. Hôm nay mình giới thiệu tới các bạn một bộ thư viện viết bằng PHP cho phép filter HTML để ngăn chặn kẻ xấu post mã độc XSS thông qua website của bạn, đó là HTML Purifier. Website: http://htmlpurifier.org/
HTMLPurifier
Nói sơ qua về HTML Purifier thì đây là bộ thư viện rất mạnh dùng triển khai trong code của mình để chống XSS. Được xây dựng theo mô hình OOP nên sử dụng rất dễ, sau thao tác include file thư viện, chỉ cần tạo instance của đối tượng HTML Purifier và gọi phương thức purify() là có thể filter được dữ liệu đầu vào.
require_once '/path/to/htmlpurifier/library/HTMLPurifier.auto.php';
$purifier = new HTMLPurifier();
$clean_html = $purifier->purify($dirty_html);

Bảng so sánh giữa các bộ thư viện filter HTML để chống XSS:
compare table
Một số chức năng chính của thư viện HTML Purifier
html-purifier-features-1
html-purifier-features-2
Hy vọng bài viết này cung cấp cho các bạn phần nào về mối đe dọa và phòng tránh XSS trong quá trình triển khai ứng dụng web của bạn.

2010-12-15

How to Fix the Big and Ugly Plymouth Logo in Ubuntu 10.10

12/15/2010 05:20:00 PM Posted by Hoàng Dũng No comments
You installed graphic drivers in Ubuntu 10.10, only to find that the plymouth (starting screen) has been screwed up with an ugly resolution. So much for installing graphic drivers. Well we had already covered how to get back the good looking plymouth screen in Ubuntu 10.04. The procedure was mentioned in the post Fix Big and Ugly Plymouth in Ubuntu 10.04 {Lucid Lynx}. This procedure is still valid for Ubuntu 10.10. However, if you want to avoid the hassle of doing it manually and following the step one by one, you can run a small script and fix your ugly looking plymouth screen on Ubuntu 10.10 and 10.04.

Fixing Ubuntu Plymouth 10.10
The script is written by Kyle Baker based on the steps available from Softpedia. You can find the script here at the post written by Kyle. We did not wanted to hotlink to downloading the script as the script is hosted at Kyle’s servers and it’s only fair that he takes all the credit for the script along with Softpedia.
Follow the steps mentioned by Kyle.
Warning: Please use the script at your own risk!

Alternative One – Fixing Plymouth’s resolution

Step 1: Hit the ALT+F2 key combination, paste the following command and check the “Run in terminal” option:
sudo apt-get install v86d
…a terminal window will appear. Enter your password when asked, hit the Enter key and wait for the package to be installed. The terminal window will automatically close!
Review image
Step 2: Hit the ALT+F2 key combination, paste the following command and check the “Run in terminal” option:
gksu gedit /etc/default/grub
…enter your password when asked and hit the Enter key.
- Replace the following line (line number 9):
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
with this one:
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash nomodeset video=uvesafb:mode_option=1280×1024-24,mtrr=3,scroll=ywrap”
- Replace the following line (line number 18):
#GRUB_GFXMODE=640×480
with this one:
GRUB_GFXMODE=1280×1024
The file should look like this:
Review image
Save the file and close it!
Step 3: Hit the ALT+F2 key combination, paste the following command and check the “Run in terminal” option:
gksu gedit /etc/initramfs-tools/modules
When the text window appears, add the following line at the end of the file:
uvesafb mode_option=1280×1024-24 mtrr=3 scroll=ywrap
It should look like this:
Review image
Save the file and close it!
Step 4: Hit the ALT+F2 key combination, paste the following command and check the “Run in terminal” option:
echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash
…a terminal window will appear for a second or two. The terminal window will automatically close!
Review image
Step 5: Hit the ALT+F2 key combination, paste the following command and check the “Run in terminal” option:
sudo update-grub2
…a terminal window will appear. Enter your password when asked, hit the Enter key and wait for the command to finish. The terminal window will automatically close!
Review image
Step 6: Hit the ALT+F2 key combination, paste the following command and check the “Run in terminal” option:
sudo update-initramfs -u
…a terminal window will appear. Enter your password when asked, hit the Enter key and wait for the command to finish. The terminal window will automatically close!
Review image
Step 7: Reboot your computer. When the system starts, you should see a better looking Ubuntu logo!
Review image
Alternative Two – No logo at boot
Click the link below to install the Startup Manager application.
Install Startup Manager
If you use Firefox, choose “apturl” when asked and install the package. Wait for the installation to finish and go to System -> Administration -> StartUp-Manager.
Wait a few seconds for the program to start, and then choose 1280×1024 and 24 bits in the “Resolution” and “Color depth” drop-down menus. Also, check the “Show boot splash” option, and you can reduce the “Timeout in seconds” option to 0 (zero)! It should look something like this:
Review image
Close the application and wait a few seconds to apply the changes. Reboot your computer!
From our tests, this will make the Ubuntu logo disappear. All you will see is a dark screen, until GDM (GNOME Diplay Manager) appears.

Using the SVN client RapidSVN

12/15/2010 11:57:00 AM Posted by Hoàng Dũng No comments
RapidSVN is a graphical SVN client available for many flavours of Linux, as well as Windows and Mac OS X. This tutorial will demonstrate setting up RapidSVN for Nengo development.

Installing RapidSVN

Ubuntu
If RapidSVN is not installed on your system, then open the Ubuntu Software Center (Applications > Ubuntu Software Center) and search for RapidSVN. Click on the right arrow, then Install to install it.

After installation, RapidSVN can be found in Applications > Programming.
Other operating systems
RapidSVN is also available for Windows and Mac OS X. Go here to download the installer for those platforms.
The screenshots in this article will be from Ubuntu, but the steps outlined will work the same regardless of what platform you’re using.

Checking out a repository

The following steps should be followed for each repository you want to interact with on your local machine. For typical Nengo development, this means both simulator and simulator-ui. Both are required to build Nengo with a graphical environment.
In RapidSVN, click on Repository > Checkout.

Fill in the URL with the URL on the SVN server. For Nengo, the two URLs you will need to add are:
http://ctnsrv.uwaterloo.ca/svn/bryan/simulator
http://ctnsrv.uwaterloo.ca/svn/bryan/simulator-ui
The destination directory is up to you. The default options for the rest should be fine, but ensure that “Add to Bookmarks” is checked.

The files from the repository will be downloaded to the directory that you chose earlier. A new bookmark will be added in RapidSVN; this bookmark offers an easy way to interact with the repository later on.

Downloading new updates from a repository

You’re not the only developer contributing to Nengo. When they change files in the repository, you will want to get those changes to ensure that any code that you contribute to the repository does not conflict with their changes.
To update your local copy of the repository, right-click on the bookmark you created above and select Update. Any files that have changed since the last time you performed an update will be downloaded.

If a file that you have been editing has been updated in the repository, you may be prompted to select an action. In most cases, merging the two files is the right choice, but to be safe, you may want to make a local copy of the file you were editing, to ensure that the merged file contains your changes.

Using a diff tool

A good way to visualize your changes remain is to use a diff tool. While Linux has the command line program “diff” built in, graphical tools exist and illustrate changes well. We’ll use the diff tool “meld”.
To install it, open Applications > Ubuntu Software Center and type “meld” into the search box. Click the right arrow, and then Install to install it.

Next, we’ll configure RapidSVN to use Meld for doing diffs. Click on View > Preferences.

Click on the Programs tab, and then the Diff Tool subtab. In the text box, enter /usr/bin/meld (unless you’ve installed meld to a different location). For program arguments, enter %1 %2.

Now, if you ever want to compare your local copy of a file to the copy in the repository, right-click on it in the right pane of RapidSVN and select Diff to Head.

Committing changes to a repository

Once you’ve made changes to Nengo, we encourage you to commit them to the repository so that all Nengo users can benefit from your work. However, caution must be exercised to ensure that the changes you make don’t break Nengo for other developers.
Before committing changes, you should first do an Update. Right-click on your bookmark and select Update. If you have an updated copy of Nengo, your Update should produce the following output in RapidSVN.

Once you’ve done an update and fixed any conflicts with merging files (testing your code afterwards), you’re ready to commit. Right-click on your bookmark and select Commit.

A window will come up with a list of the files you’ve changed. At the top, you are prompted to enter a log message; please do so, being as verbose as possible. If your update happens to break Nengo, the more you’ve entered in the log, the easier it will be for other developers to figure out what’s gone wrong.
Before doing the final commit, check the diff for each file to ensure that the changes you’re committing are what you think you’re committing.


If this is the first time you’re committing to the Nengo code base, or if you’re unsure of your implementation of a particular change, then ask a CNRG group member to review the file diffs.
When you’re ready to commit, click OK in the Commit window.

Using phpDesigner under Linux (Ubuntu)

12/15/2010 11:56:00 AM Posted by Hoàng Dũng No comments
1. Installing latest Wine
First we will need the latest version of wine, atm. that is 1.1.0, the easiest why to do that, is to add the wine repository.
First we will add the key:
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
Secondly add the repository itself, I’m running 8.04 (Hardy), so if your running something else, please consult the winehq homepage (http://www.winehq.org/site/download-deb):
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/winehq.list
How you sould be able to install wine by running:
apt-get install wine
2. The Wine setup
The wine setup is really basic, from my observations Windows XP is the best version to go with, rest should be fine from default.
We will need to install some extra Windows packages in order to run phpDesigner, so do the following:
wget http://kegel.com/wine/winetricks && sh winetricks msxml3 riched20
This will download a script called winetricks, it is developed by Dan Kegel (http://kegel.com) big thanks to him :)
3. Installing and running phpDesigner
Well, this should be very straight forward, in ubuntu you can open Windows executables just as easy as on windows, download the setup file from MPSOFTWARE (http://www.mpsoftware.dk/downloads.php) double click on it and install it. When it’s done, you should see it in your Programs menu.

Chú ý: tắt bỏ hiệu ứng của Ubuntu đi khi sử dụng để tránh bị giật khi lập trình nhé :D