Tips n Tricks for Linux

Status
Not open for further replies.

silent008

Broken In
Re: Mounting .iso and .mds/mdf Files in Linux

T159 said:
restoring whole MBR may destroy your partitions (if u hav recently repartitioned ur drive after making a backup of whole MBR).

So its better to backup only boot information and not partition info.
*farm3.static.flickr.com/2265/2107306410_c1c400ede5_o.png
Correct me if am wrong
yes it is true that is why it has been specified that bootsector size is 446 bytes.
Simply replace 512 by 446
 

coolpcguy

Resistance is Futile.
Changing Bootsplash in openSUSE10.3

Alright so let’s have a look at how to change bootsplash screen. Note that this is written with openSUSE as the target distro, the same steps should work with all distros which have bootsplash package installed, if you don’t have it installed or are unsure if bootsplash is present, head over to *www.bootsplash.org/ and check it out.
Boot splash screens are the screens that show up when you’re booting up or shutting down Linux. Basically while Linux boots, there are 2 modes-silent mode and verbose mode. In silent mode only the picture is shown, while in verbose mode the pictures as well as boot up messages are shown.
The bootsplash actually is a theme. The theme file(or rather theme directory) is stored in /etc/bootsplash/themes/ directory. The theme directory consist of 2 more directories: images and config. In addition to these, the theme directory optionally has animations and bootloader directories/ The directory naming convention is self-explanatory so I will not go into more details into these.

So let’s get to the action and start changing!


Step 1: Get the theme!
You can get some awesome themes from *www.kde-look.org My personal favorites are Fingerprint and Tattoo’s Girl(search for them in the site mentioned above).

Step 2: Extract the file
After downloading the file(most likely to be in .tar.gz or in .bz2 format), extract the archive to your home directory.

Step 3: Copy to right directory
If you are using openSUSE(10.2 and above) then Click on the K Menu, and type Konqueror in the search box and select File Manager(Super User mode).
For other distros, open the terminal and type kdesu konqueror. Enter the root password when prompted. Browse over to /etc/bootsplash/themes/ and copy the theme directory to this directory.
Your theme directory should be as shown in the picture:
Step 4: Instruct bootsplash to use the new theme.
Click on YaST2, then on System and click on /etc/sysconfig editor. Then click on the “+” besides System, then on Boot and then on THEME. Under setting of theme text box type the name of the directory.


Step 5: Configure init to use the new splash screen
Open Konsole, switch over to root by typing su root and then enter mkinitrd. If all goes well, you should see the bootsplash: <theme name> (resolution) message as shown in the below screen shot.
Happy tweaking!

Note: While downloading themes, don’t forget to choose a theme which matches with the bootsplash screen resolution! Else instead of the splash screen, you will be greeted by boot up messages instead. For changing the boot splash resolution, Launch YaST, click on System, Boot Configuration, click on the entry for openSUSE and Click on Edit. At lower end you’ll see a box for VGA. In this, write the code for the required modes.
Resolution VGA Mode Number
640×480 785(16-bit), 786(24-bit)
800×600 788(16-bit), 789(24-bit)
1024×768 791(16-bit), 792(24-bit)
1280×1024 794(16-bit), 795(24-bit)
 

coolpcguy

Resistance is Futile.
Formatting a USB Pen Drive in Terminal

Insert your USB pen drive. Let it get detected and mounted. Open Terminal. Type The Following commands
1. dmesg |tail –> here the ‘|’ key is the pipe, ie, the key before the backspace key(the upper one, so press shift)
You’ll get something like
Code:
sathya@shaman:~$ dmesg |tail
[ 9921.681164] [B]sda[/B]: Write Protect is off
[ 9921.681174] sda: Mode Sense: 23 00 00 00
[ 9921.681178] sda: assuming drive cache: write through
[ 9921.709138] SCSI device sda: 4030464 512-byte hdwr sectors (2064 MB)
[ 9921.720951] sda: Write Protect is off
[ 9921.720963] sda: Mode Sense: 23 00 00 00
[ 9921.720967] sda: assuming drive cache: write through
[ 9921.721225] sda:
[ 9921.727896] sd 0:0:0:0: Attached scsi removable disk sda
[ 9921.744187] sd 0:0:0:0: Attached scsi generic sg0 type 0

