Sunday, December 19, 2010

Flash/Flex/Air

http://www.slideshare.net/tbisaacs/flash-flex-air-a-brief-survey

database storage in adobe air

http://blog.crankybit.com/notes-adobe-air-local-data-storage-options/

Tuesday, October 26, 2010

Find mac address in windows

1. ipconfig -all

You will find a line having text "Physical address". This is the Mac address

2. Straight Forward Command => getmac

Tuesday, September 14, 2010

How to setup the GIt server

Use link to setup the git server

http://ao2.it/wiki/How_to_setup_a_GIT_server_with_gitosis_and_gitweb

Tuesday, July 20, 2010

permission issue while deploying the code to the server using capistrano

sudo chmod go-rw /var/lib/gems/

This command will give the permission only to current user.

Wednesday, July 14, 2010

GIT

1. While fetching a pull some time we get a error "can not merge due to local changes"
To get rid of this issue
=> git stash
=> git pull
=> got stash apply

2.if you are sure those changes got no value you can also: git reset --hard (that will remove the changes you have)

3. Just run the following command on the file or path you want to ignore the changes of:
git update-index --assume-unchanged

If you wanna start tracking changes again run the following command:
git update-index --no-assume-unchanged

4. http://www.sourcemage.org/Git_Guide

5. How to resolve the git merge :http://stackoverflow.com/questions/2073841/git-marking-files-as-resolved

Thursday, June 17, 2010

ROR Refrences

  • Railscasts: Excellent free Rails screencasts
  • PeepCode, Pragmatic.tv, EnvyCasts: Excellent commercial screencasters
  • Rails Guides: Good topical and up-to-date Rails references. Rails Tutorial refers frequently to the Rails Guides for more in-depth treatment of specific topics.
  • Rails blogs: Too many to list, but there are tons of good ones

Wednesday, June 16, 2010

what is RAKE

Rake is a build language, similar in purpose to make and ant. Like make and ant it's a Domain Specific Language, unlike those two it's an internal DSL programmed in the Ruby language.Rake is written in Ruby and heavily uses the language.

The basic idea of a domain specific language (DSL) is a computer language that's targeted to a particular kind of problem, rather than a general purpose language that's aimed at any kind of software problem.

namespace :kho do
desc "Hey"
task :sandeepa => [:clean, you can include multiple depedency ] do
puts "Hello world"
end
end


For detail please visit
http://martinfowler.com/articles/rake.html

Tuesday, June 15, 2010

SOME USEFUL LINUX COMMANDS

Look at all the running ports and processes in ubuntu
sudo netstat -ltp

get a list of all packages installed in your ubuntu machine in a file
dpkg --get-selections > installed-software

On any new machine perform following commands
dpkg --set-selections < installed-software
apt-get -u dselect-upgrade

Monday, June 14, 2010

How to install chrome in ubuntu

Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. The Chromium codebase is the basis for Google’s Chrome browser.

First you need to edit the /etc/apt/sources.list file

sudo gedit /etc/apt/sources.list

Add one of the following

For ubuntu 9.10 (armic) Users add the following two lines

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

For ubuntu 9.04 (Jaunty) Users add the following two lines

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu jaunty main

For ubuntu 8.10 (Intrepid) Users add the following two lines

deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu intrepid main

Save and exit the file

Now add the GPG key using the following command

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5

Update the source list using the following command

sudo apt-get update

Install chromium using the following command

sudo apt-get install chromium-browser

Using Chromium

You can open chromium from Applications--->Internet--->Chromium Web Browser


Thursday, May 27, 2010

What is IP address


Every machine on the Internet­ has a unique identifying number, called an IP Address. A typical IP address looks like this:

* 216.27.61.137

­To make it easier for us humans to remember, IP addresses are normally expressed in decimal format as a "dotted decimal number" like the one above. But computers communicate in binary form. Look at the same IP address in binary:

* 11011000.00011011.00111101.10001001

­­The four numbers in an IP address are called octets, because they each have eight positions when viewed in binary form. If you add all the positions together, you get 32, which is why IP addresses are considered 32-bit numbers. Since each of the eight positions can have two different states (1 or 0) the total number of possible combinations per octet is 28 or 256. So each octet can contain any value between 0 and 255. Combine the four octets and you get 232 or a possible 4,294,967,296 unique values!

Out of the almost 4.3 billion possible combinations, certain values are restricted from use as typical IP addresses. For example, the IP address 0.0.0.0 is reserved for the default network and the address 255.255.255.255 is used for broadcasts.


