Showing posts with label Command. Show all posts
Showing posts with label Command. Show all posts

Saturday, January 29, 2011

Use Text based GUI Runlevel configuration tool to add or remove services

In Fedora, we can use chkconfig command to set the run level of the serveice. However, it is missing in Ubuntu.

rcconf is Debian runlevel configuration tool. Rcconf allows you to control which services are started when the system boots up or reboots. It displays a menu of all the services which could be started at boot. The ones that are configured to do so are marked and you can toggle individual services on and off. If rcconf is not installed use apt-get command:
$ sudo apt-get install rcconf


Now run rcconf and just follow on screen instructions:
$ sudo rcconf

Monday, December 20, 2010

Whatweb

What web is it?

When you visit a web, sometimes you just want to obtain information from the web. However, sometimes, you may want to know which server the web uses, which programming language the programmers use, which CMS they use. You may obtain this information from the server response. Here is a simple tool that helps you to find out the answer - Whaweb(http://www.morningstarsecurity.com/research/whatweb).

This is written with Ruby and simply type
$./whatweb url


It will show you the relevant information such as web server.

Sunday, October 3, 2010

[HOWTO] Remove .svn folder under svn repository

When you svn checkout a project via SVN, it will create .svn folder to keep track the changing in this working folder also. However, when you need to give out the source code, this .svn folder may not be good to be distributed to other also. Instead of remove the folder one by one. You can use find command

find PATH -type d -name '.svn' -exec rm -rf {} \;

Friday, September 24, 2010

Communicate Google with Command

On Linux, we offer need to type command and I think using command is better than by clicking most time. This is because I need to control the mouse precisely to certain location. This is not convenient for me at all. In addition, I don't want to leave my hand out of the keyboard, so I remember some useful command such as using Ctrl+L in Firefox to type URL instead of using the mouse to click on the url field. I can navigate different web without leaving keyboard. If you are vim experienced user, I think you should like this firefox plugin - Vimperator which you can navigate webpage with your keyboard only.

Now, Google provides many web applications such as Gmail, Contact, Google Docs and this blog Blooger, etc. Fortunately, Google provides a command line tool for them also named GoogleCL http://code.google.com/p/googlecl/. This is a command line tools for the Google Data APIs.

You can do many things using this command tools just like

1. Blogger - create a new post
$ google blogger post --title "create post using GoogleCL" "I can create a new post in command line"


2. Picasa - upload new image to Picasa
$ google picasa create --title "GoogleCL Photos" *.jpg


3. YouTube - upload new video to YouTube
$ google youtube post --category Education linux_command.mpg


For more usage, you can visit the GoogleCL official website. You will find it is extremely useful and you can cooperate with Crontab with GoogleCL, you can do more such as creating a Calendar everyday.

Thursday, September 23, 2010

Linux is awesome if you remember the commands??

Recently, my friend had to use Linux to do something. After one day working, he told me a statement and I think it is funny: "Linux is awesome if you can remember all the commands, otherwise, Linux sucks."

Then, I think a little bit. That's may not be true since Linux has many choices of Windows Environments like Gnome, KDE, etc. They are easy to use and very handy. Most daily works, you can do them by a few click just likes M$ Windows.

However, I do agree that the commands in Linux is awesome if you know them. Sometimes, I use "wget" to download files instead of browser. I use vi(vim) as my major text editor. Writing a bash script can do more such as starting some services/programs when the Linux starts.

Here are some commands I think they are useful:

1. Ctrl + E and Ctrl + A
Sometimes, you find that you need to modify the command at the beginning or at the end. You can simply press "Home" or "End" to go the first position or last position. However, it doesn't work such as using SSH. If you really want to go to beginning, the stupid way is to press left arrow. In fact, you can use Ctrl+E to move the end and Ctrl+A to move to the beginning.

2. !$ - A useful variable.
This stores the last argument in the previous command. Here is an example to this variable.
$ mkdir folder
$ cd folder


In fact, you can you use the following commands:
$ mkdir folder
$ cd !$


3. A crazy command, I like this command very much!
$ :(){:|:&};:

It seems that it is an invalid command. In fact, this does work!!
First of all, :(){ ... } defines a function called ":" with no arguments. In side this function, is call ":" again and "|"=pipe the output to itself. The semi-colon end the function definition and the last colon call the function.
To be concluded, this command call a function that recursively creates a process. Then, your system will hang..