Note the terms 'sda'. In your system it will be different, maybe sdb or something. Whatever it may be, make sure to substitute it in the commands below, else your hard disk may get formatted.
2. Unmount your pen drive by using
Code:
sudo umount /dev/sda
(In your case, please substitute sda with the appropriate device, listed above.
3. use the mkfs.vfat command to format to FAT32 filesystem, or mkfs.ext3 to format to ext3 filesystem
Code:
sudo mkfs.vfat -n ‘Label’ -I /dev/sda
Replace Label with the name you want the pen drive to have.
4. That’s it! When done formatting, you’ll be returned to the prompt
Code:
sathya@shaman:~$ mkfs.vfat -n ’sathya’ -I /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
sathya@shaman:~$
Remove and insert the pen drive to have mounted again!
 

praka123

left this forum longback
chroot howto especially for Debian and ubuntu

chroot is used in systems which is in really broken condition.
you can use chroot from a livecd or another distro on harddisk.
usage:
mount your broken linux partition:
Code:
mount /dev/sdx   /mnt
where /dev/sdx is the linux partition which is broken
now,
Code:
mount --bind /dev/ /mnt/dev/

now as root (or sudo in ubuntu etc),
Code:
chroot /mnt/ /bin/bash
Code:
mount /proc
that's it!now u can do the fdisk and other useful commands in chroot jail :)
this is especially written for Ubuntu gutsy which needs to sync /dev/ inorder to show partitions.
 

gary4gar

GaurishSharma.com
Re: Formatting a USB Pen Drive in Terminal

Insert your USB pen drive. Let it get detected and mounted. Open Terminal. Type The Following commands
1. dmesg |tail –> here the ‘|’ key is the pipe, ie, the key before the backspace key(the upper one, so press shift)
You’ll get something like
Code:
sathya@shaman:~$ dmesg |tail
[ 9921.681164] [B]sda[/B]: Write Protect is off
[ 9921.681174] sda: Mode Sense: 23 00 00 00
[ 9921.681178] sda: assuming drive cache: write through
[ 9921.709138] SCSI device sda: 4030464 512-byte hdwr sectors (2064 MB)
[ 9921.720951] sda: Write Protect is off
[ 9921.720963] sda: Mode Sense: 23 00 00 00
[ 9921.720967] sda: assuming drive cache: write through
[ 9921.721225] sda:
[ 9921.727896] sd 0:0:0:0: Attached scsi removable disk sda
[ 9921.744187] sd 0:0:0:0: Attached scsi generic sg0 type 0

Note the terms 'sda'. In your system it will be different, maybe sdb or something. Whatever it may be, make sure to substitute it in the commands below, else your hard disk may get formatted.
2. Unmount your pen drive by using
Code:
sudo umount /dev/sda
(In your case, please substitute sda with the appropriate device, listed above.
3. use the mkfs.vfat command to format to FAT32 filesystem, or mkfs.ext3 to format to ext3 filesystem
Code:
sudo mkfs.vfat -n ‘Label’ -I /dev/sda
Replace Label with the name you want the pen drive to have.
4. That’s it! When done formatting, you’ll be returned to the prompt
Code:
sathya@shaman:~$ mkfs.vfat -n ’sathya’ -I /dev/sda
mkfs.vfat 2.11 (12 Mar 2005)
sathya@shaman:~$
Remove and insert the pen drive to have mounted again!
but this will erase all data on disk, Please give a warning atleast:p
 

vish786

"The Gentleman"
Recover deleted files from memory card

Recover deleted files from memory card

*goinggnu.wordpress.com/2008/02/14/recover-deleted-files-from-memory-card/
 

praka123

left this forum longback
gnome-dictionary shortcut setup

adding gnome-dictionary shortcut as CTRL+SHIFT+D :
open a terminal(from menu Applications>Accssesories>Terminal) and run:
Code:
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_9 "<Control><Shift>d"
and then:
Code:
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_9 "gnome-dictionary"
Now try the key combination to launch gnome-dictionary.
u can add such shortcuts for some applications.also u can browse via "gconf-editor" graphically :)
 

praka123

left this forum longback
fast copying files :-

Here:
*gentoo-wiki.com/TIP_Fast_Copy
The normal way

To copy files recursively from src1/, src2/, to dest/ you do
Code:
cp -Rv src1/ src2/ dest/
The piped and pax way

cp uses character by character copy. Using the kernel pipes support, we could copy files block by block. tar converts the directories recursively into a single stream. At one end we create a single stream out of source directories and at other end we extract this stream and put it in the destination directory. The transfer between the two ends is by means of pipes.
Code:
tar -c src1/ src2/ | tar -C dest/ -xv
This is not necessarily faster, but is much more flexible.


Note that ext2, ext3 and most modern Linux filesystems have a capability called 'sparse files'. This is used to store large files with lots of zeroed content in an efficient manner. Most of the time you should not care about this, but certain programs make extensive use of this feature (e.g. net-p2p/mldonkey). You should be careful when copying sparse files using this method, as your disk usage can explode. Whereas the cp utility does handle sparse files automatically, tar does not. Sparse files in the source directory will be stored in full representation on the destination directory, unless the -S flag is used on the lefhand side of the pipe.
Also PAX can be used with the same result
1. cd into the directory
2. Check destination exists.
3. Issue the next command.

Code:
pax -rw . destination_directory
And it is easier to remember.
for complete tips for copying fast(for network etc) refer:
*gentoo-wiki.com/TIP_Fast_Copy
 

praka123

left this forum longback
For NVIDIA graphics card based systems:-
Those using Compiz/Fusion or Beryl may not want to enable below option
Reason:
in order to avoid periodic short-term freezes on beryl and other OpenGL intensive programs.instead : (Option "UseEvents" "false")

To fix Xorg's CPU usage shootup when using NVIDIA driver:
With many NVidia cards, when using a proprietary driver, xorg seems to freeze with high cpu usage. To fix this issue, add the below option to /etc/X11/xorg.conf under the Device section.
Code:
Option "UseEvents" "on"
Below shows how this change will look under the Device section.
Code:
Section "Device"
Identifier "Videocard0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce FX 5200"
[b]Option "RenderAccel" "on"
Option "UseEvents" "on"[/b]
EndSection
source (redhat magazine):
*www.redhatmagazine.com/2007/11/20/...-cpu-usage-shoot-up-when-using-nvidias-driver

some options you would like to add when using "nvidia" driver(proprietary) :-

Code:
    Option         "AddARGBVisuals" "True"
    Option         "AddARGBGLXVisuals" "True"
    Option         "NoLogo" "True"
    Option         "UseEdidDpi" "FALSE"
    Option         "DPI" "96 x 96"
use the dpi acc to the need.see "man nvidia-xconfig" for more info . :)
 
