1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

<-----------ur Contribution....tips Reserviour

Discussion in 'Linux and Unix' started by healtheworld, Oct 17, 2003.

Mark Solved
Thread Status:
Not open for further replies.
Advertisement
  1. healtheworld

    healtheworld Guest Thread Starter

    Share ur linux tips to simplify....
    One thing I like to do is paste this into my /etc/profile file:

    DEFAULT="\[\033[0;0m\]"

    BLACK="\[\033[0;30m\]"
    BLUE="\[\033[0;34m\]"
    GREEN="\[\033[0;32m\]"
    CYAN="\[\033[0;36m\]"
    RED="\[\033[0;31m\]"
    PURPLE="\[\033[0;35m\]"
    BROWN="\[\033[0;33m\]"
    LGRAY="\[\033[0;37m\]"

    DGRAY="\[\033[1;30m\]"
    LBLUE="\[\033[1;34m\]"
    LGREEN="\[\033[1;32m\]"
    LCYAN="\[\033[1;36m\]"
    LRED="\[\033[1;31m\]"
    LPURPLE="\[\033[1;35m\]"
    YELLOW="\[\033[1;33m\]"
    WHITE="\[\033[1;37m\]"


    then I can set up my PS1's using $WHITE or what ever color I want through out my Command prompt and just add $DEFAULT at the end so the text you type isnt colored


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~``
    find this usefull for manually running my backup scripts.

    To run a command line program in background:

    Follow your command with an &

    $./mycommand &
     
  2. healtheworld

    healtheworld Guest Thread Starter

    CD burning tips
    Some CD burning tips:
    # Burn an ISO to disk
    cdrecord -v speed=5 dev=0,0,0 -data /path/to/foo.iso
    # Burn from disk to disk
    cdrecord -v dev=0,0,0 speed=5 -isosize /dev/cdrom
    # Generate an ISO from a directory.
    mkisofs -J -r -o foo.iso /path/to/directory
    mkisofs -v -r -T -J -U -V "Label" -o foo.iso /path/to/directory
    # Generate an ISO from a CD
    dd if=/dev/cdrom of=foo.iso
    Linux MP3 CD Burning mini-HOWTO
    # Convert mp3 to wav
    for i in *.mp3; do mpg123 -w `basename $i .mp3`.wav $i; done
    # Convert mp3 to wav with lame
    for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done
    # Burn a CD from wav files
    cdrecord -v -audio -pad speed=5 dev=0,0,0 /path/to/*.wav
     
  3. healtheworld

    healtheworld Guest Thread Starter

    DOES LINUX SUPPORT NTFS?????

    All modern Linux kernels (all 2.4.x and many 2.2.x) DO support NTFS in read-only mode.

    Long Answer:
    Although you can read NTFS partitions created with any version of Windows NT, you can not WRITE to an NTFS partition created with Windows 2000, XP, or anything yet to come. NTFS partitions created with Windows NT 4.0 and earlier CAN be written to, but this tends to make a mess of the filesystem, so make sure to do a chkdsk when you boot into NT after writing from Linux.

    Below are in-depth instructions on how to gain access to your NTFS partition form Linux.

    To access your NTFS partition:
    1. Open a shell if you haven't already.
    2. Become root. Do this by running su and entering your root password when prompted.
    3. Create a mount point for the NTFS partition. mkdir /mnt/ntfs
    4. Mount your NTFS partition. mount -t ntfs -o umask=000 /dev/device /mnt/ntfs
    Replace device with the name of your NTFS partition. See below for advice on how to find this if you don't know.
    5. The contents of the NTFS partition is now part of your tree. When you want to access a file on it, just think of /mnt/ntfs as C:\ and you're all set.
    6. When you are done, repeat steps 1 and 2 (if you exited the shell) and run umount /mnt/ntfs

    If you want all that to be done automatically when you boot Linux (doesn't take effect until you reboot of course):

    1. Open a shell and become root as described before.
    2. Open your fstab file. kedit /etc/fstab
    Note that this assumes you have KEdit (part of the kdeapps package) installed. If you don't, replace kedit with vim, xemacs, gnotepad, or whatever text editor you like.
    3. Add this line somewhere in the file:
    /dev/device /mnt/ntfs ntfs umask=000 0 0
    4. Save and exit.
     
  4. healtheworld

    healtheworld Guest Thread Starter

    CONFIGURE TV OUT(NVIDIA)
    *****************
    1. Hook your TV up to your card somehow. I do it by attaching the SVideo-to-RCA adapter to the card, and putting an RCA cable between the adapter and my VCR.
    2. Open up your /etc/X11/XF86Config file in whatever text editor you like. You will need root priviledges to save the file, so make sure you launch the editor from a root shell, or use some other method to suid root the editor.
    3. Add this entry below your monitor section in the file:

    --------------------------------------------------------------------------------
    Section "Monitor"
    Identifier "TV1"
    HorizSync 30-50
    VertRefresh 60
    Option "TVStandard" "tv type"
    Option "TVOutFormat" "COMPOSITE"
    EndSection
    --------------------------------------------------------------------------------

    Replace tv type with the type of TV you're hooking it up to. If it's a TV from North America (US and Canada) you'd put NTSC-M here. I think TV's from most European countries are PAL-I. There's a big list of countries and their TV standards in the readme file. This can be found at /usr/share/doc/NVIDIA_GLX-1.0/README

    4. Add this line at the end of your Device section.
    Option "ConnectedMonitor" "TV"

    5. Save the file.
    6. Restart X, and the display will come up on your TV instead of your monitor.
    7. Watch some DivX movies, or fire up a console emulator, or do any number of things that you'd rather do with a TV than with a monitor.
    8. When you are ready to go back to your monitor, open up the /etc/X11/XF86Config file
     
  5. healtheworld

    healtheworld Guest Thread Starter

    USING LINUX AS A ROUTER (WITHOUT DEDICATED FIREWALLS)
    ******************************************
    echo 1 > /proc/sys/net/ipv4/ip_forward
    iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
    iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
    echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all

    Then just set up your other systems just like you would if you were using ICS on a windows box
     
  6. healtheworld

    healtheworld Guest Thread Starter

    ONE COOL TIP THAT I HAVE FOUND
    ***************************


    Here's a trick (needs broadband)

    1. First, ensure you have xmms installed with the mpeg layer 1,2,3 plugin.

    2. Go to www.shoutcast.com (or any other streaming audio site) and get some streaming audio going (just click "tune in" and then open with xmms)

    3. In XMMS: options - preferences - audio I/O - mpeg layer 1,2,3 player - configure - streaming

    4. Enable "save stream to disk" and pick the path of a nice fat directory to save to MP3 stream to.

    5. Now, press play again on xmms and it will start recording the stream.

    6. The fun part... at the CLI, type the following:

    at now + 500 minutes

    and press enter. You should get another "command prompt" for at, and type:

    killall -9 xmms

    and press enter. Now do a

    ctrl-d

    To tell "at" that you are finished.

    Then go to sleep. When you wake up, you will have a 500 minute MP3 that you can burn to a CD.

    I also used the "at" command, left a blank CD-R in the drive, and had the disk burned for when I woke up!
     
  7. healtheworld

    healtheworld Guest Thread Starter

    How to find out things in Linux with bash commands
    Don't forget that re-direction and piping add to the power in bash, so some of these tips use them.

    # Basic piping
    some_command | another_command
    See Linux and the tools philosophy
    # Basic re-direction:
    command > textfile_name
    See this Text Manipulation Article
    # Basic concantenation:
    If you don't want to overwrite a file but add to the bottom of an existing file, concantenate it:
    command >> exisiting_text_file

    The bash commands:
    # Find CPU specifications
    cat /proc/cpuinfo

    # What pci cards are installed and what irq/port is used
    cat /proc/pci

    # Memory information
    free

    # How is the hard drive partitioned
    fdisk /dev/hdXX -l

    # How much free drive space
    df -h

    # Show disk usage by current directory and all subdirectories
    du | less

    # Find running kernel version
    uname -r

    # Find X server version
    X -showconfig

    # What is the distribution
    cat /etc/.product
    cat /etc/.issue
    cat /etc/issue
    cat /etc/issue.net
    sysinfo

    # For finding or locating files
    find
    locate
    which
    whereis

    # Use dmesg to view the kernel ring buffer (error messages)
    dmesg | less

    # Watch error messages as they happen (sysklog needed)
    as root, tail -f /var/log/messages (shows last 10 lines, use a number in front of f for more lines)

    # What processes are running
    ps -A

    # Find a process by name
    ps -ef | grep -i
    For example, XCDroast
    ps -ef | grep -i xcdroast /* Case Insensitive */

    # See current environment list, or pipe to file
    env | more
    env > environmentvariablelist.txt

    # Show current userid and assigned groups
    id

    # See all command aliases for the current user
    alias

    # See rpms installed on current system
    rpmquery --all | more
    rpmquery --all > .txt
    rpmquery --all | grep -i
     
  8. healtheworld

    healtheworld Guest Thread Starter

    COMBINING LINX AND WINDOWS
    **********************

    To access shared folders in Linux:
    1. Open a shell.
    2. Become root. su and enter your root password when asked for it.
    3. Create a mount point for the shared folder. mkdir /mnt/share
    4. Mount the shared folder. mount -t smbfs -o username=username,password=password //compname/sharename /mnt/share

    Replace username with your username on the other box and password with the associated password. Replace compname with the name of the computer, and sharename with the name of the share.
    If you didn't get any errors, you're all set. The folder is "mapped" to /mnt/share.

    If you DID get an error, this part might help:

    If the error said "can't open /etc/smb.conf: no such file" or something like that, ignore it. You don't need a config file just to mount shares.

    If the error said "wrong fs type or bad superblock on //compname/sharename", it means samba isn't installed. Install it and try again.

    If it said "unknown filesystem smbfs" or "kernel doesn't support smbfs" or something like that, it means you don't have smbfs support in your kernel. Run modprobe smbfs and try again. If it still doesn't work, you will have to build a new kernel with SMB support enabled.

    If it says "couldn't connect to compname", open your /etc/hosts file and add an entry for the computer you're trying to connect to.


    I think I've covered everything that could possibly go wrong with mounting, so let's move on to sharing.

    To share directories on Linux:
    1. Open a shell and become root, as described before.
    2. Open your /etc/smb.conf file. kedit /etc/smb.conf (replace kedit with your favorite editor if you want)
    3. Alter it like so:
    1. Change the WORKGROUP setting to the name of the workgroup you want to be in.
    2. The HOSTS ALLOW line should contain the list of IP ranges that are on your home network. For example, if your computers were all 192.168.0.* your line would look like this:
    hosts allow = 192.168.0. 127.
    3. Set ENCRYPT PASSWORDS to "yes"
    4. Set SMB PASSWORD FILE to "/etc/smbpasswd"
    5. On the INTERFACES line, list all of your computer's IP addresses, except the internet address if it has one. For example, if you computer had a loopback IP 127.0.0.1, an internal IP 192.168.0.1, and an internet IP 25.246.105.108, your line would be:
    interfaces = 192.168.0.1 127.0.0.1
    6. Save it and exit the editor.
    4. Add an account for your Windows box. smbpasswd -a user password
    Replace user with the username you want. and password with a password. The username should be a valid user on the Linux box.
    5. Open up /etc/smb.conf again.
    1. Scroll down to the Share Definitions part.
    2. The first chunk would be the homes section. Edit it as neccissary to make it match this:
    [homes]
    comment = Home Directories
    browseable = no
    writable = yes
    3. Now add any other shares you want like this:
    [sharename]
    comment = Comment
    path = /path/to/share
    read only = no
    public = yes
    4. Save and exit.
    6. Now start the samba server. nmbd -D and then smbd -D
     
  9. healtheworld

    healtheworld Guest Thread Starter

    RPM UNLEASHED
    **************
    rpm -qa : list every rpm installed on your system

    rpm -ql package-name : list the installed files associated with rpm package-name (it should be noted the version # of the package-name can be omitted. Ex: openssh-2.3.1 can be abbreviated openssh). To list the files in an uninstalled rpm use the same command only add the -p option: rpm -qpl package-name

    rpm -qa | grep regexp : check to see if rpm conatining regexp in its name is installed on your system.

    rpm -i package-name : install rpm package-name (must be root). Also by adding the --test option you can check for depency problems before actually installing.

    rpm -U package-name : same as above only Upgrade instead of just install.

    rpm -qi package-name : list info about package-name. This gives you a general idea of what the package does, what system it's intended for and who put it together. You can also query info from uninstalled packages with with the -p option: rpm -qpi package-name

    rpm -qf filename : VERY IMPORTANT. Query file filename to see what RPM package it belongs to. This will keep you from deleting a file you think is useless.

    One last trick. Many people complain about RPM dependency problems. The easiest way to solve these are by using www.rpmfind.net. You can query by a filename or an RPM name. Also if you know you have all the RPMs required to do an install but don't know which ones to install first you can specify them all on the command line with a glob character '*.rpm' and let the rpm command sort out the dependencies itself.



    Report this post to a moderator | IP: Logged

    10-16-2003 04:11 PM
     
  10. healtheworld

    healtheworld Guest Thread Starter

    hey dudes..
    Do respond
     
  11. healtheworld

    healtheworld Guest Thread Starter

    Waiting...
     
  12. healtheworld

    healtheworld Guest Thread Starter

    Unleash ur secrets..
     
  13. healtheworld

    healtheworld Guest Thread Starter

  14. healtheworld

    healtheworld Guest Thread Starter

  15. healtheworld

    healtheworld Guest Thread Starter

    To get those darn windows/dos text files to parse properly, get rid of the carriage return at the end of every line....

    code:--------------------------------------------------------------------------------sed -e 's/.$//g' foo.txt -i--------------------------------------------------------------------------------
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/172611

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice