Thứ Tư, 19 tháng 5, 2010

MobilePDF view

http://download365.mediafire.com/h7u9nt4tewwg/wce3wnmjjyt/MobilePdf.jar

Tổng quan về mảng và các hàm hỗ trợ trong PHP

Tổng quan về mảng và các hàm hỗ trợ trong PHP

Cũng như bao ngôn ngữ lập trình khác. PHP cũng tồn tại một loại dữ liệu được gọi là mảng. Cụ thể hơn Mảng là 1 biến danh sách. Nghĩa là, một biến vốn chứa nhiều phần tử được tạo bởi các số hoặc chuỗi. Nó cho phép chúng ta lưu trữ, sắp xếp thứ tự và truy cập nhiều giá trị với một tên. Và cần lưu ý rằng một phần tử mảng luôn bắt đầu với giá trị là 0.



1- Định nghĩa mảng trong PHP:

Với cú pháp giống với java ta có cách gọi 1 mảng như sau:
$tên_biến= array("Kenny","Maria","Julia","Kenvin")
Như vậy khi gọi giá trị trong mảng ta có:
Echo $tên_biến[2]; // Giá trị sẽ cho là Julia.
Ngoài cách khai báo ở trên chúng ta cũng có thể khai báo bằng cách khác như sau:
$tên_biến[] = "Kenny";
$tên_biến[] = "Gillian";
$tên_biến[] = "Charlene";
$tên_biến[] = "Calvin"
Chúng ta không cần thêm ký tự vào. Vì PHP đã tự xử lý cho chúng ta phần đó.
Để thêm 1 phần tử vào mảng chúng ta cũng có thể sử dụng như sau:
$tên_biến[] = "Jiro";
Như vậy nếu chúng ta gọi giá trị: echo $tên_biến[4] thì giá trị sẽ là jiro. Vì nó được PHP thêm vào sau cùng và ngầm hiểu là giá trị tiếp theo.
Ví dụ:


$a=array("Kenny","Maria","Julia","Kenvin");
echo $a[2]; //Xuất ra giá trị Julia
?>

2- Khái niệm mảng kết hợp trong PHP

Là các mảng được tạo index bằng các chuỗi , chúng được gợi là các mảng kết hợp.
Ví dụ:


$a= array (name => "Kenny", job => "Teacher", age=>"45", email => "webmaster@vietchuyen.com.vn")
?>
Như vậy để truy cập giá trị của mảng trên chúng ta không thể sử dụng cách cũ được.
Ví dụ: Để lấy giá trị của tuổi tôi không thể sử dụng cách trên : echo $a[2].
Vì chúng ta đã gán giá trị của index cho 1 tên gọi khác. Do vậy để lấy giá trị của tuổi ta sử dụng như sau: echo $a[age] // Kết quả sẽ cho ra 45.



$tên_biến= array (name => "Kenny", job => "Teacher", age=>"45", email => "webmaster@vietchuyen.com.vn")
echo $a[age];
?>

3- Phép lặp trong mảng:

Cú pháp: foreach($array as $temp)
{ Hành Động }
Trong đó $array là mảng mà ta muốn thực thi việc lặp dữ liệu, và $temp là một biến trong đó ta sẽ tạm thời lưu trữ mỗi phần tử.
Ví dụ:



$name= array("Kenny", "Jiro", "Calvin", "Gillian");
foreach ($name as $test)
{ echo "$test
"; }

?>

b) Lặp lại qua một mảng kết hợp:
Cú pháp: Foreach($array as $key=>$value)
{ Hành Động }
Trong đó $array là mảng mà ta muốn thực thi việc lặp dữ liệu, $key là một biến vốn tạm thời chứa mỗi khóa, và $value là một biến vốn tạm thời chữa mỗi giá trị.
Ví dụ:

$person= array(name=>"Kenny", job=>"Teacher", email=>"whiletionvn@gmail.com", age=>"38");
foreach($person as $key=>$test)
{
echo "Key: $key. Gia Tri: $test
";

}
?>

4- Các hàm hỗ trợ trong PHP:

+ Hàm gộp mảng:
Cú pháp: array_merge($mang1, $mang2);

+ Hàm tách mảng:
Cú pháp: array_slice($mang, vị trí tách, số lượng tách);

+ Hàm sắp xếp mảng:
Cú pháp: sort($mảng);

+ Hàm sắp xếp mảng theo chỉ mục:
Cú pháp: ksort($mảng);

+ Hàm tìm phần tử có tồn tại trong mảng hay không ?.
Cú pháp: in_array(giá trị tìm, $mảng);

5 - Tổng kết: Qua bài học này, chúng ta tìm hiểu kỹ về các thành phần của mảng một chiều, nhiều chiều và các hàm cơ bản vể xử lý dữ liệu. Hiểu rõ cấu trúc mảng, sự sắp xếp đồng bộ sẽ giúp ích cho các bạn rất nhiều trong những ứng dụng lớn.

