home / linux An important concept to remember :
to Linux, everything is a file.

Vi editor | fdisk | startup | Kernel versions | Red Hat | SuSE | Ubuntu | e1001 Pend | Links | End

 

Linux experiences

El 'Software Libre' es un asunto de libertad, no de precio.
Para entender el concepto, debes pensar en 'libre' como en 'libertad de expresión', no como en 'cerveza gratis'.
[N. del T.: en inglés una misma palabra (free) significa tanto libre como gratis, lo que ha dado lugar a cierta confusión].  


Hardware Software
TP 760 Caldera 2.4
P 90 SuSE 6.4
486 DX2 SuSE 7.2
IBM 9595 SuSE 8.1
TP 770 X SuSE 8.2
P 4 RH 6.2
  RH 7.2
  Debian 2.2 r5i3

 


Hardware, es a dir, ferralla  

Pots anar directament a la part de software.

TP 760 ED de IBM  

Ara hi tinc un Red Hat 6.2.


TP 770 X de IBM  

Ara hi tinc un Suse 8.2.


Pentium 90  

Ara hi tinc un Caldera 2.4.

486 DX2  

Ara hi tinc un SuSE 6.4.

IBM 9595  

Ara hi tinc un Debian 2.2 r5i3, dins un BootMagic que tambe veu el xykra (RH6.1custom)

Resum de ferralla

  TP760 P90 486 DX2 9595
Model/Type 9546x9A Trust 330-466 DX2, 6571-LV1 PS/2 95, 9595-ALF
CPU Pentium 133 MHz Pentium 90 MHz DX2 60 MHz 486 DX2 25/50 MHz
Bus PCI 66 MHz, pcmcia IDE    
RAM 48 MB 16 MB 64 MB 40 MB
HD 1,2 GB .. 3 GB 500 MB + 10 GB 2 x 300 MB 398+2x528+529 MB
Video Trident Cyber 9385 Cirrus CL-GD5434 1024x768=43 Hz i-lazed XGA
Monitor 9514-B TFT Super-VGA 1024x768 8515 9524
Red 10/100 Etherjet Realtek 8139-series Nowell 2000, HT-202 CT. MCA 16/4 adapter, ISA-16
Modem MWave DSP Cirrus 56K external    
Sound MWave DSP Creative SB PCI 128 Legacy    
Op. Sys RH 6.2 W95 + BM + Caldera 2.4 W95 + BM + SuSE 6.4 W95 + BM + xykra + Debian 2.2

Software, c'est a dire, le logicien

Pots anar directament a la part de hardware.

Caldera 2.4 eDesktop


SuSE 6.4


SuSE 7.2


Red Hat 6.2 i 7.2


SuSE 8.1

La configuració (de xarxa) ja NO es troba a /etc/rc.config
Ara, es standard : /etc/sysconfig/network/ifcfg-eth-pcmcia-0

SuSE 8.2

New file


Debian 2.2 r5i3

Les versions testing de Debian se'n diuen sarge mentre que les unstable se'n diuen sid

Comandes interessants

Generalitats

Tornar a dalt de tot

Comandes específiques

Tornar a dalt de tot

Amunt! Top Amunt!
Services

Lets display a list of all runlevels and services used by them:

