Archive for the ‘Seneca’ Category

Samba How To, Using “system-config-samba” – Fedora 9

November 9, 2008

Required packages:

  • samba-3.2.4-0.21.fc9.i386
  • system-config-samba-1.2.63-1.fc9.noarch
  • samba-common-3.2.4-0.21.fc9.i386
  • samba-client-3.2.4-0.21.fc9.i386

Installing the required packages using yum:

#yum -y install samba system-config-samba samba-common samba-clients

Then execute system-config-samba to set the configurations for the samba server. The samba configuration file is /etc/samba/smb.conf






Your samba configuration file (/etc/samba/smb.conf) is going to be something like this:

workgroup = milton
server string = Milton’s Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = tdbsam
cups options = raw
username map = /etc/samba/smbusers

comment = Home Directories
browseable = no
writable = yes

comment = All Printers
path = /var/spool/samba
browseable = no
printable = yes

path = /tmp
writeable = yes
valid users = milton

After a user login using a windows machine, It will have access to two folders, their home directory and the tmp folder.

If you have some problems in the server, just go to the folder /var/log/samba and check the log files:

  • log.nmbd
  • log.smbd

Actually I don’t like to use graphical tools to set up my servers, but this tools can really save you some time.


Virtual Machine – How To – Fedora 9 in Fedora 9

November 5, 2008

1) yum -y update

2) yum -y install libvirt virt-manage

3) run the service libvirtd
# service libvirtd start

4) Open the virtual machine manager and connect to the localhost


5) Create a virtual machine


You will be asked for some informations:

  • System Name
  • Select fully virtualized
  • Select the path of your instalation
  • Select the mount of space you want to leave for the system


  • Select virtual network
  • Now select the amount of memory and number of cores that are going to be used in the new virtual machine