Bài tập áp dụng :
1- Xây dựng website có tính năng upload cho phép upload cùng lúc 10 file dữ liệu.
2- Xây dựng website có tính năng upload, và chỉ cho phép upload file có định dạng hình ảnh như gif, jpg. Ngoài ra các tính năng khác đều có thông báo lỗi không cho upload.

Nguồn (Bùi Quốc Huy) qhonline.info

Tạo captcha (mã kiểm tra)

Trước tiên, chúng ta tiến hành tạo form HTML đơn giản để thực thi thao tác nhập liệu như sau:










Chúng ta chú ý phần hình ảnh, tại đây tôi truyền đường dẫn chính là liên kết tới trang random_image.php. Trang này sẽ thực thi công việc tạo ra những bức hình có dãy số ngẫu nhiên để phần nhập liệu của người sử dụng tham chiếu tới.

Tiếp theo, chúng ta khởi tạo file random_image.php để lấy ra dãy số ngẫu nhiên và phát sinh chúng ngay trên tấm hình cho người truy cập nhập liệu.

Để làm được điều đó. Chúng ta sẽ khởi tạo session và lưu dãy số nhập liệu đó vào session của mình, sau đó so khớp với trang form bên kia.(xem lại bài 7: Khái niệm cơ bản về cookie và session trong PHP)
Bài 15: Viết ứng dụng tạo mã xác nhận bằng PHP
Đầu tiên chúng ta sử dụng hàm md5 và ran để mã hóa các ký tự bao gồm số và chữ cái. Khi sử dụng hàm md5() ký tự phát sinh sẽ lên tới 32 ký tự. Và chúng ta chỉ lấy duy nhất 5 ký tự từ chuỗi mã hóa đó bằng hàm substr. Tiếp tục ta lưu đoạn mã hóa này trong session cụ thể $_SESSION['security_code'], để tại trang form ta sẽ sử dụng so sánh với phần nhập liệu của người sử dụng.

Vậy nên đoạn code dưới sẽ giải quyết các tình huống này.


$md5_hash = md5(rand(0,999));
$security_code = substr($md5_hash, 15, 5);
$_SESSION["security_code"] = $security_code;

Kế đến ta khởi tạo tấm hình với chiều rộng và chiều cao mà ta thiết lập thông qua hàm ImageCreate() . Và tiếp tục khai báo 2 màu chính là trắng và đen bằng hàm ImageColorAllocate($image, red, green, blue ). Hàm này sẽ tạo ra một màu sắc từ hệ màu RGB trên tấm hình mà chúng ta vừa khởi tạo.

Tiếp tục ta đổ background của tấm hình sẽ là màu đen và chữ xuất hiện trên tấm hình sẽ là màu trắng bằng hàm ImageFill() và hàm ImageString(). Hàm ImageString có một số đối số cơ bản như sau: ImageString($image, 5, 30, 6, $security_code, $white); Trong đó:

+ $image là hình mà chúng ta khởi tạo.

+ 5: là font-size mà chúng ta quy ước cho ký tự xuất hiện trên hình.

+ 30: là khoảng cách bên trái của tấm hình.

+ 6 : là khoảng cách từ trên của tấm hình.

+ $security_code: là đoạn code sau khi chúng ta cắt ra ở trên.

+ $white: là màu sắc mà chúng ta đã sử dụng hàm ImageColorAllocate() ở trên để khởi tạo ra màu trắng.