bcnlab029:~ # chkconfig --list Makefile 0:off 1:off 2:off 3:off 4:off 5:off 6:off SuSEfirewall2_init 0:off 1:off 2:off 3:off 4:off 5:off 6:off SuSEfirewall2_setup 0:off 1:off 2:off 3:off 4:off 5:off 6:off aaeventd 0:off 1:off 2:off 3:off 4:off 5:off 6:off autofs 0:off 1:off 2:off 3:off 4:off 5:off 6:off autoyast 0:off 1:off 2:off 3:off 4:off 5:off 6:off boot.apparmor 0:off 1:off 2:on 3:on 4:off 5:on 6:off B:on cron 0:off 1:off 2:on 3:on 4:off 5:on 6:off cups 0:off 1:off 2:on 3:on 4:off 5:on 6:off gpm 0:off 1:off 2:off 3:off 4:off 5:off 6:off gssd 0:off 1:off 2:off 3:off 4:off 5:off 6:off haldaemon 0:off 1:off 2:off 3:on 4:off 5:on 6:off idmapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off ipmi 0:off 1:off 2:off 3:off 4:off 5:off 6:off kbd 0:off 1:on 2:on 3:on 4:off 5:on 6:off S:on lm_sensors 0:off 1:off 2:off 3:off 4:off 5:off 6:off mdadmd 0:off 1:off 2:off 3:off 4:off 5:off 6:off microcode 0:off 1:on 2:on 3:on 4:off 5:on 6:off S:on multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:off 5:on 6:off xinetd 0:off 1:off 2:off 3:off 4:off 5:off 6:off ypbind 0:off 1:off 2:off 3:off 4:off 5:off 6:off xinetd based services: chargen: off chargen-udp: off cups-lpd: off daytime: off daytime-udp: off echo: off echo-udp: off fam: off netstat: off rsync: off servers: off services: off swat: off systat: off time: off time-udp: off vnc: off
Startup scripts

LinuxJournal, How-To,

Definim la feina a fer a /etc/init.d - "the scripts for controlling the system are placed in /etc/init.d/":

lab029:/etc/init.d # cat sebasCmd.sh #!/bin/bash fn=/home/sebas/logs/sebasCmd.log date_name=`date +"%y/%m/%d"` time_name=`date +"%H:%M"` echo "("$time_name") +++ SEBAScmd - today is ("$date_name")." >> $fn echo "("$time_name") +++ SEBAScmd - we are at level ..." >> $fn runlevel >> $fn ps -ef | grep AppS >> $fn logger -p user.info "("$time_name") +++ +++ +++ +++ SAG : /etc/init.d/sebasCmd.sh - today is {"$date_name"} - log in file (" $fn ")."

I la activem:

lab029:/etc/rc.d/rc5.d # ln -s /etc/init.d/sebasCmd.sh S88sebas

Que llença "S88sebas" ? /sbin/init -> /etc/inittab "si::nom:/etc/init.d" -> /etc/rc.d/rc



Amunt! Top Amunt!
Red Hat
Manuals

Nice Install Guide, all RHL-9 manuals : getting started, customization, reference, security, sys admin, glossary ... RHEL5 Administration.

LVM (rh), LVM How-To.

Magazine.

$DISPLAY & related apps

Configuració : system-config-packages - requires $DISPLAY !

[sebas@lab cmds]$ export 'DISPLAY=99.145.102.166:0.0' ; Xming's IP ! [sebas@lab cmds]$ echo $DISPLAY 99.145.102.166:0.0 [sebas@lab cmds]$ xterm & [1] 7499 [sebas@lab cmds]$ Xlib: connection to "99.145.102.166:0.0" refused by server Xlib: No protocol specified xterm Xt error: Can't open display: 99.145.102.166:0.0 [1]+ Exit 1 xterm [sebas@lab cmds]$ Edit X0.hosts to include RH client's IP : c:\Program Files\Xming> type X0.hosts localhost 99.137.164.154 [sebas@lab cmds]$ xterm & [1] 7550 [sebas@lab cmds]$ Warning: Cannot convert string "nil2" to type FontStruct xterm: unable to open font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1", trying "fixed"....

Tambe podem fer servir gedit & o gvim &

New User : useradd + passwd. See /home/<user>/ directory is created.

List of installed software for reinstallation

RPM based distributions (RHEL, Fedora Core, Cent OS, Suse Linux etc) - Use rpm command to get list of all installed software:

$ rpm -qa > ./installed-software.log

To install all software:

# yum -y install $(cat ./installed-software.log)

url

logrotate
/var/lib/logrotate.status Default state file. /etc/logrotate.conf Configuration options. /var/log/messages { rotate 5 weekly postrotate /sbin/killall -HUP syslogd endscript }

To run it daily:

