LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

Comment a block in shell

Posted 08-31-2011 at 12:22 AM by hi2arun
Tags bash, script

We all know, to comment out a line in shell script, '#' token is inserted in the line that needs to be made dead.
Eg:

Code:
# This is a dead line
echo "This line is live"
However, '#' token can be pesky if a block of lines need to be commented out.
Say, to comment out the following block using '#'

Code:
# comment starts here
# All these lines
# are blocked
# using '#' token
# ...
# ...
# ...
...
Member
Posted in Uncategorized
Views 862 Comments 0 hi2arun is offline
Old

Mapping address to line - Linux

Posted 08-31-2011 at 12:20 AM by hi2arun
Tags debug, kernel, panic

Well.. when you write your own kernel module, in the devel stage, chances for bringin down the kernel (panic.. ah sick) are huge.
Oops (pet name for kernel panic) mostly spits lots of martian traces that include stack addresses, registers and its value, EIP, etc.

To know the culprit line that caused panic, decode the address to line as follows:
EIP wud luk like...
Code:
EIP: [] ip_check+0x45a/0x21a [ip_tables] SS:ESP 0049:c098281a
Look at the selection...
Member
Posted in Uncategorized
Views 1336 Comments 0 hi2arun is offline
Old

How to see what is in an RPM without installing it?

Posted 08-31-2011 at 12:18 AM by hi2arun

Datz simple!
1. Create a temp directory
Code:
# mkdir x
2. Change directory
Code:
# cd x
3. Now extract the RPM
Code:
# rpm2cpio /path/of/ur/RPM/file.rpm | cpio -dmi
There u go! Now you have ur RPM xtractd in directory 'x'
Member
Posted in Uncategorized
Views 647 Comments 0 hi2arun is offline
Old

"Wait until a process ends, a download ends, or a file conversion ends, then do X"

Posted 08-30-2011 at 03:06 PM by the dsc (linux-related notes)
Updated 08-30-2011 at 09:41 PM by the dsc (a small improvement)

Sometimes you want the computer to shut down after you've finished downloading something or converting some large file into some other format, but you want to go out or go to sleep instead of waiting and checking for it yourself.

For these situations I've come up with two tiny scripts. The first one waits until a file hasn't changed its size on three consecutive intervals of twenty seconds:

Code:
a=0 ; file="$1" ; if [ -f "$file.part" ] ; then file="$file.part"
...
Member
Posted in Uncategorized
Views 863 Comments 0 the dsc is offline
Old
Rating: 3 votes, 3.67 average.

Recovering Windows boot after deleting the Linux partitions

Posted 08-30-2011 at 02:32 PM by TobiSGD
Updated 08-30-2011 at 02:36 PM by TobiSGD

So you tried Linux in dual-boot with your Windows installation and after you deleted the Linux partition(s) your Windows won't boot anymore.
There is a simple fix for that, you have to just re-install your Windows boot-loader.

Windows XP:
  1. Boot the system from your Windows XP-CD, just like you booted the Linux-CD/DVD before.
  2. Start the recovery/repair console (not the repair installation).
  3. Type
    Code:
    fixmbr.exe
    and press Enter.
  4. Reboot.

Windows Vista/7:
  1. Boot the system
...
Moderator
Posted in Uncategorized
Views 2858 Comments 2 TobiSGD is offline

  



All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration