Use df -h command to show the total and free disk space remaining on the mounted filesystems.
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
Sunday, September 27, 2009
Friday, September 25, 2009
Linux Cool Tips #2
Monday, September 14, 2009
How to know what Linux Distro you are using?
Listed below are some helpful commands in determining the type of Linux distro you are using, and their corresponding output on the terminal using CentOS 5.3.1. lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.3 (Final)
Description: CentOS release 5.3 (Final)
Release: 5.3
Codename: Final
2. cat /etc/*release
CentOS release 5.3 (Final)
3. cat /etc/issue
CentOS release 5.3 (Final)
Kernel \r or an \m
Then for determining Linux kernel version,
1. uname -a
Linux localhost.localdomain 2.6.18-128.el5 #1 SMP Wed Jan 21 10:44:23 EST 2009
i686 i686 i386 GNU/Linux
2. dmesg | head -1
Linux version 2.6.18-128.el5 (mockbuild@builder16.centos.org)
(gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Wed Jan 21 10:44:23 EST 2009
Labels:
centos,
dmesg,
kernel,
linux,
linux kernel version,
lsb_release,
uname,
version,
what linux distro
Setting up Subversion server on Linux (CentOS)
1. Subversion is normally installed in CentOS 5.3 but just to make sure, issue the which command in the terminal. # which svn
/usr/bin/svn will be displayed if svn is installed
2. We then edit iptables to allow connections at port 3690.
# vi /etc/sysconfig/iptables
Then insert the following line before the line that contains "-j REJECT"
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3690 -j ACCEPT
Then save the iptables
# service iptables save
3. Lets now create a repository
# svnadmin create PATH_TO_REPO/myrepo
4. Then edit the configuration file, svnserve.conf located within myrepo/conf directory.
# vi PATH_TO_REPO/myrepo/conf/svnserve.conf
[general]
anon-access=none
aut-access=write
password-db=passwd
realm=myproject
5. Add user logins by editing the passwd file at the same directory.
# vi PATH_TO_REPO/myrepo/conf/passwd
[users]
iamuser=iamuser1234
6. If svnserve is already running, stop it first then start it again to apply the changes we made.
# killall svnserve
# svnserve -d
If you're using TortoiseSVN in Windows, myrepo can now be accessed through
svn://192.xxx.xxx.xxx/PATH_TO_REPO/myrepo
If in case you want to access the server using the realm name e.g. svn://192.xxx.xxx.xxx/myproject, just start svnserve by
svnserve -d -r /PATH_TO_REPO/myrepo
Labels:
centos,
iptables,
linux,
repository,
subversion,
svn,
svnserve,
tortoisesvn
Friday, September 11, 2009
Setting up Samba server on Linux
Here is a simple step-by-step guide on how to set-up a basic samba server within Red Hat, Fedora or CentOS Linux distribution. So let's begin!1. Check first if smb (samba) is installed in the system, so in the Terminal type
# chkconfig --list | grep smb
A line containing [smb 0:off 1:off ........] should confirm the existence of smb in the system. If it fails, install first smb through yum or by downloading an rpm, before continuing to step 2.
A line containing [smb 0:off 1:off ........] should confirm the existence of smb in the system. If it fails, install first smb through yum or by downloading an rpm, before continuing to step 2.
2. Edit the smb configuration file through smb.conf
# vi /etc/samba/smb.conf
Then add these lines
[global]
workgroup = myWorkgroup
security = user
path = /home
netbios name = mySMB
[public]
writeable = no
path = /home/public
available = yes
public = true
guest account = ok
[private]
writeable = yes
path = /home/private
available = yes
Save smb.conf (press Esc and type :wq then Enter) and restart smb
# /etc/init.d/smb restart
3. By this time, the public folder should now be accessible to any PC on the myWorkgroup network through smb. However, accessibility to the private folder is restricted only to registered users in the smb server. So on terminal, type
# adduser iamuser *create a unix account
# passwd iamuser *set password
# smbpasswd -a iamuser *add iamuser to smb users
Then restart smb
# /etc/init.d/smb restart
*Note that it is not necessary that passwords for unix and smb accounts are different. It is just easier to recall if they are the same :).
SMB access to the private folder should now be available by entering the proper logins we've created. If you want to make the public folder writeable by anyone, just change writeable = yes into writeable = no.
4. If in case neither public nor private folder is accessible after the previous steps, smb access may be restricted by the firewall. To allow smb connections, we should edit the iptables.
# vi /etc/sysconfig/iptables
Then add these 4 lines before the line with the words "-j REJECT"
-A RH-Firewall-1-INPUT -p udp -m udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
Save and then restart iptables service
# service iptables restart
And thats it! The smb server should now be up and running :). Remember that what we did in the smb.conf file are just basic configurations. There are a lot more options available for modifying the server like restricting accesses to specific users and IP addresses, and printeroptions to name a few. Go and just figure it out for yourselves :D.
5. To access our smb server in Windows, open Windows Explorer and on the address bar, input \\192.xxx.xxx.xxx\ and then public and private folders should appear (192.xxx.xxx.xxx is the server's ip address). Then for other Linux machines, you can type smb://192.xxx.xxx.xxx in Konqueror or Firefox to open the server.
That's the end of the guide and thanks for viewing :).
Subscribe to:
Posts (Atom)