sag@p7029:/etc/cron.daily> cat logrotate #!/bin/sh TMPF=`mktemp /tmp/logrotate.XXXXXXXXXX` /usr/sbin/logrotate /etc/logrotate.conf 2>&1 | tee $TMPF EXITVALUE=${PIPESTATUS[0]} if [ $EXITVALUE != 0 ]; then # wait a sec, we might just have restarted syslog sleep 1 # tell what went wrong /bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" /bin/logger -t logrotate -f $TMPF fi rm -f $TMPF exit 0

Or :

cat /etc/cron.daily/logrotate #! /bin/sh /usr/sbin/logrotate /etc/logrotate.conf

To read conf file :

p7029:/var/log # logrotate -f /etc/logrotate.conf Shutting down slpd done Starting slpd done Reload syslog service done Reload syslog service done
Mail

The default MDA on Red Hat Linux systems is procmail. Postfix Installation on RH, and how to remove "sendmail" :

rpm -e sendmail sendmail-cf sendmail-doc --nodeps + kill PID (ps -ef | grep 'sendmail')
ISOs

mount -o loop -t iso9660 <isofilename> <mountpoint>
gcc C compiler
-bash-3.00$ gcc --help Usage: gcc [options] file... Options: -pass-exit-codes Exit with highest error code from a phase --help Display this information --target-help Display target specific command line options (Use '-v --help' to display command line options of sub-processes) -dumpspecs Display all of the built in spec strings -dumpversion Display the version of the compiler -dumpmachine Display the compiler's target processor -print-search-dirs Display the directories in the compiler's search path -print-libgcc-file-name Display the name of the compiler's companion library -print-file-name=<lib> Display the full path to library -print-prog-name=<prog> Display the full path to compiler component -print-multi-directory Display the root directory for versions of libgcc -print-multi-lib Display the mapping between command line options and multiple library search directories -print-multi-os-directory Display the relative path to OS libraries -Wa,<options> Pass comma-separated on to the assembler -Wp,<options> Pass comma-separated on to the preprocessor -Wl,<options> Pass comma-separated on to the linker -Xassembler <arg> Pass on to the assembler -Xpreprocessor <arg> Pass on to the preprocessor -Xlinker <arg> Pass on to the linker -save-temps Do not delete intermediate files -pipe Use pipes rather than intermediate files -time Time the execution of each subprocess -specs=<file> Override built-in specs with the contents of -std=<standard> Assume that the input sources are for -B <directory> Add to the compiler's search paths -b <machine> Run gcc for target , if installed -V <version> Run gcc version number , if installed -v Display the programs invoked by the compiler -### Like -v but options quoted and commands not executed -E Preprocess only; do not compile, assemble or link -S Compile only; do not assemble or link -c Compile and assemble, but do not link -o <file> Place the output into -x <language> Specify the language of the following input files Permissible languages include: c c++ assembler none 'none' means revert to the default behavior of guessing the language based on the file's extension Options starting with -g, -f, -m, -O, -W, or --param are automatically passed on to the various sub-processes invoked by gcc. In order to pass other options on to these processes the -W options must be used.
TCP/IP RH

Hostname & Default Gateway: edit /etc/sysconfig/network file to set HOSTNAME=thename and GATEWAY=<ip>.

[root@linux5 /etc/sysconfig]# cat network NETWORKING=yes HOSTNAME="mybox.mydomain.com" DHCP_HOSTNAME="mybox.mydomain.com" GATEWAY=1.2.3.4

DNS and Domain: edit /etc/resolv.conf file to set NAMESERVER=thename and DOMAIN=thename.

[root@lab2 etc]# cat resolv.conf ; generated by /sbin/dhclient-script search bar.es.hal.com nameserver 9.64.163.21 nameserver 9.64.162.21

IP por DHCP :

[root@linux5 /etc/sysconfig/network-scripts]# cat ifcfg-eth0 DEVICE=eth0 BOOTPROTO=dhcp ONBOOT=yes HWADDR=00:0D:60:7A:42:FA TYPE=Ethernet USERCTL=no IPV6INIT=no PEERDNS=yes DHCP_HOSTNAME="labss8.bar.es.com" check_link_down() { return 1; }

