Search This Blog

Monday, February 21, 2011

Linux – beginner’s guide

This is basic linux command line reference guide. I collected these when I was learning linux long time ago.

configure network:
file: /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.60.60.67
netmask 255.255.255.0
broadcast 10.60.60.255
gateway 10.60.60.70
search stonka.forcom.com.pl
dns-nameservers 10.60.60.70 10.60.60.71

configure DNS entries:
/etc/resolv.conf

restart telnet service:
/etc/init.d/inetd restart

restart networking:
/etc/init.d/networking restart

configure proxy:
/etc/apt/apt.conf
Acquire::http::Proxy "http://user_name:password@10.60.1.248:8080/";

add default gateway:
route add default gw 10.60.60.60

configure samba:
/etc/samba/smb.conf

restart samba service:
service smbd restart

restart xen deamon:
/etc/init.d/xend restart

xen config:
/etc/xen/xend_config.sxp

add users to sudoers:
/etc/sudoers
www-data ALL=(ALL) ALL

default www directory
/var/www

configure wget to use proxy:
/etc/wgerc
#http_proxy
#use_proxy = on

Configure apt-get sources:
/etc/apt/sources.list

to use samba you need to install:
aptitude install samba smbfs smbclient
mount -o username=backup,password=backup //10.60.1.241/nfswin /mnt/BACKUP/
tar cvzf alldoc.tar.gz *.doc
tar cvzf alldoc.tar.gz ./docs/
tar xzvf foo.tar

what should mount at boot:
/etc/fstab
//10.60.1.241/nfswin /mnt/mechlak cifs username=backup,password=backup
telnet
/etc/init.d/inetd restart

setting samba users:
smbpasswd -a root
   new passwd: xxxxxx

run-time variable data:
/var/run

www-public-data:
/var/www
file: /etc/sudoers
root ALL=(ALL) ALL
list devices (PCI):
lspci

configure grub:
nano /boot/grub/menu.lst
update grub from menu.lst (grub 1 style)
grub-install /dev/sda
update-grub <- grub 2 style
./grub
root(hd0,0)
setup(hd0)

prevent X11 from starting at boot:
update-rc.d -f gdm remove

mount NTFS share on samba:
smbmount //10.60.1.241 /mnt/point
smbmount //10.60.1.241 -o username=xxxx,password=xxxx /mnt/point
mount -t smbfs –o username=xxxx,password=xxxx //10.60.1.241 /mnt/point

No comments:

Post a Comment

If you like this post, please leave a comment :)