apache
access log � /var/log/httpd/access_log
error log � /var/log/httpd/error_log
home directory � /var/www/html
restart � see also process, restart
"old" way
ps aux | grep httpd
kill term �TERM 1234
httpd restart
"new" way
System/Service Configuration - a lot easier and more foolproof!
Appletalk � see netatalk
also afpd, sfpd -v to get version
ps -aux | grep afpd
ps -aux | grep papd
to see if Appletalk�s running. "afpd" stands for something like "appletalk file protocol daemon"
apt-get � Debian package installer - apt-get install package name. The location where apt-get looks for updates is: /etc/apt/sources.list
backup � tar -cvF /dev/qft0 /
Exclude /proc and /dev from your backup
bind - see DNS
bpi to ftpi � 4 bpi (bits per inch) = 5 ftpi (flux transactions per inch)
browse the network in windows � see samba, allow windows machines to browse the network
carriage return - see UNIX to Windows, convert
cdrecord: No such file or directory. Cannot open SCSI driver.
add an entry to the linux section of /etc/lilo.conf:
append="hdd=ide-scsi"
Also, I am guessing you have another CDROM on hdc? If so, many people have reported that if they have two drives on the same IDE interface cable, they have a hard time getting ide-scsi working unless they use it for both drives. So you also might want to include in /etc/lilo.conf:
append="hdc=ide-scsi"
Then execute /sbin/lilo and reboot.
CD-ROM, mount: mount /mnt/cdrom , unmount: umount /mnt/cdrom
changing permissions of 'file_name': Operation not permitted - see chmod command results in "changing permissions of 'file_name': Operation not permitted"
chmod 777 *.* to set permissions to allow everything, chmod 755 also
chmod command results in "changing permissions of 'file_name': Operation not permitted"
lsattr file_name - if you get anything besides a bunch of dashes, like --ia-----, it means immutable or the like
chattr -i -a file_name to get rid of these
chmod o-w - remove write permissions for "others" - other choices are "u" for "user", "g" for "group"; "r" for "read", "x" for "execute"
� chown person.person <file_name>
command, find � whereis command
command won�t run even when you�re in the right directory � precede command with �./�
conf.modules in the /etc/ directory � it�s now /etc/modules.conf
convert UNIX carriage returns to Windows - see UNIX to Windows, convert
copy files from one machine to another - scp
copy files from Windows to remote Linux box � WinSCP
cpu info - /cat /proc/cpuinfo
debian>
decrypt using gpg � see gpg, encrypt
delete files older than �
find . -maxdepth 1 -mindepth 1 -mtime +7 -exec rm {} \;
you need the �;� at the end. Replace �7� with however many days old you want; the example above will delete everything older than 7 days
the maxdepth and mindepth prevent the program from going deeper than the current directoy
you can replace �.� with whatever directory you want. �.� means the current directory.
Variants:
rm `find /some/directory -maxdepth 1 -mindepth 1 -mtime +7 -print`
or, if there are too many files to handle that way,
find /some/directory -maxdepth 1 -mindepth 1 -mtime +7 -print | xargs -n 1 rm
delete files recursively � see recursively delete files
devices, list � ls -l /dev/*ft0*
dhcpd
stop � ps -aux | grep dhcpd
start - dhcpd
dir � ls>
directory, create � mkdir or mkdir � adirectory/anotherdirectory/yetanother. If portions of the path already exist, those portions are preserved and missing portions are added to the path
directory, pointing to another directory � symbolic link (man ln)
disk error messages � dmesg | tail
disk, how 2nd internal disk is partitioned � cfdisk /dev/hdb
disk space utilization � see also partition, how 2nd internal disk is partitioned
- df -h � no interaction, display only
- cfdisk � an interactive way to control partions
distribution list for email - /etc/aliases
DNS �
First, set bind
Edit /etc/bind/10.zone
And edit /etc/bind/local.zone
Then run /etc/init.d/bind9 restart
Then dhcp
Edit /etc/dhcpd.conf
Then run /etc/init.d/dhcp restart
documentation -- /usr/share/doc
elementary distro - things to do after installing elementary OS - luna
problem with HDA Intel - stac92xx analog - solution
email distribution list - /etc/aliases
emacs
exit emacs � C-x, C-c
encrypt using gpg � see gpg, encrypt
environment variable, set � export ANT_HOME=/usr/local/ant to set the ANT_HOME environment variable, for instance
/etc/conf.modules � it�s now /etc/modules.conf
Failed opening './config.inc.php' for inclusion - chmod 755 config.inc.php
fetchmail � /usr/share/doc/fetchmail
files, copy from one machine to another - scp
files, copy from Windows to remote Linux box � WinSCP
files, find - find . <path> -name "name_including_wild_cards". The dot makes the search go down into subdirectories. If you then want to delete all these guys, recursively delete files
files that are open, find - lsof (LiSt Open Files)
find files � see files, find
firewall problems preventing access to port 80 � see ipchains, iptables, firewall-config
firewall rules � /etc/sysconfig/ipchains
format hard drive � see partition disk
freetrade install
move the whole directory to under /var/www/html
create an empty �freetrade� database under MySQL
add the line �use freetrade;� at the beginning of the /install/mysql/build.sql script
start Netscape, http://localhost/…
freeware, Windows equivalents / replacements / analogs in Linux
fsck � you must run fsck -A -y /dev/hda2, not just fsck all by itself!!
ftmt -f /dev/qft0 status
ftp, can't log on when user is member or root - edit /etc/ftpaccess and comment out
deny-uid %-99 %65534-
deny-gid %-99 %65534-
putting the in following at the end of the file is not enough
pasv-allow all *
port-allow all *
ftp configuration - KWuFTPd
ftp, prevent people from seeing files - clear the 'read' permission bit for 'other' (not the directory's owner or group)
ftp, Restrict user�s FTP directory
Restrict his directory
groupadd ftponly
Add the line "guestgroup ftponly" to /etc/ftpaccess file
usermod -G ftponly bob
Add /./ to the end of the home directory in /etc/passwd so that "/home/bob" becomes /home/bob/./
Add far-flung directories
make empty directory /home/bob/catalog
mount --bind /var/lib/interchange/bob /home/bob/catalog
Add the line above to /etc/rc.d/rc.local
ftp, secure alternative to copy from Windows to Linux using SCP � WinSCP
ftpi to bpi � 5 ftpi (flux transactions per inch) = 4 bpi (bits per inch)
gpg commands
gpg --gen-key � create a new primary keypair
gpg --list-keys
gpg, encrypt � gpg -ca filename � filename renamed to filename.asc; rm filename once you�ve converted. To decrypt: gpg filename.asc
gpg, location of key rings � /root/.gnupg/pubring.gpg
gpg, get to work with interchange � copy /root/.gnupg/pubring.gpg to /var/lib/interchange/.gnupg/
gpg path � /usr/bin<
graphics manipulation from the command line
grep -R string . (the �.� means this directory)
groups, managing
/etc/group
gpasswd -a username groupname (�-a� for �add�, �-d� for �delete�)
group, add � groupadd -g groupname
group, add a user to � usermod -G groupname username
GUI, change � �switchdesk� from command line
GUI, get into from command line � startx
GUI, Start with instead of command line�Edit the file /etc/inittab and change the line reading "id:3:initdefault:" by changing the 3 to a 5
home directory for a user - /var/home/user
hosts file - /etc/dhcpd.conf, /etc/bind/artselect/192.168.2.zone:128
then /etc/init.d/dhcp restart to have changes take effect
http docs, location for in BSDI: /usr/local/etc/httpd/htdocs
httpd.conf - /etc/httpd/conf
image manipulation from the command line
If possible, log on as the user who�s going to get the mail to avoid permissions problems
See if there is a �Maildir� directory in the /var/home/user directory. If not, issue command: �maildirmake Maildir�. Make sure the �M� is capitalized! If you�re logged on as root when you do this, make sure you chown to change owner to the user
emacs /var/home/user/.mailfilter and comment out, �to /var/mail/user�
Change their shell from �true� to �bash� in /etc/passwd, if necessary
include_path problems - chmod 755 config.inc.php
inetd.conf file location- RedHat abandoned inetd in favor of xinetd in 7.x
interchange
- Interchange software directory: /usr/lib/interchange
- Catalogs directory: /var/lib/interchange
- cgi-bin directory: /var/www/cgi-bin.
- .cfg files (catalog.cfg, interchange.cfg) � /usr/lib/interchange
interchange developers resource - latest version download
IP addresses, assign permanently
Get MAC address
First, get the MAC address of the device to which you want to assign an IP address. If you don�t know:
If the device you want to map is a PC, then from the command line:
ipconfig /all
to get that machine�s MAC address
If the device is some other device such as a printer whose MAC address is not readily available, then look in:
var/log/syslog
By issuing command
Less syslog
Map MAC address to IP Address
There is a file that maps MAC addresses to static IP addresses:
/etc/dhcpd.conf
To get any changes you make to this file to �take�
/etc/init.d/dhcp restart
And you should get the following messages in close succession
Stopping DHCP server: dhcp.
Starting DHCP server: dhcp.
Don�t just assume this works. Any error message will show up in a log somewhere but you won�t get any immediate feedback that something happened. So:
ps axf | grep dhcp
should yield something like
6526 pts/32 S 0:00 | \_ grep dhcp
4593 ? S 0:00 /usr/sbin/dhcpd-2.2.x -q
ipchains � ipchains -L to list, ipchains -f to flush; see also iptables
iptables -L giving you problems running, saying things like �/lib/modules/2.4.2-2/kernel/net/ipv4/netfilter/iptables.o: init_module: Device or resource busy�
�ipchains �F
�rmmod ip_tables
�modprobe ip_tables
�now, running iptables -L should work OK
java path � /usr/java/jdk1.3.1/bin
jbuilder foundation won�t install � check /tmp disk space!
kernel, install � kernel-2.4.2-2.i586.rpm on disk 1, /RedHat/RPMS directory
KDE, get back to � �switchdesk� from command line
Linux source code � see kernel, install
locate command (such as �linuxconf�) � �locate linuxconf|grep bin� or �which linuxconf�
logs �
apache access_log �/var/log/httpd/access_log
apache error log � /var/log/httpd/error_log
login GUI � xdm after you login (seems dumb to me that you can�t use this AT the login prompt)
login with GUI instead of command line � Edit the file /etc/inittab and change the line reading "id:3:initdefault:" by changing the 3 to a 5
ls, listing just a few entries that match a string � ?
MAC address, assign to fixed IP address � see IP addresses, assign permanently
MAC address, determine - ifconfig
magic_quotes_gpe � /etc/php.ini
mail - /var/spool/mail/root
mail, relay � edit the /etc/mail/virtusertable and add entries such as
@somedomain.com [email protected]
[email protected] orders
@yourdomain.com [email protected]
Then compile this table into /etc/mail/virtusertable.db. From /etc/mail, run the following command:
makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable
memory, how much � free, top
modules, list � lsmod
mouse, configure � go to shell, type �setup�
mouse configuration corrupt � delete or rename /etc/sysconfig/mouse
mount CD-ROM - see CD-ROM, mount
memory, how much � free, top
Myodbc
New driver
Name | MySQL |
Description | ODBC MySQL |
Driver | /usr/local/unixODBC/lib/libmyodbc.so |
Setup | /usr/local/unixODBC/lib/libodbcmyS.so |
Configure
Name | freetrade |
Description | MySQL |
Driver | MySQL (greyed out) |
Trace | No |
Trace file | |
Server | localhost |
Port | 3306 |
Socket | |
Name | freetrade |
create database � mysqladmin -u root [-p] create prova (�prova� is the name of the database you want to create)
run script � mysql <myscript.sql
start session � mysql -u user �p
show variables � �show variables�
shut down � mysqladmin -u root shutdown
If there are problems seeing a shared directory, delete all the .Apple* files, stop and start the netatalk service to re-create them
stop � /etc/init.d/netatalk stop
start � /etc/init.d/netatalk start
restart - /etc/init.d/netatalk restart
You should get something like:
Restarting AppleTalk Daemons (this will take a while)Stopping AppleTalk Daemons: afpd papd timelord atalkd.
..Starting AppleTalk services (this will take a while): socket: Address family not supported by protocol
socket: Address family not supported by protocol
atalkd: can't get interfaces, exiting.
atalkd afpd papd.
done.
Pertinent directories include:
/usr/lib/netatalk, /etc/netatalk
network, browse in windows � see samba, allow windows machines to browse the network
ntsysv � resides in /usr/sbin, tells what services start up
open files, find - lsof (LiSt Open Files)
Operation not permitted, changing permissions of - see chmod command results in "changing permissions of 'file_name': Operation not permitted"
ownership � see chown
partition disk � see also disk space utilization, how 2nd internal disk is partitioned
use cfdisk, which opens up an interactive way to manipulate partitions. Normally, specify which disk: cfdisk /dev/hda for the main disk, cfdisk /dev/hdb for the 2nd disk, etc.
After doing that, you have to create a filesystem on it:
mke2fs -j -m 0 /dev/hdb1
The -j makes it a journalling filesystem (ext3), and the -m 0 tells it not to reserve any blocks on the disk for the root user only. (The reserved blocks are just so root can still do something if a non-root user fills up the disk. The default is 5%, which might have made sense for 50MB disks, but it's preposterous for a 250GB disk. Even 1% is ridiculous, and on a non-system disk like this it's completely unnecessary.) You want to get the device name correct when doing this step :) mke2fs might warn you if you try to overwrite /dev/hda1, but I'm not sure. Pretty sure it won't stop you...
If you get strange messages
dmesg | tail
to look for error messages.
Now to point some "normal" directory, like /var/graphcs2, to this vast new partition
mount -t ext3 /dev/hdb1 /var/graphics2
The "-t ext3" gives the filesystem type, and except for weird cases it's optional because the system will figure the type out for you.
Because you don't want to enter this manually each time the machine boots, you can put the entry in /etc/fstab, which lists each of the things that are to be mounted upon boot. You will see other entries there for swap and whatnot. The syntax is fairly straightforward, but you want to specify the "noatime" option along with "defaults". Normally a Unix filesystem records every time a file is accessed (the access time, or "atime"). This is conceivably useful, but in practice not and just generates a lot of hammering on the disk to save the last-access times. Turning it off can be a big savings on a server, and we never look at the data anyway.
One thing you might do is to put the disk on the other controller, the one with the CDROM. If they're both on the primary controller they have to share the ide cable, while if you put it on the secondary controller they can both be accessed at the same time without slowing each other down. The secondary master is /dev/hdc and the secondary slave is /dev/hdd.
password, change
1. "passwd joe" (or whatever id)
2. cd /etc; emacs shadow (must be root), you�ll see something like
root:$1$im1qDHpo$BjxALJf36z7LB5plPimf0M:12145:0:99999:7:::
daemon:*:10607:0:99999:7:::
bin:*:10607:0:99999:7:::
each field on a line is delimited by �:�. Delete everything in the 2nd field and replace it with �*�. This 2nd method is great if you have to boot from a CD-ROM rescue disk
password, generate - pwgen
path, change temporarily � export PATH=/usr/java/jdk1.3/bin:$PATH
path, change permanently � there is a directory /etc/profile.d. In that directory you will find several scripts for setting path information. Duplicate one of these for a java.sh or whatever, and put in the appropriate scripting information. Make sure you make the script executible by chmoding the file like this: chmod a+x . Now you should be able to login again and it will add the path for you properly. You may want to test that it got added before logging out to make sure the script works by typing: source at a prompt. If the prompt comes back and you can run the program you should be all set.
path does not include the path where the command you are trying to run so it won�t run even though you�re in the same directory where the command is � precede command with �./�
path to a running program, �which <program>� � e.g., �which apache� might return �/usr/sbin/apache�
path variable, see � echo $PATH
permissions � see groups, managing, chmod command problems
POP � userconf
ports � nmapfe from shell
process management � System/Process management. See also ntsysv, tksysv
process, restart � often you can go to /etc/init.d and run one of the batch commands there with -restart or -reload as arguments
ps -aux ( | grep <string> to find processes related to something of interest, say, �smbd�)
ps -axf � displays a �tree�
processes taking up the most resources - top
processes, what processes start up automatically � ntsysv
recursively delete files � if it�s simple
rm <directory> -r
or
rm -R <directory>
Add a �-f� to forcibly suppress such messages as asking if you want to delete a write-protected file
rm -r -f <directory>
But let�s say you want to recursively delete all files named �Icon?� in the given directory and all subdirectories:
first, list what you�re going to delete just in case there are surprises:
find . -name "Icon?" | less
then:
find . -name "Icon?" -print0 | xargs -0 rm -f
xargs limits the number of arguments passed on to the command. If necessary the command is invoked several times until all arguments on stdin have been processed. -print0 causes the printed file names to be delimited by NULs, which is particularly useful if your file names contains spaces, tabs or even newlines. When using -print0 xargs should be invoked with -0 for proper parsing of the input. Not sure whether the �-f� flag is to avoid a fork on xargs (if you don't, rm might fork and xargs may invoke a new rm repeatedly) or to force deletions on the rm command.
If you want to delete all files except of a certain type, a little trickier:
find /root/of/directory/to/purge ! -name \*.mp3 ! -type d ! -type l -print0 | xargs -0 rm �f
or perhaps (not sure about this):
find /root/of/directory/to/purge -type f \(! -name \*.mp3 \) -mtime -1 \ -print0 | xargs -0 rm �f
this will delete all files that do not have a name that ends in ".mp3", and not directories and are not symbolic links
remove � rm � see also recursively delete files
rename � mv
rpm
to install: rpm -i <name of your rpm> as root, and have it install. This is much better than using the package installer that comes with KDE - especially if there are problems. Using this from the command line will point out dependencies better.
Rescue -- To use the boot disk with rescue mode, you have several options:
Using the CD-ROM to boot, type linux rescue at the boot: prompt.
Using the network boot disk, type linux rescue at the boot: prompt. You will then be prompted to pull the rescue image from the network.
Using the boot disk included with the Red Hat Linux boxed set, type linux rescue at the boot: prompt. You then pick an installation method and choose a valid installation tree to load from.
samba � etc/samba/smb.cfg
samba, allow windows machines to browse the network
edit etc/samba/smb.cfg
set �wins support = yes�
samba, start � smdb -D -s (also, nmdb -D)
samba, stop � kill -TERM -a smbd (also, kill -TERM -a nmbd and kill -HUP -a inetd)
if you get
-su: kill: -a: no such pid
-su: kill: smbd: no such pid
then
- ps -aux | grep smbd
find the number of the process you�re looking for, and kill it instead
schedule commands � run the �at� command, issue command, then Ctl-d. For example, to activate and then deactivate mail forwarding
To activate at some future date: �at 8 am Monday�, then hit return. Enter the �mv .forward.was .forward�. Then hit �Ctl-d� to get out of that mode.
Similarly, to deactivate it even later, �at 5:30 1/4/2004�, hit return, enter �mv .forward .forward.was� and hit �Ctl-d�
To see both these jobs queued, type �atq�
scp [[user@]host1:]file1 [[user@]host2:]file2
SCP to securely copy files from Windows to remote Linux box � WinSCP
screen resolutions � (see video settings) xvidtune or edit /etc/X11/XF86Config (comment out lower refresh settings)
screen capture � xv
search for string � grep -R string . (the �.� means this directory)
sendmail
restart � /etc/init.d/sendmail restart
sendmail.cf �config file that built from sendmail.mc � /etc/sendmail.cf
sendmail.mc � use to build sendmail.cf � /etc/mail/sendmail.mc
see http://www.redhat.com/support/resources/howto/RH-sendmail-HOWTO/c239.html#AEN245
rebuild sendmail.cf � m4 sendmail.mc > /etc/sendmail.cf
rebuild virtusertable.db from virtuser � makemap hash /etc/mail/virtusertable < virtusertable
service, what services start up automatically � ntsysv. See also process management
Shell prompt � Control-F1 or F2
software, Windows equivalents / replacements / analogs in Linux
source code for Linux � see kernel, install
spam � see SpamAssassin
news site � download page doesn�t work
Another site � download page does work
Settings: man Mail::SpamAssassin::Conf , then emacs /var/home/joe/.spamassassin/user_prefs , add line at bottom: rewrite_subject 1
To re-direct spam to a subdirectory, ad the following code to /var/home/user/.mailfilter:
if (/^X-Spam-Flag: YES/)
{
to "$HOME/Maildir/.spam"
}
If SpamAssassin doesn�t work:
check permissions of all files in the .spamassassin directory
make sure the .mailfilter file includes a line something like: xfilter "/usr/bin/spamc" � even if there is already something like: xfilter "/usr/local/anomy/bin/sanitizer.pl /etc/sanitizer.conf"
to test, go to /var/home/user/Maildir/cur and find an email whose file name might look something like: 1076016465.M469997P16329V0000000000000303I001EC18C_0.davinci,S=35182:2,S
then:
cat '1076016465.M469997P16329V0000000000000303I001EC18C_0.davinci,S=35182:2,S' | /usr/bin/spamc
and the results should have the characteristic SpamAssassin assessment
ssh, create keys
Log on. You should be in your home directory.
cd .ssh
ssh-keygen -t dsa - this will generate a key.
Generating public/private dsa key pair.
Enter file in which to save the key (/var/home/joe/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/home/joe/.ssh/id_dsa.
Your public key has been saved in /var/home/joe/.ssh/id_dsa.pub.
The key fingerprint is:
87:8f:0b:36:9e:32:d6:b6:22:09:32:0b:52:5a:a0:12 joe@davinci
cat id_dsa.pub copy the contents of this file into the buffer
ssh renoir
The authenticity of host 'renoir (192.168.2.45)' can't be established.
RSA key fingerprint is 12:cd:9f:7a:44:7d:99:a2:3f:4a:84:71:9c:fb:3e:a5.
cd .ssh
emacs authorized_keys paste, exit, save.
Now you should be able to ssh directly into the remote server!
start with GUI instead of command line � see GUI, start with
start up, what things automatically start up � ntsysv
string, search for � grep -R string . (the �.� means this directory)
symbolic link, make � ln -s <directory>
tape, list contents � tar -tvf /dev/ftape
tape, test � ftmt -f /dev/qft0 status
tape, HP DAT 40 installation instructions
a couple helpful links:
http://www.lht.com/Products/TapeBackup/Software/Arkeia/GenericSCSILinux.html
http://www.hp.com/cposupport/information_storage/support_doc/lpg51060.html
commands to get the tape drive to be recognized by the system
cd /home/Moschak/Backup/tarz
./linux-aic7xxx-6.2.3-2.4.2-2rh.patch | patch �p1
insmod aic7xxx
command to see whether it worked
cat /proc/scsi/scsi
Look for HP DAT entry
To run Perfect Backup, execute the following 2 commands at a shell prompt:
xhost +
pb
taper �T z
tar:
list what�s on the tape: tar -tvf /dev/ftape
tar.gz � Any file with a .gz suffix is compressed with GNU gzip. You can uncompress it with gunzip or gzip -d (both available by ftp from the GNU program archive at ftp://prep.ai.mit.edu), or if you have a recent version of tar you can uncompress is automatically while untarring it by giving tar the -z option (i.e. tar -zxvf filename.tar.gz).
task manager � ps �aux, see processes running
Theme, get back to KDE � �switchdesk� from command line
Themes � kdethemepark on Disk3, power tools
themes � If you have a some.tar.gz for a theme, just copy the entire some.tar.gz to /usr/share/apps/kthememgr/Themes and rename it to Some.ktheme. You don't even have to extract it. I think that is pretty damn slick.
Tomcat path � /opt/tomcat/webapps/ROOT. Docs: /usr/doc/tomcat-3.1/uguide
Tomcat, start - /opt/tomcat/bin/startup.sh or, better yet, �tomcat start�
Travan-3 density: 44,250 ftpi = 35,400 bpi
umount: /mt/cdrom: device is busy - use lsof - LiSt Open Files
UNIX to Windows, convert - open the file in WordPad
Userid, create � adduser userid � this will prompt for password, phone #, etc. useradd is simpler
video settings � xvidtune or edit /etc/X11/XF86Config (comment out lower refresh settings)
Visual Basic � Mono project
webadmin � http:/localhost:10000/
Windows software equivalents / replacements / analogs in Linux
XF86Config � /etc/X11
XLib: connection to �:0.0� refused by server
XLib: client is not authorized to connect to server
Error: can�t open display: :0.0
Type in: �xhost +� at command line to get:
Access control disabled, clients can connect from any host