Visualitzem el default Gateway amb:

[root@labss1 dhcp]# route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 9.137.164.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 9.137.164.1 0.0.0.0 UG 0 0 0 eth0

I les dades del DHCP amb:

$ cat /var/lib/dhcp/dhclient-eth0.leases lease { interface "eth0"; fixed-address 9.137.164.154; option subnet-mask 255.255.255.0; option dhcp-lease-time 43200; option routers 9.137.164.1; option dhcp-message-type 5; option domain-name-servers 9.64.163.21,9.64.162.21; option dhcp-server-identifier 9.64.163.10; option domain-name "bar.es.hal.com"; renew 4 2011/4/28 19:42:05; rebind 5 2011/4/29 00:48:45; expire 5 2011/4/29 02:18:45; }

IP estàtica:

[root@linux5 /etc/sysconfig/network-scripts]# cat ifcfg-eth0 DEVICE=eth0 BOOTPROTO=none ONBOOT=no IPADDR=192.168.78.83 NETMASK=255.255.255.0 GATEWAY=192.168.78.1

Display all IP data {with a parse pending...} :

lab2 $ #!/bin/bash if [ `id -u` -ne 0 ] then echo "Must be running as root" exit 1 fi echo "La MAC es :" ifconfig eth0 | grep HWaddr echo "La IP es :" ifconfig eth0 | grep "inet addr:" echo "El Default Gateway es :" route -n | grep "UG" echo "Els DNS son :" cat /etc/resolv.conf | grep "nameserver" echo "El domini es :" cat /etc/resolv.conf | grep ".com"

Display own IP:

/sbin/ifconfig eth0 | grep "inet addr" | cut -d "B" -f 1 | cut -d ":" -f 2 | sed 's/^ *//;s/ *$//'

Use conky + "${addr eth0}"

Network restart :

[root@lab2 etc]# /etc/init.d/network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Setting network parameters: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: [ OK ]

xInetd :

[root@lab2 ~]# /etc/init.d/xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ]

ifdown/up :

[root@lab2 ~]# ifdown eth0 [root@lab2 ~]# ifup eth0 [root@lab2 ~]# ifconfig eth0
Samba

yum install samba & vi /etc/samba/smb.conf
Creer le share public

[public] comment = Public Stuff path = /public public = yes writable = yes printable = no

Alors

/etc/init.d/smb start smbpasswd -a

Et voila!

Users
adduser u1 -p pu1 -n ; dont create "u1" group, but use "users" group instead. passwd u1 ; set (short) pwd.
Remote Desktop

Use Remote VNC at Windows, and configure access at RH via System -> Preferences -> Remote desktop (remove "Ask for your confirmation"). VNC.


Amunt! Top Amunt!
SLES 10 (p7029 & p9111)

Configure (command line) using yast from root. SLES 10 Install & Admin doc.

Interesting files for troubleshooting :

/proc/cpuinfo /proc/dma /proc/interrupts /proc/iomem /proc/ioports /proc/meminfo /proc/modules /proc/mounts /proc/partitions /proc/version /var/log/boot.msg /var/log/messages /var/log/faillog /var/log/warn /var/log/YaST2/y2log

An interesting file executed at end /etc/init.d/halt.local :

sebas@p7029-6E3:~/cmds> cat tanquem.sh #!/bin/sh # # Feina que volem fer quan es tanqui la maquina : enviar una linia a /var/log/messages # tDate=`date +%F` tTime=`date +"%H:%M"` fLog="/home/sebas/cmds/txt/txtEnd.txt" rm -f $fLog lHead="SAG End01 v1.1 - soc (`hostname`) i son les "$tTime" del "$tDate"." ; echo "+++ ============================================" > $fLog echo $lHead >> $fLog df -h >> $fLog w >> $fLog echo "--- ============================================" >> $fLog logger -p user.info -f $fLog

Admin Guide. Forum Novell.

/etc/init.d/before.local = user defined resource control script which should be executed _before_ runlevel is entered. /etc/init.d/after.local = user defined resource control script which should be executed _after_ runlevel is entered.

Download (FTP3) : /suse/release_cds/sles-10-ppc - Power PC.

X11, SaX, xMing

To have a graphical envir into P9111, do :

  1. on T400, edit X0.hosts to include p9111's IP.
  2. on T400, start Xming (a small icon appears in tray area).
  3. on p9111, do export DISPLAY="<T400.IP>:0"
  4. on p9111 now you launch the command "xeyes &" and "xterm &" and SaX2 & (under root) ... but the window shall open on T400 desktop !
SuSE (11)

Nowell documentation.

(auto) Yast : /root/autoinst.xml,

"hwinfo --netcard"

/root/autoyast.xml

/var/adm/autoinstall/cache

Cloned SUSE 11 virtual machine does not have network connectivity after reboot.

DHCP & DNS server(s)

Quin port fan servir ? By default BIND listen DNS queries on port 53

Required packages :

SolutionBase: Configuring a DHCP server with SuSE's YaST ; Configuring a DNS server with SuSE's YaST ;

DNS & SLES.

TCP/IP SuSE

Hostname : edit /etc/HOSTNAME (mind UpperCase) file to set the_name.

Static IP : edit /etc/sysconfig/network/ifcfg-eth<id> to set IPADDR='1.2.3.4' and BOOTPROTO=static

p9111-520:/etc/sysconfig/network # cat ifcfg-eth0 BOOTPROTO='static' BROADCAST='' ETHTOOL_OPTIONS='' IPADDR='9.137.166.102' MTU='' NAME='IBM 82546EB Gigabit Ethernet Controller (Copper)' NETMASK='255.255.255.128' NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' or 'onboot' UNIQUE='0R2q.iOeGlAIwnbF' USERCONTROL='no' _nm_name='bus-pci-0000:d0:01.0'

Dynamic IP :

p9111-520:/etc/sysconfig/network # cat ifcfg-eth0 BOOTPROTO=’dhcp’ NETMASK=’255.255.255.0’ NETWORK=’’ STARTMODE=’auto’ USERCONTROL=’no’ IPADDR=’’

Default Gateway :

p9111-520:/etc # cat /etc/sysconfig/network/routes default 111.112.113.114 - -

To display it, use:

p9111-520:/etc # route -nv

To restart communications, use

linux5:/etc/sysconfig/network # /etc/init.d/network restart

DNS & domain :

p9111-520:/etc # cat resolv.conf nameserver 9.64.163.21 nameserver 9.64.162.21 domain bar.es.hal.com search bcn.es.hal.com

DNS cfg : NAMED.CONF + 1 text file by zone

DHCP cfg :(port 67)

/etc/dhcp3/dhcpd.conf /var/lib/dhcp3/dhcpd.leases
USB disc

To use a USB disc on SuSE, do :

FTP server @ SLES 10

VSFTPD url, doc.

p9111-520:/home/sag/soft/ftp # wget https://security.appspot.com/downloads/vsftpd-2.3.4.tar.gz p9111-520:/home/sag/soft/ftp # tar -xvzf vsftpd-2.3.4.tar.gz p9111-520:/home/sag/soft/ftp # cd vsftpd-2.3.4/ p9111-520:/home/sag/soft/ftp # make p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # ls -l vsftpd -rwxr-xr-x 1 root root 125584 Oct 25 19:11 vsftpd p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd /usr/local/sbin/vsftpd p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd.conf.5 /usr/local/man/man5 p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd.8 /usr/local/man/man8 p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp vsftpd.conf /etc p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # mkdir /usr/share/empty/ p9111-520:/home/sebas/soft/ftp/vsftpd-2.3.4 # cp RedHat/vsftpd.pam /etc/pam.d/ftp // allow non-anonymous login

Standalone : edit /etc/vsftpd.conf, and verify:

anonymous_enable=NO local_enable=YES write_enable=YES listen=YES

Start FTP daemon manually:

[root@localhost root]# /usr/local/sbin/vsftpd & [1] 2104

If we want to run FTP daemon from xinetd, then
a) remove "LISTEN=YES from /etc/vsftpd.conf :

