Linux Notes from Keith

From DreamsteepWiki

Jump to: navigation, search

(One Year's Worth of) Linux Notes From Keith


Notes from Keith


Contents

General Linux Commands (Not Executable Code)

su - switch user
df - disk usage
top - list or running proceses and process id (PID)
kill 0 (PID),kill -2(PID) kill a process
umount - unmount a device
free - list free memory
tee - write a file from a pipe
usermod
umask
chgrp
chown
chmod
du 

Permissions (Not Code)

Octal 

0 | ---
1 | --x
2 | -w-
3 | -wx
4 | r--
5 | r-x
6 | rw-
7 | rwx

4- read
2-write
1-exe

------------------------
|  876  | 543  | 210   |
|  rwx  | rwx  | rwx   |
| user  |group | other |
------------------------
 
1-d    (dir)
2,3,4  (owner)
5,6,7  (group)
8,9,10 (user) 
S-set user ID /set group ID either inherit user's permissions or the directory's permissions


Umask

type umask to see your octal umask value

inherited from login may be found in .cshrc .login (/user)

I Set This In:

/etc/bashrc >> add a line or modify >>

umask 022 

(or whatever )


Install Nvidia On Fedora

GETTING MAYA TO RUN ON FC7

things to try: copy libGLU.so from install DVD

Nvidia Quadro FX Family To set hardware overlay planes on NVIDIA quadro cards you will need to enable "CIOverlay" in the XF86Config file. ex.


Section "Device"
  Option "CIOverlay" "on" 


run nvidia-settings first (seems to fix some gl bug)


other things to try :

play with libXP.so libraries and links (bad idea but seems to work)



Run the following three commands in yum, pray it works without error (about 95% chance it will):


Install Needed Libraries

 yum install kernel-devel xorg-x11-server-sdk pkgconfig
 yum update
 reboot


download appropriate .run package from nvidia

kill xserver

init 3

login and run your .run file

restart xserver or reboot

init 5

You should see an Nvida logo if it worked.


Alternate Method

setup livna repository config

run the following to install the livna (seems to work when nvidia wont but the quality is often poor, I had rendering problems with these drivers)

init 3 
yum install kmod-nvidia 
nvidia-config-display enable
init 5

Test If You Have OpenGL Working

glxinfo , glxgears

Get The Current Running Kernel Version

uname -r


Identify if your os is 64 bit

uname -a

Adjust Monitor Settings

sytem-config-display


xorg (xserver) log path for debugging

var/log/xorg log


(Notes are hard to read, I don't remember this )


Setting Up/Notes On Grub

To Boot Into Winodows XP From Command Line

rootnoverify (hd0,0) (USUALLY DRIVE 1,partition 1)  
makeactive
chainloader +1
boot



FSTAB _FILE SYSTEM TABLE

a file that will auto mounf drives and devices for you upon bootup

dont change ANYTHING , just copy the last line and change it , it should look like this


device |mountpoint |type of mount |options |options



/dev/sdc2    /mnt/sdc2         auto                 defaults    0 0  

this is of course an example using drive sdc2 , etc additoinal lines can be added for each partition, device


Hard Drives

To See Available Space

df
df -h 

To See All Devices

fdisk -l 

Sometimes a user may need more permisions to run, on some systems fdisk can only be:

/sbin/fdisk -l 

To Format A Drive

sfdisk /dev/sdb (drive) -uM (units Megabyte for readability) << EOF (pause and add aditional lines

sfdisk /dev/sdb -uM <<EOF
100,000
;
;
EOF 


After Partitioning, You Have To Format (It Is Very Fast <2 Min.)

mkfs.ext3 device 

(or ext2 for older systems)


Networking

set hostname though system settings GUI panel in GNOME

hostname 

is your name and domain it will be localhost.localdomain by default

Network Setup

etc/hosts

This is a table of name to IP address links (this needs to be setup to run my render farm, so each machine is identified).

Network Admin Stuff

Setting Up Encryption With SSH

RSA/DSA Key Encryption

set up etc/hosts file for server machine

ssh-keygen

(enter for default path /home/user/.ssh/id.rsa OR /root/.ssh/id.rsa)

copy id_rsa to host machine , same path (/home/user/ ) but name it known_hosts instead append it to the file if it exists already to add a new public key


SCP (moving folders and files)

ssh 192.168.0.9

ssh filename user@192.168.0.9

SCP

scp keith@192.168.0.9:/pathtosave

For folders use the recursive flag

scp -r keith@192.168.0.9:/pathtosave

Running a Debugger (for Maya command )

maya -d gdb


Delete A Partition

run command, a series of options will follow


fdisk /dev/sdb 

p...(partition)

d... (delete)

#... number

w...finish 

reboot


Manual Grub Instalation

(These Notes Are Shady At Best. I Still Don't Know How To Do This, but I Have Gotten it to Work)

  1. Insert FC install disk
  1. Type linux rescue

To get into system type:

chroot /mnt/sysimage
chroot /mnt/sysimage
grub
root(hd0,0)
ext2fs,partition type 0x83

more GRUB notes

linux rescue 
chroot /mnt/sysimage 

grub_install /dev/hda 
(or /sda)
 


Finding The Fedora Trashcan Files

/home/user/.Trash (the dot means it is hidden,like .SSH folder)

For removeable media it is in

/media/disk/.Trash-Keith (username)

Setting Environment Variables

There is a folder:

/etc/profile.d/

All shell scripts in this folder are sourced at login.

Simply add a shell that uses the export command to get an environment variable

export myvar=3.1459
export myothervar=kilroywashere

Will create 2 variables.

It is usually better to put multiple files with less variables for organization.


TO ADD TO YOUR PATH VARIABLE

PATH=$PATH\:/dir/path ; export PATH

Cron Jobs

Use the crontab command.

Each user gets a crontab, I use root as the user for system cronjobs.

crontab -e 

This will launch vi , the text editor.

VI

two modes , insert , edit

Cycle through them with the Insert key.

hit escape to exit 2 modes

Hit Shift z (twice?) to exit.

YUM

yum notes


disk_usage

 
du --max-depth=1


du -k --max-depth=1 /home | sort -nr

rename a file

mv file file2


RPM

rpm -Uvh filetoinstall.rpm


extract a tarball

tar -xf file.tar.gz

Personal tools