-------------------------------------
ApacheDir
-------------------------------------
To create a new directory in Apache go /etc/apache and change srm.conf or
access.conf
You can also just create a symbolic link to a directory from the /var/www
directory. Then you can access the symbolic link from the web. For instance
create a link to /charlie1/wwwroot/links in /var/www/links.
-------------------------------------
BashProfileBashRC
-------------------------------------
The .bash_profile file controls the environment settings, but it uses
file called .bashrc to set the path.
-------------------------------------
BatteryTime
-------------------------------------
Find out how much time is left on the battery when you are not plugged in:
issue the command: apm
-------------------------------------
bootfloppy on Redhat
-------------------------------------
Creating a boot floopy
mkbootdisk --device /dev/fd0 2.23333
where 2.23333 is the kernal version found in /lib/modules
Sometimes disaster strikes. For instance, if you are dual booting, and
happen to reinstall Windows, then Bill will wipe out your Grub or Lilo
multiboot options. (Nice guy, right?) There is no need to worry, at least
if you are using RedHat. Stick the first disk of the red hat CD ROM series
in your CD and reboot. If your system is set up to boot from CDROM, then it
will do so. Follow the instructions to get into rescue mode, or type linux
rescue. This will boot you up into command line mode for linux. To set up
the correct root, type chroot /mnt/sysimage. Now you can follow the
directions above to create a boot floppy.
-------------------------------------
byte compile on el file in emacs
-------------------------------------
byte compile an el file from lisp in emacs
m-x byte-compile-file
Or choose it from the menu
-------------------------------------
CopyDateCheck
-------------------------------------
Copy with checking for date:
cp -rpuvf
-------------------------------------
CronStuff
-------------------------------------
Keep a crontab file called crontab in your home directory.
Here is a sample line for running the script foo every minute:
* * * * * /root/bin/foo
Here is a sample line for running the script foo every hour on the hour
0 * * * * /root/bin/foo
Run it between 9 and 5 pm:
0 9-17 * * * /root/bin/foo
Run it at 10 after 20 after 40 after:
10,20,40 * * * * /root/bin/foo
Run it first day of month and every sunday at 2 am:
0 2 1 * 0 /root/bin/foo
Run it on Jan 1 at 2 am:
0 2 1 1 * /root/bin/foo
So its the
minute, hour, day of month, month, day of week, program name
-------------------------------------
DebianPackages
-------------------------------------
/usr/src/linux
make xconfig
dpkg -i MyFile.deb
-------------------------------------
debug a perl program in ddd
-------------------------------------
debug a perl program in ddd
ddd --perl program
-------------------------------------
delphi debug with ddd
-------------------------------------
compile Delphi with dcc -b -v filename.dpr
then
xxgdb filename
-------------------------------------------
DelphiInstall
-------------------------------------
gnu:/exports/latest
--------------------------------------------------
DelphiLibs
-------------------------------------
> You need to have qtintf.so in your LD_PATH. I created a symbolic
> link from /usr/lib to "the kylix install"/lib/qtintf.so.2.2.0. On
> my system "ln -s /kylix/qt/qtintf.so.2.0.2 /usr/lib/qtintf.so"
> You need to specify the unit directory. On my install "dcc
> -U/kylix/lib "
--------------------------------------
DelphiSoFiles
-------------------------------------
Building so files
dcc -y -m -z -p System.pas
Copy the result dpu file to lib directory.
Create a library file.
library simple;
function GetNine: Integer;
begin
result := 9;
end;
exports
GetNine;
begin
end.
Build the so file the same way you build System.pas. Copy the file to some
place on your LDPATH, such as /usr/lib.
Then create the file to use it:
program test;
function GetNine: Integer; external 'simple.so' name 'GetNine';
begin
WriteLn(GetNine);
end.
-------------------------------------
DiskFree
-------------------------------------
df gives you are reading of the space left on your drives. df -h makes
it human readable
du gives you all the directories benearth the current one.
-------------------------------------
How much space does this directory take up?
-------------------------------------
du is the command to get a list of the current directory and all
directories under it
Here is the command for the record of all the files in the home
directory. This command sends all errors to dev null, and only
reports the total, not the suptotal for each directory:
du --summarize --one-file-sytem /home 2>/dev/null
Here is the result of running du in my /home/ccalvert/.gimp
directory:
4 ./brushes
4 ./gradients
168 ./palettes
4 ./patterns
4 ./plug-ins
4 ./gfig
4 ./tmp
4 ./scripts
4 ./gflares
408 .
Here is the result of running the summarize command in the
same directory:
du --summarize /home/ccalvert.gimp 2>/dev/null
408 /home/ccalvert/.gimp
Note that if you put the -one-file-system flag in you would get no result
at all on the .gimp directory.
-------------------------------------
DNSLookup
-------------------------------------
To see what the DNS server things is the name of a particular IP address
NSLOOKUP 10.143.13.126
to pump in a domain name: ./pump -i eth0 -h theshire
To restart the network, go into init.d and type network restart
pump
-------------------------------------
Find DNS Servers
-------------------------------------
What are the DNS servers for a particular machine?
Look in /etc/resolv.conf
-------------------------------------
FTP Server
-------------------------------------
Setting up the FTP Server on RedHat 7.2
Use the PackageManager (kpackage) to make sure both anonftp and wu-ftpd are installed
rpm -Uvh wu-ftpd* anonftp*
Now go to your /etc/xinitd directory and open up wu-ftp and make sure that
disable is set to no. By default, it is set to yes.
-------------------------------------
EmacsFont
-------------------------------------
add this to your bashrc to start emacs with a bigger font:
alias emacs='emacs -font -adobe-courier-medium-r-normal--14-100-100-100-m-90-iso8859-1'
-------------------------------------
FileOwner
-------------------------------------
Give ccalvert permissions to own a file:
chmod -o=rw FileName.txt
-------------------------------------
File Permissions
-------------------------------------
This command gives the group the same rights as the owner:
chmod g=u
u User Owner of the file
g Group Group to which the owner belongs
o Other All other users
a All Same as ugo
This command gives the owner rights:
chmod u+r
This command gives the group rights:
chmod g+r
This comand gives others rights:
chmod o+r
-------------------------------------
find a directory
-------------------------------------
To find dirname type:
find . -type d -iname dirname
-------------------------------------
grep
-------------------------------------
You want grep to search through multiple directories. Use backticks to run find in place:
grep "Find this string" `find . -iname "*"`
This will find the string "Find this string" if it appears in any file ("*") in the current
directory or one of the current directory's subdirectories.
-------------------------------------
You don't have permission to access / on this server
-------------------------------------
You try to browse to your server on your machine and get an error about permisisons. The
problem might be that linuxconf has screwed up your httpd.conf file. Look for <files ~> and
replace with:
<Files ~ "^\.ht">
-------------------------------------
library browsing
-------------------------------------
run nm on it to see the symbols in a library
nm libc.
-------------------------------------
MountCD
-------------------------------------
Mount the CDROM drive
mount /mnt/cdrom
-------------------------------------
MountDosFloppy
-------------------------------------
command line for mounting a flopping on red hat
mount -t vfat /dev/fd0 /mnt/floppy
-------------------------------------
NetWorkPing
-------------------------------------
Getting the network to ping other machines in your LAN:
etc/sysconfig/network-scripts/ifcfg-eth0
BOOT_PROTO="dhcp"
DHCP_HOSTNAME="Merlin"
PUMP="yes"
dns,hosts
-------------------------------------
NetworkStuff
-------------------------------------
Network stuff:
ifconfig
netcfg
route
cardctl ident
cardctl status
Check /var/log/messages for reports on errors
Here are some important files
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifup
/etc/sysconfig/network // Not as sure about this one
/etc/rc.d/int.d/network restart
-------------------------------------
NFS Stuff
-------------------------------------
Here is the command ot start nfs:
/etc/rc.d/init.d/nfs start
You can also stop it, or check its status
Here is how to mount a drive on remote machine:
mount 192.168.1.1:/home/ccalvert /mnt/foo
You can specify what to export from your machine in the file:
/etc/exports
For instance:
/home
here is how to export your home directory as read only from
/etc/exports:
/home (ro)
Here is how to export as read write from /etc/exports.
/home/ccalvert (rw)
To make the above statement work properly, you may need to be signed
on as ccalvert on the client machine.
Here is a line you can add to your fstab file to make it so you an
mount more easily:
192.168.1.30:/home/ccalvert /mnt/foo nfs noauto,user,rw 0 0
After adding this line, you can mount with this command:
mount /mnt/foo
To see what's going on on another machine:
rpcinfo -p 192.168.1.1
-------------------------------------
NovelLogin
-------------------------------------
LOGIN TO NOVEL SERVER
modprobe ncpfs
ipx_interface add -p eth0 802.3
ncpmount -s SV5 -U ccalvert.Mkt.HQ.Inprise /mnt/foo
ncpmount -S SV5 -U ccalvert.mkt.hq.inprise /mnt/foobar
-------------------------------------
PingYourself
-------------------------------------
Clean up the problem with ping yourself
in this file
/etc/sysconfig/network
DHCP_HOSTNAME=theshire
/etc/hosts
delete the reference to theshire or whatever host name you have
-------------------------------------
Remote Login Stuff
-------------------------------------
rlogin -l ccalvert hostname
-------------------------------------
RestartApache
-------------------------------------
Restart Apache
etc/rc.d/init.d/httpd restart
-------------------------------------
rpm and the F for Freshen option
-------------------------------------
Freshening is different than updating in that you will only Freshen packages that
are already installed, while update will update or install an uninstalled package.
I have found that freshen works well when you get in to conflicts between different
versions of packages that are already installed. Freshen just seems to get around
that issue.
RedHat Notes on RPM
-------------------------------------
rpm-glibc
-------------------------------------
rpm -Fvh glibc*.rpm
RedHat Notes on RPM
------------------------------------
Working with Samba
-------------------------------------
SAMBA:
run this, or the result of cat /car/run/inetd.pid, which is a na a number:
kill -HUP `cat /var/run/inetd.pid`
Go to /etc/rc.d/init.d and run:
./smb start
You should then run:
./smb status
to be sure it is running (two files)
To check smb.conf run testparm
Set security to either user or share
To create a public share called myshare:
[myshare]
path = /home/ccalvert
public = yes
only guest = yes
writable = yes
printable = no
You probably want to set the security level to share, unless you have
domain controller.
Set the directory and the files in it to the group users
-------------------------------------------
SambaInfo
-------------------------------------
Samba info
go to /etc/samba/smb.conf
and set the following:
encrypt passwords = yes
smb passwd file=/etc/samba/smbpasswd
also, you probably have to manually start nmbd
-------------------------------------
SeeProcesses
-------------------------------------
See all the current processes:
ps aux
ps aux | grep smb
-------------------------------------
SmbMount
-------------------------------------
smbmount //eastfarthing/cdrive -c "mount /Charlie" user%password
One corel:
mkdir a directory in mnt.
smbmount //eastfarthing/cdrive /mnt/foo -U ccalvert
-------------------------------------
SwitchDesk
-------------------------------------
/opt/kde/bin/usekde ccalvert
Use this command to switch the desktop:
switchdesk
-------------------------------------
SymLink
-------------------------------------
To createa symbolic link between two directories you can do the following:
ln /charlie1/docs /home/ccalvert/docs
After you give this command, there will be a "file" in the home/ccalvert
directory called docs that acts just like the directory /charlie1/docs.
If you are in /home/ccalvert and issue the command cd docs, then you
end up in the /charlie1/docs directory.
-------------------------------------
TarFiles
-------------------------------------
Create a tar file:
tar -cvf FileName.tar FileName.txt
Create a tar zip (tgz) file
tar -cvfz FileName.tar FileName.txt
Zip up a tar file:
gzip FileName.tar
Unzip a tar file:
gzip -d FileName.tar.gz
Untar a file and create directories:
tar -xvf FileName.tar
Untar and unzip and create directories:
tar -xvfz FileName.tar
-------------------------------------
Wine
-------------------------------------
Use rpm packages to install wine, then get the winesetuptk from:
-------------------------------------
WriteFilePermission
-------------------------------------
Change writes on file so all (other) can write to it:
chmod o+w MyFile.txt
-------------------------------------
XLibConnection
-------------------------------------
Get XLib: connection refusted by server
XLib: client is not authorized to connect to server
Do this, when logged in as you:
xhost +strider.inprise.com
-------------------------------------
X Windows and root
-------------------------------------
can't use X from root
just copy your .Xauthority file from ccalvert to the root directory
The issue is that you started X as ccalvert, so root has no permissions
By copying the file over .Xauthority, you get permissions. You could
also use xauth to set up .Xauthority, but that is a bit tricky.
------------------------------------
Mounting Zip Disks
------------------------------------
Most distributions, including Red Hat, set everything up for you ahead of
time. All you need to do is the following:
modprope ppa
You might also be able to use insmod ppa, but that might not work, and the
above command is more reliable, as it sets up everything that ppa needs.
Put a disk in the drive. I think you have to have the disk in there or
this won't work.
Assuming the directory /mnt/zip already exists, then
enter:
mount -t vfat /dev/sda4 /mnt/zip
If this doesn't work, then you need to rebuild the kernal. This isn't as
bad as it seems. The zip drive mini HOWTO will talk you through it.
To make life easier, add this line to fstab:
/dev/sda4 /mnt/zip vfat noauto,owner 0 0
Now you can mount with:
mount /mnt/zip