6) Now just verify the information provided before and create the virtual machine


    7) If everything has gone right you must have a screen like this:


    Have fun !!!

    Robot Exclusion

    September 23, 2008


    Robots are programs that goes to many pages recursively retrieving linked pages. They are also called WWW Robots, Spiders or Crawlers.

    They were useful in the past when the dial-up calls were expensive and a cheaper solution was to download all the texts (newspapers, books, etc) you want to read in your computer and then hang up the phone line, saving you some money in the phone bill.

    One popular program I used in that days was webmirror ( )

    Some time in the years 1993 or 1994 there have been occasions where robots have visited web servers where they weren’t welcome for various reasons. One of these reasons were robot specific swamped servers with rapid-fire requests, retrieved the same files repeatedly or going very deep virtual trees.

    These incidents indicated the need for established mechanisms for web servers to indicate to robots which parts of their server should not be accessed.

    The solution to exclude robots from accessing sensitive information on a server was to create a file on the server which specifies an access policy for robots. This file must be accessible via HTTP on the local URL “/robots.txt“.

    This approach was chosen because it can be easily implemented on any existing WWW server, and a robot can find the access policy with only a single document retrieval. Even though this control is implemented in the robot, and can deactivated.

    XWN740 – Lab2

    September 22, 2008

    This lab was cool, because these commands can help you to troubleshot a lot of problems. It happened with me some times that the mouse of the server did not work properly and instead of use the cursor I plugged a usb mouse, but with the knowledge I gained about how to use the keys to do the mouse work. I will never need to plug another usb mouse, once I can use the numeric keyboard.

    Answers for the lab here.

    Tips to register and protect your nickname on IRC

    September 12, 2008

    Connect to the IRC server and type the following commands

    1) Register

    /msg nickserv register <password>   <email>

    You will receive a email with a password to confirm the registration process.

    2) To avoid other users to use your nickname

    /msg NickServ set enforce on

    If someone try to use your nickname, this person will have their nickname changed.

    3) To identify your nickname

    /msg nickserv identify <password>

    SPR720 – Command Lab

    September 8, 2008

    1. Go through the files in /usr/bin and for each file, note whether it’s a command you have used. Select 25 of the commands you haven’t used and research what they do (use manpages and online resources). Blog about your experience and what you’ve found.

    List of commands that I have never used:

    Source: Linux manpages

    a2p – Awk to Perl translator
    A2p takes an awk script specified on the command line (or from standard input) and produces a comparable perl script on the standard output.

    ab – Apache HTTP server benchmarking tool
    ab  is  a  tool  for  benchmarking  your  Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs.  This  especially shows you how many requests per second your Apache installation is capable of serving.

    ac –  print statistics about users’ connect time
    ac prints out a report of connect time (in hours) based on the logins/logouts in the current wtmp file.  A total is also printed out.

    bc – An arbitrary precision calculator language
    bc  is  a language that supports arbitrary precision numbers with interactive execution of statements.

    bzmore, bzless – file perusal filter for crt viewing of bzip2 compressed text

    bzgrep, bzfgrep, bzegrep – search possibly bzip2 compressed files for a regular expression

    bzcat – decompresses files to stdout

    bzip2recover – recovers data from damaged bzip2 files

    bzcmp, bzdiff – compare bzip2 compressed files
    Bzcmp  and  bzdiff are used to invoke the cmp or the diff program on bzip2 compressed files.  All options specified are passed directly to cmp or diff.  If only 1  file  is  specified, then  the files  compared  are  file1 and an uncompressed file1.bz2. If two files are specified, then they are uncompressed if necessary and fed to cmp or diff.  The exit status from cmp or diff  is  preserved.

    cd-info – List informations about the medias in the cd/dvd drive

    cd-drive – List informations about the physical drive

    comm – compare two sorted files line by line
    Compare sorted files FILE1 and FILE2 line by line. With  no option, produce three-column output.  Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and column three contains lines common to both files.

    cmp – compare two files
    The cmp utility compares two files of any type and writes the results to the standard output.  By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported.

    createuser – define a new PostgreSQL user account
    createuser  creates a new PostgreSQL user (or more precisely, a role).  Only superusers and users with CREATEROLE privilege can create new users, so createuser must be invoked by someone who  can connect as a superuser or a user with CREATEROLE privilege.

    createrepo – Create repomd (xml-rpm-metadata) repository
    createrepo  is  a program that creates a repomd (xml-based rpm metadata) repository from a set of rpms.

    ddate – converts Gregorian dates to Discordian dates
    ddate prints the date in Discordian date format. If  called with no arguments, ddate will get the current system date, convert this to the Discordian date format and print this on the standard output. Alternatively, a Gregorian  date  may  be specified on the command line, in the form of a numerical day, month and year.

    file – determine the file type

    id – print user identity
    Print information for USERNAME, or the current user

    isosize – outputs the length of a iso9660 file system
    This  command  outputs the length of an iso9660 file system that is contained in given file. That file may be a normal file or a block device (e.g. /dev/hdd or /dev/sr0). In the  absence  of  any switches (or errors) it will output the size of the iso9660 file system in bytes. This can now be a large number (> > 4 GB).

    locale – Get locale-specific information.
    The locale program writes information about the current locale environment, or all locales, to standard output. When invoked without arguments, locale summarizes the current locale environment for each locale category defined by the LC_* environment variables.

    last, lastb – show listing of last logged in users
    Last  searches  back  through  the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created.  Names of users and tty’s  can  be  given,  in  which  case last will show only those entries matching the arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.

    lndir – create a shadow directory of symbolic links to another directory tree
    The  lndir  program makes a shadow copy todir of a directory tree fromdir, except that the shadow is not populated with real files but instead with symbolic links pointing at the  real  files  in the  fromdir  directory  tree.   This is usually useful for maintaining source code for different machine architectures.  You create a shadow directory containing links to the real source,  which you  will  have usually mounted from a remote machine.  You can build in the shadow tree, and the object files will be in the shadow directory, while the source files in the shadow directory  are just symlinks to the real files.

    look – display lines beginning with a given string
    The look utility displays any lines in file which contain string as a prefix.  As look performs a binary search, the lines in file must be sorted (where sort(1) got the same options -d and/or -f that look is invoked with).

    lua – lua compiler

    lsdvd – read the content info of a DVD

    An application  for reading the contents of a DVD and printing the contents to your terminal and dump for further processing in external applications.

    nc – arbitrary TCP and UDP connections and listens

    The nc (or netcat) utility is used for just about anything under the sun involving TCP or UDP.  It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6.  Unlike telnet(1), nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet(1) does with some.

    nsupdate – Dynamic DNS update utility
    nsupdate is used to submit Dynamic DNS Update requests as defined in RFC2136 to a name server. This allows resource records to be added or removed from a zone without manually editing the zone file. A single update request can contain requests to add or remove more than one resource record.

    ntfsfix – fix common errors and force Windows to check NTFS

    ntfsfix  is  a  utility  that fixes some common NTFS problems.

    ntfscmp – compare two NTFS filesystems and tell the differences

    After finish the research in the folder /usr/bin I realize that there are a lot of tools, some times not so popular, that can help a lot in the administration and problem solving on Linux Servers.

    NAD710 – LAB 1

    September 6, 2008


    Based on the information collected, answer the following questions:

    1) What is the kernel version of Linux on matrix?

    2) What is the IP address and MAC address of the Linux machine on matrix?


    MAC: 00:0E:0C:7F:84:79

    3) What is the network mask on matrix?

    4) What are the network addresses of the Linux machine? (there should be three networks)

    device “eth0” – host – broadcast
    device “lo” – loopback

    5) What is the IP address of the gateway for the Linux machine on matrix?

    6) What is the command to display all the currently loaded kernel modules?

    $ lsmod

    7) Where is the file for the kernel module called “e100”?


    8 ) What is the MAC address for the network device that has the IP address


    9) How do you display all the physically network addresses known by a Linux machine?

    $ arp -a

    10) What is the MAC address of the network device on the Linux machine on matrix ?


    Themes for Firefox

    September 5, 2008

    Make your firefox better using some themes from the site:

    One of the best themes is

    SYA710A – LAB 0

    September 4, 2008

    1. What is your full name?

    Milton Paiva Neto

    2. What is the output in steps 3 and 8?

    Output of Ubuntu

    joker@ubuntu:~$ sudo fdisk -l
    [sudo] password for joker:

    Disk /dev/sda: 10.2 GB, 10200547328 bytes
    255 heads, 63 sectors/track, 1240 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0008edf2

    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1        1181     9486351   83  Linux
    /dev/sda2            1182        1240      473917+  82  Linux swap / Solaris

    Disk /dev/sdb: 62.0 GB, 62014404096 bytes
    255 heads, 63 sectors/track, 7539 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x6ab1bd22

    Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1         609     4891761   83  Linux
    /dev/sdb2             610        1826     9775552+  83  Linux
    /dev/sdb3            1827        3651    14659312+  83  Linux
    /dev/sdb4            3652        7299    29302560   83  Linux

    Output of Fedora 8

    [root@localhost ~]# fdisk -l

    Disk /dev/sda: 10.2 GB, 10200547328 bytes
    255 heads, 63 sectors/track, 1240 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0×00058f46

    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          51      409626   83  Linux
    /dev/sda2              52         688     5116702+  83  Linux
    /dev/sda3             689         752      514080   82  Linux swap / Solaris

    Disk /dev/sdb: 62.0 GB, 62014404096 bytes
    255 heads, 63 sectors/track, 7539 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0×6ab1bd22

    Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1               1         609     4891761   83  Linux
    /dev/sdb2             610        1826     9775552+  83  Linux
    /dev/sdb3            1827        3651    14659312+  83  Linux
    /dev/sdb4            3652        7299    29302560   83  Linux

    Disk /dev/dm-0: 16.1 GB, 16106127360 bytes
    255 heads, 63 sectors/track, 1958 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0×00000000

    Disk /dev/dm-0 doesn’t contain a valid partition table

    3. What is the purpose of the sudo command ?

    “sudo” = Super User Do, it allows you to run a command as a super user when logged as a single user.

    4. What is the purpose of the minus sign (-) when using the su command ?

    It allows you to take the enviroment variables to the selected user.

    5. Explain how you deleted the partition table with fdisk.

    # fdisk /dev/sda

    type option “d”

    Select the partition number: “1”

    Type “w” to write table to disk and exit, then reboot your system.

    6. What is the purpose of the partprobe command ?

    It informs the OS about the modifications on the partition table.

    7. Write the complete mail command you would use to email a copy of lab00 to your LEARN account from MATRIX.

    # mail -s “lab00” < lab00.txt

    8. What is the function of the -s option to the mail command ?

    Add a subject to the message.

    Comments about the technology used in this lab.

    This technology is very nice, because the students became free to do such things in the systems without care about possible damages in the machine. Once the system is rebooted everything is setted up to it’s default configuration.

    What you learned ?

    To use command line tools get informations about the partitions in different operational systems (Ubuntu and Fedora).

    Plugins that you “MUST” have in your Firefox

    September 3, 2008

    Here are some plugins that I really like to use in firefox: