Friday, July 30, 2010

Project - Samba: Configuration

1 Ubuntu part
1.1 Install Samba package
$sudo apt-get install samba

1.2 Configure Samba
Stop Samba
$sudo smbd stop
NOTE: If this does not work, simply replace "smbd" with "/etc/init.d/samba".

Rename and save the deault configuration file.Open an empty file for new configuration.
$sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.template
$sudo touch /etc/samba/smb.conf
$sudo gedit /etc/samba/smb.conf

Edit Samba configuration file smb.conf
[GLOBAL]
[global]
    netbios name = TEST-SAMBA
    server string =
    workgroup = china.messefrankfurt.com
    announce version = 5.0
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
    interfaces = lo, eth0
    bind interfaces only = true
    passdb backend = tdbsam
    security = user
    null passwords = true
    username map = /etc/samba/smbusers
    name resolve order = hosts wins bcast
    wins support = yes
    printing = CUPS
    printcap name = CUPS
    syslog = 1
    syslog only = yes

1. netbios name : domain name which is the same as configured in Windows.
2. wins support : If your box doesn't have a static ip-address, or you cannot configure your router/server to provide you with a fixed dhcp-lease, change this configuration parameter to "no". In this case you cannot use the benefits of WINS.
3. interfaces : To allow only wired network to have access and that the network card is called eth0.


[HOMES]
NOTE: If you need access to the user home directories, uncomment the lines below and adjust the settings to your hearts content.
;[homes]
    ;valid users = %S
    ;create mode = 0600
    ;directory mode = 0755
    ;browseable = no
    ;read only = no
    ;veto files = /*.{*}/.*/mail/bin/

[NETLOGON]
NOTE: Only needed if you run samba as a primary domain controller.
Not needed as this config doesn't cover that matter.
;[netlogon]
    ;path = /var/lib/samba/netlogon
    ;admin users = Administrator
    ;valid users = %U
    ;read only = no

[PROFILES]
NOTE: only needed if you're running a primary domain controller.
;[Profiles]
    ;path = /var/lib/samba/profiles
    ;valid users = %U
    ;create mode = 0600
    ;directory mode = 0700
    ;writeable = yes
    ;browseable = no

[DVD-ROM Drive]
Uncomment if you need to share your CD-/DVD-ROM Drive.
;[DVD-ROM Drive]
    ;path = /media/cdrom
    ;browseable = yes
    ;read only = yes
    ;guest ok = yes

printers sharing
NOTE: Inside this place you may build a printer driver repository for Windows.
[print$]
    path = /var/lib/samba/printers
    browseable = yes
    guest ok = yes
    read only = yes
    write list = root
    create mask = 0777
    directory mask = 0775
[printers]
    path = /tmp
    printable = yes
    guest ok = yes
    browseable = no

files sharing
This is the name of the share. Leave it as it is or adjust it to whatever you prefer. Don't use more than 31 characters and try to avoid spaces!
[MyFiles]
    path = /home/samba/
    browseable = yes
    read only = no
    guest ok = no
    create mask = 0777
    directory mask = 0755
This suggests that you've mounted an hard drive or partition on /home/samba/ where all the shared files will be stored.
In case you don't have an extra hard drive/partition you may also create folder.


To create the folder.
$sudo mkdir /home/samba
Set permission for the share folder.
$sudo chmod 0777 /home/samba
Start Samba.
$sudo smbd start

Add user and set password.
Enable user account.
NOTE: create Ubuntu account first before using the account as Samba account.
$sudo useradd -s /bin/true riverliu
$sudo smbpasswd -L -a riverliu
$sudo smbpasswd -L -e riverliu

2 Windows part
2.1 Change network settings
- Click "START"
- Click "Control Panel"
- Click "Network Connections"
- Find your "LAN Connection"
- Right-click the icon and select "Properties"
- Select the "TCP/IP" Protocol and click the "Properties" button
- Click "Advanced"
- Select the third Tab entitled "WINS"
- Click "Add"
- Type in the ip-address of your Linux box
- Click "Add"
- Select "Use NetBIOS over TCP/IP"
- Click "OK"
- Click "OK"
- Click "OK"
- Reboot Windows

Upon reboot you may now map the network drive within Windows.
With WINS enabled:
- Click "START"
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\\MyFiles
NOTE: Adjust this to the hostname and sharename you chose above!
- Click "Finish"

With WINS disabled:
- Click "START"
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\\MyFiles
NOTE: To find out the ip-address of your Linux box type "ifconfig" inside a terminal and find the ip for the correct interface (i.e. eth0). Don't forget to adjust the sharename to the name you chose above.
- Click "Finish"

3 Permission
The solution of assign proper permission on specific file/directory is the same as Linux, with the use of command chown, chgrp, chmod.

change files/folders ownership.
$sudo chown -R system_username /directory

change files/folders group ownership.
$sudo chgrp -R system_groupname /directory

change permission.
$sudo chmod -R system_groupname 0700 /directory
The format of permission setting is: dugo = drwxrwxrwx.