­ The octets serve a purpose other than simply separating the numbers. They are used to create classes of IP addresses that can be assigned to a particular business, government or other entity based on size and need. The octets are split into two sections: Net and Host. The Net section always contains the first octet. It is used to identify the network that a computer belongs to. Host (sometimes referred to as Node) identifies the actual computer on the network. The Host section always contains the last octet. There are five IP classes plus certain special addresses:

Wednesday, May 26, 2010

Resolve 403 error in ubuntu while using LAMP

Hi folks

Many of you might have encountered "403" issue while working on LAMP in ubuntu.
here is the solution to resolve the issue.
Open the terminal and enter as root user, Move to the project folder and type the following command


chmod 0777 -R

Have happy coding...
Ubuntu Questions

Difference b/w find and locate command in ubuntu

Ans: Locate uses an internal database to look up indexed files. This database needs to be updated using the command 'updatedb' at regular intervals, so that you'll get more accurate results. Find just does a "normal" search, ie. it just goes through the given path(s) just when you want it to.

What is pipe command

Ans: It is used to filter the output of command, which then will be served as input to another command
eg. gem list | grep "r"

Will list all gems which contains "r" alphabet.You can perform more adequate search by including the regular expression using grep.
Important Linux Commands

1. Retrieving a Software Package

If you need to install some software by retrieving the source package, you can save a step from the process of downloading the package to your laptop and then transferring the file anew via FTP client. Instead, just retrieve the package directly from your web server using the wget command. For instance, to retrieve the latest version of the Zend Framework you can just copy the download link directly from the Zend Framework website and then pass it to the wget command like this:

%>wget http://framework.zend.com/releases/ZendFramework-1.10.3/ZendFramework-1.10.3-minimal.tar.gz

2. Monitoring Server Processes

These days a typical website is powered by much more than just a few HTML pages, often relying on various regularly executing server-side scripts to carry out a variety of maintenance-related tasks. You can keep tabs on your server's executing processes using the top command. This command provides you with a real-time overview of the server's processor activity and memory consumption, listing all processes, the process owner, percentage of CPU used, and duration of execution.

To execute top, just run the command from the command line without any accompanying options (although other options are supported). For instance, the following output was produced after executing the top command on my Ubuntu laptop:

%>top
...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2121 wjgilmor 20 0 956m 389m 44m R 66 13.5 1692:22 firefox
1136 root 20 0 126m 42m 16m S 12 1.5 67:22.95 Xorg
7297 wjgilmor 20 0 119m 41m 16m S 4 1.4 25:19.19 filezilla
1919 wjgilmor 20 0 95828 9.8m 7908 S 2 0.3 38:54.57 pulseaudio
14159 wjgilmor 20 0 2468 1084 784 R 2 0.0 0:00.02 top
1 root 20 0 2660 1528 1128 S 0 0.1 0:01.05 init

3. Reviewing Log Files

You'll often need to review your server's log files to monitor and resolve any unexpected errors and other issues. Of course, these log files have a tendency to grow as rapidly as your traffic volume. Many novice Linux users will be familiar with the DOS more command, which they use to page through even large log files. Linux offers a far more efficient method for reviewing files, particularly the "end" of files: using the tail command. For instance, to display the last 10 lines of a file just pass the file to the tail command:

%>tail /var/log/apache/error.log

You can use the -n switch to specify a larger number of lines, additionally using the more command to view the output one screen at a time:

%>tail -n 100 /var/log/apache/error.log | more

To interactively output the newly appended lines as they appear in the file, you can use the -f switch, which will refresh the output every few seconds:

%>tail -f /var/log/apache/error.log

4. Copying Files with scp

An FTP client such as FileZilla works well for transferring files between a developer's laptop and web server, but what about when you need to transfer a file while in the midst of an SSH session? Rather than go through the hassle of logging into the server anew using an FTP client, consider using the scp (secure copy) command. I demonstrated this command in the WDVL.com article "Manage Your Server Accounts Securely with Key-based Authentication," using it to copy my public key to the web server:

%>scp id_rsa.pub webuser@192.168.1.103:/home/webuser/.ssh/id_rsa.pub

In this example, I copy the file id_rsa.pub to the web server identified by the IP address 192.168.1.103 using the server account webuser, and placing the file in the directory /home/webuser/.ssh/.
5. Finding World-writable Files