Last edited:

gary4gar

GaurishSharma.com
Get Max Of Apt-url, Let Firefox be your app installer;)
Here's a trick:
1) In Firefox, click Bookmarks->Organize Bookmarks.
2) Click New Bookmark. Under location, type
Code:
apt:%s
3)Under keyword, type "install" without the quotes. From then on, you can install software from inside Firefox by typing "install (package)"

To install istanbul Desktop session recorder
simple type this in location bar
Code:
install istanbul

pretty useful for me atleast,as Firefox is always open in my pc.
so no need to open Synatic separately;)


I learned it on Digg
 

gary4gar

GaurishSharma.com
The live cd list
*www.frozentech.com/content/livecd.php

make your own live cd
*www.linux-live.org/

The Linux Gamers' Game List
*www.icculus.org/lgfaq/gamelist.php?license=free
 
Last edited:

shady_inc

Pee into the Wind...
To ensure that a file can't be deleted even by a root user, use the following command as root:
chattr +i <filename>
To make it deletable again use:
chattr -i <filename>
:D
 

topgear

Super Moderator
Staff member
To view information about your Optical ( ie. CD/DVD ) Drive issue this command :

Code:
cdrecord -prcap


output of the cdrecord -prcap command for example :


Device was not specified. Trying to find an appropriate drive...
Detected CD-R drive: /dev/cdrw
Using /dev/cdrom of unknown capabilities
Device type : Removable CD-ROM
Version : 5
Response Format: 2
Capabilities :
Vendor_info : 'HL-DT-ST'
Identification : 'DVDRAM GSA-H10N '
Revision : 'JL12'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.