$width = 100;
$height = 30;
$image = ImageCreate($width, $height);
$white = ImageColorAllocate($image, 255, 255, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
ImageFill($image, 0, 0, $black);
ImageString($image, 5, 30, 6, $security_code, $white);

Kế tới chúng ta sẽ sử dụng lệnh header để trả nội dung này trở về dữ liệu dạng hình. Và tiến hành khởi tạo định dạng cho file hình mà chúng ta vừa tạo là JPG đồng thời giải phóng hình tạm được sử dụng để khợi tạo ra tấm hình này bằng đoạn code sau:


header("Content-Type: image/jpeg");
ImageJpeg($image);
ImageDestroy($image);
Để dễ quản lý chúng ta sẽ đặt tất cả đoạn code trên vào trong 1 hàm để dễ sử dụng và quản lý chúng tốt hơn. Vậy toàn bộ đoạn code trong trang random_image.php này như sau.



session_start();
function create_image()
{
$md5_hash = md5(rand(0,999));
$security_code = substr($md5_hash, 15, 5);
$_SESSION["security_code"] = $security_code;
$width = 100;
$height = 30;
$image = ImageCreate($width, $height);
$white = ImageColorAllocate($image, 255, 255, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
ImageFill($image, 0, 0, $black);
ImageString($image, 5, 30, 6, $security_code, $white);
header("Content-Type: image/jpeg");
ImageJpeg($image);
ImageDestroy($image);
}
create_image() ;
exit();
?>

Tiếp tục, trong trang form chúng ta phải khởi tạo session để chúng nhận được các giá trị mà ta đã khởi tạo và sử dụng ở trang random_image, kế tới ta kiểm tra xem người dùng có nhấn submit chưa. Nếu có ta sẽ tiếp tục kiểm tra xem người dùng nhập vào textbox có đúng là dãy số hiển thị trên hình ảnh hay không. Và xuất ra thông báo tương ứng với nội dung của người nhập liệu. (xem lại bài 4: Xử lý giá trị form trong PHP)

Sau đây là toàn bộ code của trang form.php.



session_start();
if(isset($_POST['ok']))
{
if($_POST['txtCaptcha'] == NULL)
{
echo "Please enter your code";
}
else
{
if($_POST['txtCaptcha'] == $_SESSION['security_code'])
{
echo "ma lenh hop le";
}
else
{
echo "Ma lenh khong hop le";
}
}
}
?>








Download toàn bộ source code này tại đây
Nguồn từ: http://www.qhonline.info/

Tiền lương

Giờ dạy = ((2.34 x 650.000 x 4t) + (2.34 x 730.000 x8t))/(52x19)
Giờ dạy thêm = giờ dạy x 1.5

Thứ Bảy, 8 tháng 5, 2010

Thay đổi boot grub2 của Ubuntu.

- Mở Terminal gõ lệnh: sudo nautilus
- Gõ password để sử dụng quyền root.
- Cửa sổ mới hiện ra => duyệt tìm và mở tập tin grub trong thư mục /etc/default/
-
GRUB_DEFAULT=0 thay đổi số 0 thành số thứ tự mà bạn muốn mở. Điền saved nếu bạn muốn grub nhớ hệ điều hành của phiên làm việc trước.
- chạy lệnh: sudo update-grub để update những việc vừa làm.

Thứ Tư, 5 tháng 5, 2010

Xampp Web server


* Step 1: Download

Simply click on one of the links below. It's a good idea to get the latest version. :)
A complete list of downloads (older versions) is available at SourceForge.
A detailed overview over the changes and contents of all XAMPP releases is available in the RELEASE NOTES.
XAMPP for Linux 1.7.3a, 2010/1/10
XAMPP Linux 1.7.3a
Attention: If you download these files on a Windows system and you're running McAfee virus scanner you may get a false positive virus warning. This is a problem with McAfee and gzip-compressed files, it should be ignored.

* Step 2: Installation

After downloading simply type in the following commands:
  1. Go to a Linux shell and login as the system administrator root:
    su
  2. Extract the downloaded archive file to /opt:
    tar xvfz xampp-linux-1.7.3a.tar.gz -C /opt
    Warning: Please use only this command to install XAMPP. DON'T use any Microsoft Windows tools to extract the archive, it won't work.
    Warning 2: already installed XAMPP versions get overwritten by this command.
That's all. XAMPP is now installed below the /opt/lampp directory.

* Step 3: Start

To start XAMPP simply call this command:
/opt/lampp/lampp start
You should now see something like this on your screen:
Starting XAMPP 1.7.3a...
LAMPP: Starting Apache...
LAMPP: Starting MySQL...
LAMPP started.

Ready. Apache and MySQL are running.
If you get any error messages please take a look at the Linux FAQ.

* Step 4: Test

OK, that was easy but how can you check that everything really works? Just type in the following URL at your favourite web browser:
http://localhost
Now you should see the start page of XAMPP containing some links to check the status of the installed software and some small programming examples.

The Instant Art example: A small PHP/GD program (since 0.9.6pre1 also a flashy PHP/Ming example, see screenshot). Thanks to Anke Arnold for her font »AnkeCalligraph«.

* A matter of security (A MUST READ!)

As mentioned before, XAMPP is not meant for production use but only for developers in a development environment. The way XAMPP is configured is to be open as possible and allowing the developer anything he/she wants. For development environments this is great but in a production environment it could be fatal.
Here a list of missing security in XAMPP:
  1. The MySQL administrator (root) has no password.
  2. The MySQL daemon is accessible via network.
  3. ProFTPD uses the password "lampp" for user "nobody".
  4. PhpMyAdmin is accessible via network.
  5. Examples are accessible via network.
  6. MySQL and Apache running under the same user (nobody).
To fix most of the security weaknesses simply call the following command:
/opt/lampp/lampp security
It starts a small security check and makes your XAMPP installation quite secure. For example this protects the XAMPP demo pages by a username ('lampp') and password combination.
START AND STOP PARAMETERS
Parameter Description
start Starts XAMPP.
stop Stops XAMPP.
restart Stops and starts XAMPP.
startapache Starts only the Apache.
startssl Starts the Apache SSL support. This command activates the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay activated.
startmysql Starts only the MySQL database.
startftp Starts the ProFTPD server. Via FTP you can upload files for your web server (user "nobody", password "lampp"). This command activates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay activated.
stopapache Stops the Apache.
stopssl Stops the Apache SSL support. This command deactivates the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay deactivated.
stopmysql Stops the MySQL database.
stopftp Stops the ProFTPD server. This command deactivates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay deactivated.
security Starts a small security check programm.

* Stopping XAMPP

To stop XAMPP simply call this command:
/opt/lampp/lampp stop
You should now see:
Stopping LAMPP 1.7.3a...
LAMPP: Stopping Apache...
LAMPP: Stopping MySQL...
LAMPP stopped.

And XAMPP for Linux is stopped.

* Uninstall

To uninstall XAMPP just type in this command:
rm -rf /opt/lampp
Chú ý:
Để tạo site dạng http://localhost/Joomla cần thêm đoạn code sau vào file xampp/apache/conf/httpd.conf

Alias /Joomla/ "/www/Joomla/"

Options Indexes FollowSymLinks MultiViews

AllowOverride all
Order allow,deny
Allow from ഓള്‍

Trong đó /www/Joomla/ là đường dẫn tới thư mục Joomla của bạn

After I rebooted my Linux box XAMPP stopped running! How can I fix this?

Correct. That's normal Linux behaviour (which applies to any other Unix-like system. It's the admin's job to make sure a particular application is started at bootup.
There is no real standard way to configure the boot process of a Linux system, but most of them should allow you to start XAMPP at boot time using the following steps.
  1. First, find out your default runlevel.
    Simply type egrep :initdefault: /etc/inittab.
    You should now see a line containing a number between two colons.
    In most cases 3 or 5 (2 if you're using Debian).
  2. Go into the directory which configures this runlevel. If for example your runlevel is 3, then you have to change into the /etc/rc.d/rc3.d directory:
    cd /etc/rc.d/rc2.d
    If your system didn't provide /etc/rc.d/rc3.d please try also /etc/init.d/rc3.d and /etc/rc3.d.
  3. Now carry out the actual configuration by typing:
    sudo ln -s /opt/lampp/lampp S99lampp
    sudo ln -s /opt/lampp/lampp K01lampp
Now XAMPP should start and stop automatically if you boot or shutdown your machine.

Top things to do after installing ubuntu.

So you’ve just installed Ubuntu 9.10, the cute and cuddly Karmic Koala, but now you’re confronted with a most pertinent question, “What do i do now?” Ubuntu is a very complete and full-featured Linux distribution, but no operating system can come with everything you want. There’s much more fun to be had in what comes after installing the OS on your machine: now you get to set it up with all the best software it didn’t already come with! This list of the top things to do immediately after installing your newly acquired copy of Ubuntu doubles as a general list of great software to try out and use, complete with links to any special instructions on how to set them up, Terminal commands for those who prefer a command-line interface (CLI), and when available, personal package archives (PPA), repositories to keep the applications at their newest version, not just the security updates provided for you by default. Repositories can be added easily by clicking the “Add…” button in the “Other Software” tab of Software Sources and entering the provided APT Line. Feel free to pick and choose; enjoy!

Basic Stuff

Download Mirror & Updates

After every major Ubuntu release (beta, release candidate, and especially the final), the official servers will be unbearably sluggish. To select an alternative server, just launch Software Sources (System ⟶ Administration ⟶ Software Sources) and click the drop-down menu next to “Download from:” and select “Other…” at which point the Choose a Download Server window should pop up. If you know of a fast local server you may select it from the list, or you can try clicking the “Select Best Server” button to launch a tool that will test all the servers for the fastest connection and choose the best result.

Optionally, jump to the “Updates” tab. If you’ll always be running the newest version of Ubuntu and are using third-party repos, which we will be, then leaving the defaults should be fine. “Unsupported Updates (karmic-backports)” gives you, as the name implies, unsupported versions of future packages which are still in development which you probably don’t need or even want except in certain situations like having a newer-model Apple machine that requires bleeding edge updates. Packages may contain new features, introduce new interfaces, and not be sufficiently tested for inclusion in the ‘proposed’ repository. “Pre-released Updates (karmic-proposed)” is just the testing area for updates, recommended only to those interested in helping to test updates and provide feedback. Check that Ubuntu is scheduled to automatically find availably updates daily and to download all updates in the background to save yourself some time when it comes time to install them.

Before you go, head over to the “Statistics” tab and check it if it isn’t already. This anonymously sends the list of software you have installed and how often you use them to help collect statistics on which apps are the most popular.

When you click close, you will likely be prompted to reload the list of available software. Click reload. If you’re prompted with available updates when it finished reloading, follow the instructions to install them. If not, you can always manually check for and install updates via Update Manager (System ⟶ Administration ⟶ Update Manager). You should always keep your computer up-to-date.

Folder and Printer Sharing

If you want to be able to share files, folders, and printers with Windows machines, you’ll need the samba package. You can set this up graphically by right clicking on any folder and selecting “Properties” and going straight to the “Share” tab. Check off “Share this folder” and you should be prompted to install the Windows networks sharing service. After that’s installed, you’ll need to restart and you can click “Create Share” to be able to view the folder and it’s contents from other machines through the network.

Like any package, you may also install samba via Synaptic Package Manager (System ⟶ Administration ⟶ Synaptic Package Manager) or command-line (Applications ⟶ Accessories ⟶ Terminal).

Click here to install or use the following command:

sudo apt-get install samba

Time Synchronization

Ubuntu can keep your computer’s time accurate by syncing up with atomic clocks through tiers of servers while factoring out communication delays, and adjusting the time in a way that does not upset all the other processes that are running. The protocol for this is called Network Time Protocol (NTP). To set up NTP time synchronization graphically, launch Time & Date, also available through (System ⟶ Administration ⟶ Time & Date). Click the keys to unlock settings. Now, you can select your time zone, and configure it to “Keep synchronized with Internet servers”, at which point it will prompt you to Install NTP support. After that, click “Select Servers” and check off the server closest to you.

Click here to install or use the following command:

sudo apt-get install ntp

Restricted Essentials

DVD Playback

Most commercial DVDs are encrypted with Content Scrambling System (CSS), which attempts to restrict the software that can play a DVD. You’ll need to install libdvdcss if you want to play them. You can do so by first installing the libdvdread4 package via Synaptic Package Manager or Terminal.

Click here to install or use the following command:

sudo apt-get install libdvdread4

Then, within a Terminal window, enter:

sudo /usr/share/doc/libdvdread4/install-css.sh

Restricted Extras

The ubuntu-restricted-extras package includes a bunch of things Ubuntu isn’t legally allowed to ship with, namely unrar for unarchiving .rar files, Microsoft TrueType core fonts, Sun Java Runtime Environment (JRE), restricted codecs, and finally Adobe Flash Player. Like the rest of the packages and applications in this list unless noted otherwise, it’s available in the new Ubuntu Software Center (Applications ⟶ Ubuntu Software Center).

Click here to install or use the following command:

sudo apt-get install ubuntu-restricted-extras

I also recommend you at least give a fair chance to Gnash, an open source flash player on the list of high priority Free software projects. To install, you’ll first have to make sure you don’t have Adobe’s flash player installed via Synaptic or Terminal.

Command:

sudo apt-get purge flashplugin-installer nspluginwrapper

Finally, you can install the Gnash plugin via Synaptic of Terminal.

APT Line: ppa:gnash/ppa
Click here to install or use the following command:

sudo apt-get install mozilla-plugin-gnash

Eye Candy

GNOME Shell

The upcoming version 3.0 of the GNOME desktop environment which i can’t describe concisely other than that it is a new interface for interacting with your desktop. Some people think it looks pretty slick, but i won’t weigh in on the issue. If you’d like to try it, there is a version in the Ubuntu repos, but you’ll probably want something more up to date. You can build it yourself without too much difficulty, but hopefully there will be a PPA available soon.

Click here to install or use the following command:

sudo apt-get install gnome-shell

Advanced Desktop Effects Settings

If you want a Custom option in Visual Effects settings in Appearance (System ⟶ Preferences ⟶ Appearance) for some fancier features to play around with and show off, you’ll need Simple CompizConfig Settings Manager, or if you’re feeling more ambitious, Advanced Desktop Effects Settings.

APT Line: ppa:compiz/ppa
Click here to install or use the following command:

sudo apt-get install simple-ccsm

Replace “simple-ccsm” with “compizconfig-settings-manager” for the Advanced Desktop Effects Settings Manager.

Basic Compositing

Some of you may not need or want such superfluous visual effects; perhaps you lack the hardware or restricted drivers for accelerated graphics necessary for Compiz; maybe you just don’t want to use something that isn’t standards compliant, but still want basic compositing which some applications depend on. In that case, Metacity, the default window manager for GNOME, works great! You can enable it graphically, or with a simple command, but make sure to disable Compiz effects in Appearance.

For GUI lovers, hit Alt+F2 to open the Run Applicatoin dialog and enter gconf-editor to launch the GNOME Configuration Editor. In the left-hand sidebar, navigate to Apps ⟶ metacity ⟶ general and back in the main box check off compositing_manager, and Metacity will immediately start compositing, a much smoother transition than to Compiz. If you’re a CLI guy (relax ladies, i did it for the rhyme), you can run a quick command in Terminal.

Command: gconftool-2 -s ‘/apps/metacity/general/compositing_manager’ –type bool true

Extra Themes

There aren’t a whole lot of themes that come with Ubuntu, so if you crave more, there are several packages containing additional themes. Hopefully many of these packages can be merged in the future and have a more refined selection. They all must be installed via Synaptic or the terminal but only the themes from the Bisigi Project provided by the zgegblob-themes package requires the PPA. You can download individual themes from various websites like GNOME-Look.

APT Line: ppa:bisigi/ppa
Click here to install or use the following command:
sudo apt-get install arc-colors community-themes gdm-themes gnome-backgrounds gnome-colors gnome-themes gnome-themes-extras gnome-themes-more metacity-themes shiki-colors zgegblog-themes

Electric Sheep Screensaver

Fractal frames can look pretty sweet. Electric Sheep does a number of cool things with them. Primarily, it displays them as a screensaver, but on top of that and arguably just as cool, it downloads new popular ones through a distributed computing network so that the “gene pool” of animations, or “sheep” as they’re called, is constantly evolving. You can download a starter pack from http://www.archive.org/details/electricsheep-packs-244 and just extract them into ~/.electricsheep

Click here to install or use the following command:

sudo apt-get install electricsheep

Desktop Functionality

Application Launcher

For a beautiful application launcher, complete with plugins and a dock, you can try GNOME + Do.

APT Line: ppa:do-core/ppa
Click here to install or use the following command:

sudo apt-get install gnome-do

Universal Applets

After the death of Screenlets and gDesklets, a new widget framework called Universal Applets is being developed with the goal of producing applets that can be dynamically “plugged” into any application. While GNOME Do is definitely superior at the moment, Universal Applets is a promising concept for the future. It’s only available in a third party repository since it isn’t yet included in the Ubuntu repos and as such isn’t listed in the Software Center. It hasn’t even been packaged for karmic, but the Jaunty packages, though bug-ridden, work for me.

APT line: deb http://download.opensuse.org/repositories/home:/some-guy:/screenlets/xUbuntu_9.04/ ./
Click here to install or use the following command:

sudo apt-get install universal-applets

Clipboard Manager

There is an annoying bug from 2004 in which copy/paste doesn’t work if the source is closed before the paste. Parcellite is a clipboard manager that works around that problem along with providing some other useful features.

Click here to install or use the following command:

sudo apt-get install parcellite

Audio/Video Creation & Editing

Video Editing

PiTiVi is an intuitive and featureful movie editor that was actually designed with the user interface in mind instead of just slopping on one feature after another. It is able to import and export video files in any format supported by the powerful GStreamer framework.

APT Line: ppa:gstreamer-developers/ppa
Click here to install or use the following command:

sudo apt-get install pitivi

Video Screen Capture

If you want to make screencasts to show off your awesome desktop, Instanbul is a great desktop recording tool which, unlike gtk-recordMyDesktop, uses GStreamer. You can install it through Synaptic or Terminal.

Click here to install or use the following command:

sudo apt-get install istanbul

Audio Recording & Editing

Jokosher is a simple yet powerful non-linear, multi-track audio editor. The interface, which was designed from the ground up, provides an integrated environment to create and record music, podcasts and more.

Click here to install or use the following command:

sudo apt-get install jokosher

Webcam

If you have a webcam, you need Cheese. It’s a Photobooth-inspired application for taking pictures and videos from a webcam also based on the GStreamer back-end.

Click here to install or use the following command:

sudo apt-get install cheese

Multimedia Playback

Media Center

Moovida, formerly Elisa, is a beautiful media center which is perfect for setting up a Home Theater PC (HTPC) or TVPC like the Neuros Link and it uses the GStreamer multimedia framework to support playing almost any kind of file.

APT Line: ppa:moovida-packagers/ppa
Click here to install or use the following command:

sudo apt-get install moovida

Video Feeds

Miro, previously known as Democracy Player, is an Internet television application developed by a 501(c)(3) non-profit organization called the Participatory Culture Foundation whose mission is to “enable and support independent, non-corporate creativity and political engagement.”

APT Line: deb http://ftp.osuosl.org/pub/pculture.org/miro/linux/repositories/ubuntu karmic/
Click here to install or use the following command:

sudo apt-get install miro

Media Player

I don’t feel strongly about this, but for those of you who are unsatisfied by Rythmbox, the default music manager for Ubuntu, you may want to try Banshee. It’s a media player and library for music and videos which has a number of cool features.

APT Line: ppa:banshee-team/ppa
Click here to install or use the following command:

sudo apt-get install banshee

Web Browsing

Google Chrome

Mozilla Firefox 3.5 brings some major improvements like HTML 5 support, but we all hate how bloated it is. If you want something faster and more standards-compliant, WebKit browsers are the way to go. Webkit is the layout engine that Epiphany and Google Chrome use to render pages faster than Gecko which is used by Firefox. Chromium is only available through the a PPA and must be installed through Synaptic or Terminal.

APT Line: ppa:chromium-daily/ppa
Click here to install or use the following command:

sudo apt-get install chromium-browser

Epiphany

If you prefer something that integrates more with GNOME, and is in fact the default web browser for it, try Epiphany. You may also add the Epiphany and WebKit PPAs to keep them up-to-date.

APT Line: ppa:webkit-team/epiphany
APT Line: ppa:webkit-team/ppa
Click here to install or use the following command:

sudo apt-get install epiphany-browser

Learning

Flash Cards

Digital flash cards are even more effective because they can accurately use spaced repetition to help you more efficiently retain information. There are actually two great programs i recommend you try and choose for yourself, Mnemosyne and Anki.

Click here to install or use the following command:

sudo apt-get install mnemosyne anki

Brainwave Entrainment

You read that correctly. You can synchronize your brainwaves to that of an external stimulus like sound, light, and even electromagnetic radiation in order to easily induce brain states like sleep for example. Think of it as assisted meditation which is effective at treating conditions like ADD, insomnia, and much more. Gnaural is brainwave entrainment software which generates binaural beats. It is no longer in the repositories and it doesn’t have a PPA, but 32-bit users can download and install the .deb from the website while 64-bit users like myself are forced to compile.

http://gnaural.sourceforge.net/download/

Brain Training

If you like puzzles, logic, and brain teasers, you’ll enjoy keeping your mind in shape with gbrainy.

Click here to install or use the following command:

sudo apt-get install gbrainy

Games

PlayDeb

What good are games when you’re stuck with the same versions for 6 months? PlayDeb is a repository of games which provides you with the latest and greatest that are either not at their newest version in the Ubuntu repos, or not included at all! Installing games is extremely convenient by searching through the PlayDeb.net website and installing games with just a click. You can add it to your sources automatically by installing the playdeb package, or manually.

APT Line: deb http://archive.getdeb.net/ubuntu karmic-getdeb games

wget -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -

Yo Frankie!

This is a beautiful and important Free game— that is, Free software and Free content— which was created to show off what can be produced using Free software. It was made using Blender, mentioned above, as part of the Blender Institute’s first Open Game Project, and based off of the film, Big Buck Bunny, which was the foundation’s second Open Movie Project. Sadly, it isn’t included in the Ubuntu repos, but you can get it with PlayDeb.

Click here to install or use the following command:

sudo apt-get install yofrankie

Nexuiz

For those of you who prefer fast-paced first-person shooters, Nexuiz is a very decent Free game every Linux gamer should try at least once. GameStop even held a Nexuiz “PC gaming challenge” in which interactive kiosks were set up in 10 different stores in 8 US cities and users were given 2 minutes to earn the high score for a $100 gift card by doing the most damage possible to their AI opponents.

Click here to install or use the following command:

sudo apt-get install nexuiz

Donating CPU Power

Distributed Computing

You can volunteer to participate in grid computing to donate your computer’s spare CPU power to charitable projects like protein folding. Berkeley Open Infrastructure for Network Computing (BOINC) is a great way to use your computer to give.

Click here to install or use the following command:

sudo apt-get install boinc-manager

Images and Publishing

Photo Management

Although Ubuntu does come with F-Spot, it does leave many users unsatisfied. If you find yourself among them, you may want to try a young competitor named Solang, which gained popularity during the mono wars (hopefully mostly over?) as being a mono-free alternative.

Click here to install or use the following command:

sudo apt-get install solang

Vector Graphics

Inkscape is a vector graphics editor, with capabilities similar to Illustrator, CorelDraw, or Xara X. It’s an excellent tool for publishing materials in the W3C standard Scalable Vector Graphics (SVG) file format.

APT Line: ppa:inkscape.testers/ppa
Click here to install or use the following command:

sudo apt-get install inkscape

3D Graphics

Not exclusive to still imagery, Blender is an amazing 3D imagery creation suite that has already been used to create films as part of the Open Movie Project.

Click here to install or use the following command:

sudo apt-get install blender

Desktop Publishing

Scribus is a desktop publishing (DTP) application designed for flexible layout and typesetting and the ability to prepare files for professional quality image setting equipment like writing small newspapers, brochures, newsletters, posters and books.

APT Line: ppa:scribus/ppa
Click here to install or use the following command:

sudo apt-get install scribus

Filesharing

Secured P2P

Gnunet framework for decentralized, secure, peer-to-peer networking for anonymous, censorship-resistant file-sharing. You may have heard of Freenet, but you probably haven’t seen how they compare.

APT Line: ppa:teamgnunet/ppa
Click here to install or use the following command:

sudo apt-get install gnunet-gtk



Direct Connect

A great way to share files for students in college networks is using direct connect; sadly, there is no DC client designed for GNOME, nor is there an available port of Shakespeer from Mac, so it seems like the best option is DC++

Click here to install or use the following command:

sudo apt-get install linuxdcpp

Usenet

Although it isn’t free, Usenet downloads are crazy-fast and files show up there first. Possibly even more noteworthy, however, is that for whatever reason it remains unregulated by pirate hunters. Read this guide for more info, but install LottaNZB for your client instead— they’re working to replace HellaNZB with SABnzbd for their back-end.

APT Line: ppa:lottanzb/ppa
Click here to install or use the following command:

sudo apt-get install lottanzb
BitTorrent
Although Miro can already handle torrent files, you probably want a dedicated BitTorrent client, and although Transmission can do the job, you might want something a little more comprehensive. I’m sure you’ll find that Deluge is a feature complete yet lightweight application.
APT Line: ppa:deluge-team/ppa
Click here to install or use the following command:
sudo apt-get install deluge

Time Managment

Alarm Clock

If you keep your computer on at all times and want to toss out your boring alarm clock, or even if not, Alarm Clock provides a lot of nifty scheduling and alert options.

Click here to install or use the following command:

sudo apt-get install alarm-clock

Time Tracking

The Hamster Time Tracker applet helps you track and analyze how much time you spend on different tasks and activities with a graphical overview to make you feel bad for all that time you waste. It can only be installed through Synaptic or Terminal.

Click here to install or use the following command:

sudo apt-get install hamster-applet

Communication

Empathy Instant Messenger

Horray! Empathy is now included with Ubuntu, but if you want the latest version with additional features like geolocation and audio/video chat for MSN, you’ll need to add the Telepathy PPA to your software sources.

APT Line: ppa:telepathy/ppa

Microblogging

Gwibber is a cute little microblogging client for those of you who frequently use sites like Twitter, Identi.ca, Jaiku, Facebook, Digg, and more.

APT Line: ppa:gwibber-team/ppa
Click here to install or use the following command:

sudo apt-get install gwibber

Security & Privacy

On-The-Fly Encryption

Many people use TrueCrypt believing that it’s FOSS, but although the source code is available, it’s development is kept secret and it isn’t considered Free Software by the FSF nor Open Source by the OSI. ScramDisk for Linux (SD4L) is a great OTFE alternative that also supports TrueCrypt containers. Unfortunately, it is not yet included in the default repos, and there isn’t a PPA either, but you can download a .deb to install from their website.

http://sd4l.sourceforge.net/

VPN Access

If you’d like to make sure all of your internet traffic is encrypted and anonymous, you can pass it through a proxy by using a Virtual Private Network service like IPREDator. We can’t kill the music and movie industries if they can make money just by suing all of us!

Click here to install or use the following command:

sudo apt-get install network-manager-pptp

Onion Routing

If you don’t wan’t to pay $5 a month for a VPN like IPREDator but still want to be able to use the web anonymously, you can try The Onion Router, more commonly referred to as TOR, but it is significantly slower and requires additional setup. Although it was in the Ubuntu repos, the version in there was dangerously out-of-date it’s just been removed, so you need to use their repository.

APT Line: deb http://deb.torproject.org/torproject.org karmic main
Click here to install or use the following command:

sudo apt-get install tor tor-geoipdb

Firewall

If you feel the need to have a firewall, Firewall configuration is a graphical front-end for Uncomplicated firewall (ufw).

Click here to install or use the following command:

sudo apt-get install gufw

Antivirus

You generally don’t need antivirus with Linux, but if you’d like to play it safe, you can install the ClamTK Virus Scanner, a graphical front-end to ClamAV.

Click here to install or use the following command:

sudo apt-get install clamtk

System Utilities

LiveUSB Creator

Optical storage disks like CD’s are inconvenient and get scratched up, so why put your installer on a USB instead? UNetbootin allows you to do just that, using any Linux or BSD distribution.

Click here to install or use the following command:

sudo apt-get install unetbootin

Backup

I don’t have any strong feelings as to which backup utility you should use, but i have learned the hard way that you should always have a backup. Back In Time should do everything you need.

Click here to install or use the following command:

sudo apt-get install backintime-gnome

Partition Editor

You can partition you other storage drives, your external hard drive, you USB drive, your iPod, and basically any other writable storage drive you can plug into your computer using the GNOME Partition Editor. It does the trick on Ubuntu installation disks, and it can sure do the trick elsewhere.

Click here to install or use the following command:

sudo apt-get install gparted

Virtual Machine

If you want to be a good user and get testing on the next version of Ubuntu, that’s 10.04 LTS, the Lucid Lynx, but you want to do it safely, get VirtualBox. There’s version that is fully open source (vboxgtk), but you’ll likely want the proprietary features too. It’s installable via Synaptic or Terminal.

APT Line: deb http://download.virtualbox.org/virtualbox/debian karmic non-free
Click here to install or use the following command:

sudo apt-get install virtualbox-3.0

64-bit Specific

Flash Player

The 32-bit flash player runs terribly on 64-bit systems, and if you don’t want to use Gnash, Adobe has released the only 64-bit version of Flash Player 10 for Linux! It currently isn’t in the repositories because it’s still in alpha, but it’s so much more stable than even the final 32-bit version. To install it, download the .tar.gz file at the bottom of this page:

http://labs.adobe.com/downloads/flashplayer10.html

Next, extract the file to your home folder; then just enter this into a terminal window:

sudo cp libflashplayer.so /usr/lib/mozilla/plugins/

Windows Media Audio 9

I’ve looked and looked, and without the Fluendo GStreamer plugin there is no way for 64-bit Ubuntu to play WMA 9 files, and video files that use it will have no sound. You can purchase a copy from the Canonical Store, or download it illegally from The Pirate Bay:

http://thepiratebay.org/torrent/4900791

Explore, Customize, Personalize!

Now it’s time to play around with all the new apps you have and make your desktop, well, yours. You can try experimenting with a cool panel-less desktop; you can experiment with all your new apps; you can try different themes and modify them in Appearance; you can set your preferred applications and explore all your system preferences. My desktop background comes is by David Revoy of Durian, now called Sintel, the Blender Foundation’s latest Open Movie Project.

Don’t for get to show off your shiny new Ubuntu installation to your friends, spread Ubuntu, and donate to your favorite projects!