NOTE:
1. To use windows authorization, make sue the following setting are confirmed for the specific Samba user:
    - set the Samba-username as Windows-username
    - set the Samba-password as Windows-password

2. Remember to restart Samba after modification of smb.conf More ...

Thursday, July 29, 2010

Project - Samba

Reference > 

Here are some reference I reviewed for this project:

More ...

Wednesday, July 28, 2010

New Task - Programming: Printer/Server Monitoring

Printers and servers may occasionally shut down due to hardware or other issues.And the connection problem will not be aware until users' reporting. That is the reason for me to be asked to develop such a program to monitor the real-time states of the printers and servers.


Design > 

  • ping in loop
  • time interval for testing = 30 min
  • output report in txt or GUI or HTML
 
More ...

Tuesday, July 27, 2010

New Task - Flash Player: Detecting version information

Adobe Flash Player need to be updated to the latest version for IE,  FireFox, Chrome, Opera and other browsers, in order to display Flash movies. However, in most cast the Flash Player add-in can not be installed due to privilege issue. And basically it is not easy to find out the version of Flash Player installed.

Latest version: 10.1


Pre >

According to Adobe's documents, there are two official methods for FP version detection:

  1. with a Flash movie in Adobe website - Find Flash Player version
  2. with ActionScript - Detecting Flash Player version information with $version

Proposal >

I wish to find a method to detect FP version remotely. The following task will be done:
  • study ActionScript

BTW, to install FP on IE, the later should be run as administrator.

Refernces >

Log > 29/7/2010
  • Shockwave Flash vs. Flash Player 
There is no entry named "Flah Player 10.1" in browser -> Tools | Add-ons | Plugins. Instead, there is a entry called "Shockwave Flash 10.1.53.64".

If the "Shockwave Flash" is Disable, flash movies will not be display. The Flash video demo on Adobe Flash Player official website will show a message "To view this experience, you need ... the latest Adobe Flash Player installed."
Alternatively, if the "Shockwave Flash" is Enable, the Flash video demo on Adobe Flash Player official website will display as normal.

It is possible to detect Plugin version information with JavaScript (+VB).
See Reference > Browse plugin information - Plugin detection: a webpage to detect plugin information.


Problem >
  • How to perform Flash Player plugin for several PC with or withour Internet connection?
Solution >

To access the Adobe plugin standalone installers, you must agree to the licensing agreement and register with Adobe using an email address. More ...

New Project - Samba

Task 1 : Samba study
Review Samba documents to

  • understand  file system and security issues, and
  • understand main features and functions of Samba

Task 2:  Discussion with group More ...

Monday, July 26, 2010

Project Introduction - InfoCollector

The project of InfoCollector is built to collect information like installed printer sand software from workstations in an enterprise domain. The designer of this project is River Liu from Messe Frankfurt Hong Kong Ltd. The predecessor of InfoCollector is a small program PrinterChecker / SoftwareChecker I wrote earilier in June 2010. The later was used to scan and check installed printerss in each computer in a given domain. I wish to enhence its functionalities and flexibility to build a more powerful tool to collect information. That is the original idea of InfoCollector.

For more information, please refer to InfoCollector. More ...

Biweekly Report - Report 4

week 7 – week 8 (12/7 – 23/7)

1. Things I did:

At the beginning of the first week, I continued to work on DeviceLock’s centrol control. After that, I prepared a document to describe the installation and functionality, such as monitoring, verifying and reporting, of DeviceLock’s control-controlling server. Then I started to develop a program with AutoIT and C# to collect the software and printer information from all computers in the domain.

In the second week, I began with GUI development for the program I created for information collection. Then I performed disk expanding for all computers with the system drive less than 4 GB. In the meanwhile, I also did some desktop support work like printer installation and anti-virus system deployment for colleagues.

Lot of problems showed up when I was considering the details to perform the task of information collection. One is the privilege denied caused by the security mechanism of Vista and Windows 7 operating system when I tried to retrieve information from registry. Another problem is time consuming of pinging and connecting to each computer one by one. There were many other run-time problems due to the changeable environment. I optimized the algorithm and developed a “switch user” function to gain administration privilege, and also I added multi-thread function to shorten the processing duration.

2. Things I learnt

Technically, I learnt a lot about windows scripting and command in order to use AutoIT efficiently as a windows scripting language. Also I learnt more about registry to retrieve information from it directly. Moreover I tried to optimize the algorithm to achieve best performance of the program.

3. Expectations

I wish to continue the project of information collection. I will focus on graphic user interface design, and also enhance its flexibility and functionality. I wish this program could help company’s technical supports.

More ...

Weekly Report - Week 8

19 Jul 2010 – 23 Jul 2010 

1. Actual work done

In this week, I began with GUI development for the program I created for information collection. Then I performed disk expanding for all computers with the system drive less than 4 GB. In the meanwhile, I also did some desktop support work like printer installation and anti-virus system deployment for colleagues.

2. Technical involvement

I learnt more about windows scripting, like GUI design and interaction mode, registry-related functions, etc, in order to use AutoIT efficiently as a windows scripting tool.

More ...