For security reasons you should always ensure that your website's public-facing files are not world-writable. Otherwise, you could leave your server vulnerable to defacement by an outside party. Hopefully, you configure your file ownership and permissions to disallow such a gaffe from the outset, but it doesn't hurt to regularly audit your server to confirm no such security holes exist. Rather than exhaustively browse the server documents directory, you can instead use the find command to scan a specific directory structure for files configured with certain permissions:

%>find /var/www/ -type f -perm -o+w -exec ls -l {} \;

In this example, I tell find that I'm looking for files (by setting the -type option to f). You can alternatively search for directories by setting -type to d. Finally, I use the -exec option in order to format any found files using the ls command.
6. Backing Up Your Web Directory

Your web hosting provider presumably has implemented a fairly routine backup service. However, I nonetheless encourage you institute your own backup procedure in order to be absolutely certain you'll be able to easily restore your site in the event of a catastrophic server failure. Quite a few solutions exist for backing up your data, among them Amanda, but you can create your own home-brewed solution using the tar command. For instance, to back up the web directory located at /var/www/www.wjgilmore.com while preserving file permissions and excluding the directory /var/www/www.wjgilmore.com/cache/ (as it contains cached files, which are not important for backup purposes), use the following command:

%>tar cpzf www.wjgilmore.com.backup.042710.tgz /var/www.wjgilmore.com

To restore the directory structure, you again use tar, but this time passing the x switch:

%>tar xvpfz www.wjgilmore.com.backup.042710.tgz -C /var/www/

Using tar in conjunction with scp and key-based authentication, you could completely automate the backup process and move the tar file to a remote server!
7. Viewing Your Command History

When getting acquainted with Linux's occasionally esoteric syntax, you'll regularly attempt to recall a particular syntax you executed while attempting to debug a server problem. Rather than continuously referring to bookmarks or other learning resources to recreate the command, you could review your command history using the history command. Executing history will produce a list of the commands you executed. A sample of the output looks like this:

119 more chapters/staging/chapter06.docbook
120 ./convert_program_listings.rb
121 ./convert-chunks.sh
122 pwd
123 dir
124 more .gitignore
125 vim .gitignore
126 git init

Because each command is accompanied by its sequence number, you can easily execute it anew simply by prefacing the sequence number with an exclamation mark, like this:

%>!124
more .gitignore
betas/
cache/
chapters/staging

8. Creating Directory Trees

You'll often need to create a series of nested directories, particularly when starting new projects. Most novice users tediously create each directory by using the mkdir command and then enter each newly created directory only to create the next. You can perform this task in mere seconds using the -p option. For instance, the following example will create a new project directory named webapp, a directory named application inside it, and a directory named controllers inside application:

%>mkdir -p webapp/application/controllers

9. Creating Command Aliases

For whatever reason, I almost always prefer to list directory contents using a format that displays the permissions, owner and group names, size, modification date, and name, by passing the -al option to the ls command:

%>ls -al

Because I use this command so frequently, I've aliased it to something easier to type, namely dir, using the alias command:

%>alias dir='ls -al'

These aliases, however, are lost when you logout of the current session. To make them permanent, you can add them to an account configuration file such as .bashrc.
10. Managing Source Code with git (or svn, or bzr...)

This concluding section isn't so much about a particular command, but rather about one of several possible commands, which perhaps more than any other introduced here you should be well acquainted with if you're not already. The git, svn and bzr commands refer to the command-line interfaces used by the Git, Subversion, and Bazaar version control solutions, respectively. Version control is an essential tool no matter the web project's size and scope, and you're doing both yourself and your clients a significant disservice if you don't rigorously manage projects using one of these powerful solutions.

Even if you don't believe that maintaining a well-documented history of your project's lifecycle is worth the effort, the benefits of version control solutions stretch far beyond mere project management. For instance, you can use basic Git commands to easily deploy and update your website code directly from your development laptop. Although numerous approaches exist, one of the easiest ways is to clone the repository containing your site code to the live server. For instance, if you were using GitHub to host your website repository (call the repository wjgilmore), you could use the following command to retrieve the latest version of your repository:

%>git clone git://github.com/wjgilmore/wjgilmore.git

You can find more sophisticated deployment solutions such as Capistrano, which is regularly used to deploy both Rails and PHP projects.

**Command to change the owner of the directory
chown icreon var/

** Only the current user will have the permission of read and wrirtes
sudo chmod go-rw /var/lib/

Conclusion

Linux's command-line capabilities are so vast that this article easily could have covered 1,000 commands rather than a mere 10. Nonetheless, it hopefully was enough to whet your appetite for the incredible power that even occasional users can wield!