# --- listen=YES
b) then, verify /etc/xinetd.conf :
defaults { log_type = FILE /var/log/xinetd.log log_on_success = HOST EXIT DURATION log_on_failure = HOST ATTEMPT # only_from = localhost instances = 30 cps = 50 10 } includedir /etc/xinetd.d
c) create ftp in /etc/xinetd.d and watch /var/log/xinetd.log:
# vsftpd is the secure FTP server. service ftp { disable = no socket_type = stream wait = no user = root server = /usr/local/sbin/vsftpd per_source = 5 instances = 200 no_access = 192.168.1.3 banner_fail = /etc/vsftpd.busy_banner log_on_success += PID HOST DURATION log_on_failure += HOST }

Restart xinetd using /etc/init.d/xinetd restart and try ftp localhost.

Filezilla

Per instalar Filezilla a SuSE 10, fem :

Dubtes

Amunt! Top Amunt!
Ubuntu

Wiki

Community

Ubuntu Guide

Ubuntu Geek

Instalació VMWare Server, 8.04.

Ubuntu & Default GW.

Actualització
apt-get update apt-cache apt-cdrom apt-config apt-extracttemplates apt-ftparchive apt-get apt-key apt-mark apt-sortpkgs aptitude search X o apt-cache search

Download.

Installing VMware Player or Server [***] on Ubuntu
Has patch + shell !

Activate Telnet.

Install SSH. Doc (gracias, Bruno !)

sudo apt-get install openssh-server

Verify it works :

ps -aef | grep sshd

Install sendemail (in debian lenny) :

# apt-get install sendemail
TCP/IP

IP, mask, gw : /etc/network/interfaces
DNS : /etc/resolv.conf
Hostname : /etc/hostname

url

Comanda per agafar IP del DHCP : sudo dhclient
Comanda per ficar IP fixe : sudo ifconfig eth0 192.168.3.4 netmask 255.255.255.0 up
Comanda per reiniciar la xarxa : sudo /etc/init.d/networking restart
Restart Web server : sudo /etc/init.d/apache2 restart
To register to DNS : in /etc/dhcp3/dhclient.conf set send host-name "<my_hostname>"; : the hostname needs to be updated in DNS (to use nslookup)
Display (local) open ports :

sudo nmap localhost -PN

Net Cfg using Cmd Line.

mail

Install PostFix, default MTA for Ubuntu.

theuser@eyeOS_ubuntu:~$ postfix The program 'postfix' is currently not installed. You can install it by typing: sudo apt-get install postfix bash: postfix: command not found theuser@eyeOS_ubuntu:~$ setting inet_interfaces: all /etc/aliases does not exist, creating it. WARNING: /etc/aliases exists, but does not have a root alias. Postfix is now set up with a default configuration. If you need to make changes, edit /etc/postfix/main.cf (and others) as needed. To view Postfix configuration values, see postconf. After modifying main.cf, be sure to run '/etc/init.d/postfix reload'. Running newaliases * Stopping Postfix Mail Transport Agent postfix [ OK ] * Starting Postfix Mail Transport Agent postfix [ OK ] Processing triggers for libc6 ... ldconfig deferred processing now taking place theuser@eyeOS_ubuntu:~$ NAME postfix - Postfix control program SYNOPSIS postfix [-Dv] [-c config_dir] command DESCRIPTION This command is reserved for the superuser. To submit mail, use the Postfix sendmail command. theuser@eyeOS_ubuntu:~$ mail -s "prova" bisc2k9@gmail.com < ./main.eyecode The program 'mail' can be found in the following packages: * heirloom-mailx * mailutils Try: sudo apt-get install bash: mail: command not found theuser@eyeOS_ubuntu:~$
Problemes
NetworkManager device not managed

Try changing [ifupdown] managed=false to true in /etc/NetworkManager/nm-system-settings.conf
Restart network manager : sudo /etc/init.d/network-manager restart

url.


How To Recover Windows MBR using Ubuntu Live CD

If you want to restore Windows Bootloader and for some reason cannot use the windows installation cd, there is a simple way to do it:

Doc, Doc, Doc