Drive capabilities, per MMC-3 page 2A:

Does read CD-R media
Does write CD-R media
Does read CD-RW media
Does write CD-RW media
Does read DVD-ROM media
Does read DVD-R media
Does write DVD-R media
Does read DVD-RAM media
Does write DVD-RAM media
Does support test writing

Does read Mode 2 Form 1 blocks
Does read Mode 2 Form 2 blocks
Does read digital audio blocks
Does restart non-streamed digital audio reads accurately
Does support Buffer-Underrun-Free recording
Does read multi-session CDs
Does read fixed-packet CD media using Method 2
Does not read CD bar code
Does not read R-W subcode information
Does read raw P-W subcode data from lead in
Does return CD media catalog number
Does return CD ISRC information
Does support C2 error pointers
Does not deliver composite A/V data

Does play audio CDs
Number of volume control levels: 256
Does support individual volume control setting for each channel
Does support independent mute setting for each channel
Does not support digital output on port 1
Does not support digital output on port 2

Loading mechanism type: tray
Does support ejection of CD via START/STOP command
Does not lock media on power up via prevent jumper
Does allow media to be locked in the drive via PREVENT/ALLOW command
Is not currently in a media-locked state
Does not support changing side of disk
Does not have load-empty-slot-in-changer feature
Does not support Individual Disk Present feature

Maximum read speed: 8467 kB/s (CD 48x, DVD 6x)
Current read speed: 8467 kB/s (CD 48x, DVD 6x)
Maximum write speed: 8467 kB/s (CD 48x, DVD 6x)
Current write speed: 8467 kB/s (CD 48x, DVD 6x)
Rotational control selected: CLV/PCAV
Buffer size in KB: 2048
Copy management revision supported: 1
Number of supported write speeds: 7
Write speed # 0: 8467 kB/s CLV/PCAV (CD 48x, DVD 6x)
Write speed # 1: 7056 kB/s CLV/PCAV (CD 40x, DVD 5x)
Write speed # 2: 5645 kB/s CLV/PCAV (CD 32x, DVD 4x)
Write speed # 3: 4234 kB/s CLV/PCAV (CD 24x, DVD 3x)
Write speed # 4: 2822 kB/s CLV/PCAV (CD 16x, DVD 2x)
Write speed # 5: 1411 kB/s CLV/PCAV (CD 8x, DVD 1x)
Write speed # 6: 706 kB/s CLV/PCAV (CD 4x, DVD 0x)

Supported CD-RW media types according to MMC-4 feature 0x37:
Does write multi speed CD-RW media
Does write high speed CD-RW media
Does write ultra high speed CD-RW media
Does write ultra high speed+ CD-RW media
 

praka123

left this forum longback
eh?command got changed after distros(debian esp) ditched cdrecord for wodim(cdrkit),so
Code:
wodim  -prcap
^will work for ubuntu et al.
Code:
wodim -checkdrive
 

QwertyManiac

Commander in Chief
To speed up your boot by around 6-8 seconds (If there's a delay where your splash screen or your dmesg@boot hangs momentarily at just the startup) simply go to your BIOS and disable the Legacy USB support.
 
Status
Not open for further replies.
Top Bottom