Un altre mètode (després de botar Live CD) :
grub-install copies GRUB images into the DIR/boot directory specified by --root-directory, and uses the grub shell to install grub into the boot sector.

grub-install man

Un altre mètode :
You can try SuperGrub live cd to fix your the MBR of your disk : url, WiKi, homepage, get the ISO...


Amunt! Top Amunt!
RPM

When your program crashes

Tornar a dalt de tot

When the System crashes

Tornar a dalt de tot

Common actions

  Suse 6.4 i 7.2 Caldera 2.4 Red Hat 6.2 i 7.2
Instalador yast lisa  
Log Instalacion /var/adm/inst-log/*   /tmp/install.log
Boot logs 8.1 : /var/log/messages Alt-F7 = GUI
Alt-F10 = char
Alt-F12 = RC log (/etc/rc.d/rc)
 
Configuración sistema SuSEconfig
8.1 : yast2
hwinfo -> /tmp/hwinfo.txt
lisa
/etc/system.cnf & /etc/lst.cnf
linuxconf
Configuración usuarios yast useradd
userdel
usermod
userconf
Alias   global : /etc/config.d/shells/bashrc
privat : ~/.profile-private
 
Configuración red netcfg
yast (/etc/rc.config)
  netconf (all, as linuxconf)
netconfig (networking)
netcfg (under X11)
Configuración X11 sax
sax2 under SuSE 8.1
lizardx
SuperProbe
/etc/X11/XF86Config
SuperProbe
Xconfigurator
xconf
Boot files /etc/inittab
/sbin/init.d/boot
/sbin/init.d/boot.local
/sbin/init.d/rc N
/etc/inittab /etc/inittab
/etc/rc.d/init.d
Net cfg files All data : /etc/rc.config
/etc/modules.conf
Gateway : /etc/route.conf
/etc/rc.d/rc.modules
/etc/modules.conf
/etc/sysconfig/network
./network-scripts/ifcfg-eth0
/etc/sysconfig/network
./network-scripts/ifcfg-tr0
Per saber ... DNS : cat /etc/resolv.conf or nslookup
Gateway : route -v
  IP address : ifconfig
DNS : cat /etc/resolv.conf or nslookup
Gateway : route -v or netstat -rn
DHCP : pump --status
NFS /etc/rpc
rup
rpc.rusersd (rusers)
rpc.rwalld (rwall)
rpcinfo -p [<hostname>]
/etc/exports
rpc.portmap (portmapper)
rpc.mountd
rpc.nfsd
rpcinfo -p [<hostname>]
Sound config     sndconfig

Acrònims, noms, projectes - parafernàlia de Linux, WWW, etc

Si tens un nom i no saps que fà, pots fer primer
Si no va bé, pots mirar un index d'aplicacions, on també hi ha un buscador.
Sempre es pot probar una busqueda a Google
Si tot falla, proba el meu diccionari. Ho he escrit tot jo, així que en tinc totes les culpes.

  Single vs. double quotes

Use man 7 glob (wildcard expansion) and man 8 glob (section QUOTING)

Linux I have got


Floppy disk use - save W2K file


Amunt! Top Amunt!
How to send an Email

Basic

#!/bin/bash df -h | mail -s “disk space report” calvin@cnh.com

Medium

#!/bin/bash df -h > /tmp/mail_report.log free -m >> /tmp/mail_report.log mail -s “disk and RAM report” calvin@cnh.com < /tmp/mail_report.log

Complete : mutt allows "attachments" :

#!/bin/bash tar -zcf /tmp/backup.tar.gz /home/calvin/files echo | mutt -a /tmp/backup.tar.gz -s “daily backup of data” calvin@cnh.com

URL

Using smtp-client.pl :

smtp-client.pl --server smtp.gmail.com --from someone@gmail.com --to some@body.else --subject Blah --attach /path/to/a/picture.png

It can also authenticate with a Gmail username and password among other things.

How to use an external SMTP server
$ cat /etc/mail/sendmail.mc dnl # Uncomment and edit the following line if your outgoing mail needs to dnl # be sent out through an external mail server: dnl # dnl define(`SMART_HOST',`smtp.your.provider') dnl # divert(-1)dnl dnl # dnl # This is the sendmail macro config file for m4. dnl # If you make changes to /etc/mail/sendmail.mc, dnl # you will need to regenerate the /etc/mail/sendmail.cf file dnl # by confirming that the sendmail-cf package is installed and then performing a dnl # dnl # make -C /etc/mail dnl # include('/usr/share/sendmail-cf/m4/cf.m4')dnl

To reconfigure it, do :

  1. edit sendmail.mc
  2. rebuild sendmail.cf : m4 sendmail.mc > /etc/sendmail.cf
  3. restart daemon : /sbin/service sendmail stop and /sbin/service sendmail start

Login welcome message

The contents of /etc/motd are displayed by login after a successful login but just before it executes the login shell.

login as: sebas sebas@99.137.164.154's password: Last login: Mon May 24 11:53:18 2010 from sig-9-145-107-205.uk.hal.com . inici MOTD Benvinguts a LAB. . final MOTD

How to add a new disc

We create a new (extended) partition, create a filesystem, make a directory to mount it, and mount it.

fdisk /dev/hdb + "n" (add a new partition) + "e" (extended) + "p" (print partition table) + "w" (write) mkfs -t ext3 /dev/hdb1 mkdir /opt2 mount -t ext3 /dev/hdb1 /opt2

Maybe we want to mount it at system boot, so we edit /etc/fstab:

/dev/hdb1 /opt2 ext3 defaults 1 2

url


LVM

Overview of the main elements in an LVM system:

hda1 hdc1 (PV:s on partitions or whole disks) \ / \ / diskvg (VG) / | \ / | \ usrlv rootlv varlv (LV:s) | | | ext2 reiserfs xfs (filesystems)

url

Useful commands :


Few interesting commands

nohup : keep processes running after you exit from a shell.

nohup command-name & ; continue running in the background after you log out from a shell.

fdisk -l : Partition table manipulator (-l = "list")

smartctl : Control and Monitor Utility for SMART Disks

smartctl -a /dev/hda smartctl -i /dev/hda smartctl -Hc /dev/hda **** Health Check **** smartctl -A /dev/hda smartctl -l error /dev/hda smartctl -t short /dev/hda smartctl -t long /dev/hda smartctl -l selftest /dev/hda man smartctl and man smartd

smartd dæmon that does regular monitoring. Configuration file is /etc/smartd.conf. Logs his information with SYSLOG in /var/log/messages
{RH} /etc/rc.d/init.d/smartd start and /etc/rc.d/init.d/smartd stop can be used to start and stop the dæmon

How to write into /var/log/messages
#!/bin/sh tDate=`date +%F` tTime=`date +"%H:%M"` fLog="/home/sebas/cmds/cron/txtLog.txt" rm -f $fLog lHead="SAG Kron01 - soc (`hostname`) i son les "$tTime" del "$tDate"." ; echo "+++ ============================================" > $fLog echo $lHead >> $fLog netstat -ano | grep 1352 >> $fLog df -h >> $fLog echo "--- ============================================" >> $fLog logger -p user.info -f $fLog

Using only keyboard


Amunt! Top Amunt!
10 SysAdmin tricks

DeveloperWorks


Amunt! Top Amunt!
10 Greatest Open Source Software Of 2009
  1. Inkscape ( Vector Graphics Editor )
  2. 7-Zip ( Archiver )
  3. VLC ( Media Player )
  4. VirtualBox ( Virtualization )
  5. Miro ( Internet TV )
  6. TrueCrypt ( Disk Encryption )
  7. Calibre ( eBook Converter and Reader )
  8. GnuCash ( Financial Management )
  9. GIMP ( Graphics / Simple Photo Editing )
  10. Audacity ( Sound Editor / Recorder )

url

Few more :


Amunt! Top Amunt!
Pending

Books


URLs

Tornar a dalt de tot

Ep ! Site under construction. Escriu-me !
Updated 21/5/2012 (a).  
Uf !