Setting up a server for home or small business | 2 – SAMBA print server, File Backups, Remote Desktop Connection0
This is the second post about setting up a server for home or small business with SAMBA. If you haven’t seen the 1st post read it here :
Printer sharing with SAMBA
I have already installed HP Deskjet 3920 printer in my server machine and enabled sharing. (Open “Printing” application >> Right click on the printer, see whether sharing is enabled).
As we are giving anonymous access to printers first create a user account for remote print jobs
/usr/sbin/adduser --system --disabled-password smbprint
Then append the following lines to the end of the Global Settings.
printcap name = cups printing = cups
And now we’ll share the printers. Add the following code to the end of the file
[printers] browseable = yes printable = yes public = yes create mode = 0700 guest only = yes use client driver = yes guest account = smbprint path = /home/smbprint
Now your smb.conf file must look like this.
#===============Global Settings=========== [global] workgroup = workgroup server string = DI Server ; netbios name = DI-Server security = share map to guest = bad user dns proxy = no ; encrypt passwords = yes guest ok = yes guest account = di printcap name = cups printing = cups #===============Share Definitions=========== [DI Files] path = /media/sda6/DI-Files browsable = yes writable = yes guest ok = yes read only = no create mask = 0755 [printers] browseable = yes printable = yes public = yes create mode = 0700 guest only = yes use client driver = yes guest account = smbprint path = /home/smbprint
Done! Restart the SAMBA services and check from a windows machine.
sudo restart smbd sudo restart nmbd
So we are done with file printer sharing. Are we really ?
Try restarting the machine and see from the windows machine. Most of the times you won’t see printer there. If you restart SAMBA manually you will see it again. This happens because CUPS service is not started when samba is started while booting.
Fix for the problem “Printer not showing up until I restart SAMBA”
Give the following command.
sudo gedit /etc/init/smbd.conf &
In the smbd.conf file just after pre-start script add the following line
File Synchronization with Unison
To regularly backup the files I’m using Unison. Actually what I hope is getting the files synced from a source to a destination location in a particular time daily.
Get the GUI version installed easily using Ubuntu Software Center.
Open Unison and in the default profile give the source location as Root 1 and destination location as Root 2.
unison –batch default
Here “default” is the name of the profile you created in Unison.
As I want to do the run the file sync at 10AM every day I have set fields in the advanced section as shown in the image.
Setting up Remote Access
You may need to remotely log into this server using a windows machine. For that you can install xrdp.
sudo apt-get install xrdp
(You can find more info on this from this article.)
Now open Remote Desktop Connection in the windows machine connected to the same network and give the hostname or the ip of the server machine.
So now you are almost done! It will be better to clone the drive of Ubuntu installation so you won’t need to do all these things again if ever system crashes. You can use CloneZIlla for that.
Enjoy using SAMBA!
SAMBA for Home or Small Business
First of all what is SAMBA? It’s a free File and Print server which can be used in Linux and UNIX based Oss for file and printer sharing with windows machines.
So now you got the idea. But why use Samba with Ubuntu? First it is free! When configured, works smoothly. Less need of worrying about viruses and many more advantages are there.
Here I’m using Ubuntu 12.04 desktop version in a pc with an Atom processor. The main aim is to setup a server which is only used for file/print sharing + backups. So here I’m not worrying about high end hardware. Also here I’m not considering security issues. File and printers are shared so anyone in the network have access to them.
Auto mounting partitions in Ubuntu
In this machine I have created 4 partitions. First one for OS, second swap space, third for file storage, fourth for file backups. Last 2 partitions are not given mount points. So let’s do something to auto mount them at system startup. For this using pysdm is a good solution. Find how to do this here.
Open a terminal and give the following command to install SAMBA and a gui tool.
sudo apt-get install samba samba-common python-glade2 system-config-samba
File sharing with SAMBA
We can configure either using the GUI tool or editing the smb.config file. Let’s go for the second method. Give the following command in terminal
sudo gedit /etc/samba/smb.conf &
If you wish you may backup this file first. Remove all the current content and add the following to this.
#===============Global Settings=========== [global] workgroup = workgroup server string = DI Server ; netbios name = DI-Server security = share map to guest = bad user dns proxy = no ; encrypt passwords = yes guest ok = yes guest account = di #===============Share Definitions=========== [DI Files] path = /media/sda6/DI-Files browsable = yes writable = yes guest ok = yes read only = no create mask = 0755
In global settings, you may already understand that workgroup is set as “workgroup”. You may change according to the workgroup you use in your network. “netbios name” is the name which you see this server in other machines when shared. Security is set to share. You can set this to user and restrict some access permissions. You may try it later.
Here I’m sharing /media/sda6/DI-Files folder so anyone in the network could have read and write access to that folder.
So you are done. Restart SAMBA services by giving following commands.
sudo restart smbd sudo restart nmbd
Great!!! Try copying files and deleting them.
SAMBA GUI Tool
Adding shares can be done easily using the SAMBA GUI tool as. Search for SAMBA application (system-config-samba) and open it.
Writing a post after several months
You may have come across this problem. Usually when you install Windows 7, if you need to install XP as dual boot you need to bother a bit. Either you can try installing XP into another partition and later repair the boot manager by booting with a Windows 7 DVD and choosing Repair. Or the safe way is to install XP first and then WIndows 7.
However it’s not the case now. Once Windows 7 is installed and you need to completely remove 7 and install XP. You may have done this successfully in some times and some of you may have come across a problem. When you boot with a Windows XP disk you’ll end up with a Blue Screen. So some of you may say “Can’t Install Windows XP to a hard disk which Windows 7 has been installed ” .
Solution is simple. Go to BIOS setup and look for “SATA Configuration”.
There you may see AHCI is selected. There select “ATA” or “IDE”, save and reboot. You are done
Think this may be helpful for you all someday.
Check the following links for more info :
If you don’t know yet, OpenCV is a free library for image processing and computer vision applications. You can find more info from their web site.
So why QT ?
OpenCV can be used mainly in programs written in C and C++ (not only that, there are so many wrappers which enables you to work with OpenCV in other languages too). So talking about C++ why not using Visual C++ ?? Of course you can easily design GUIs. But why QT ?
QT is an C++ IDE which can be used to create gui applications easily. Find more info here.
The main advantage in using QT is that we can easily “integrate” the GUIs of OpenCV inside the GUIs created with QT.( Correct me if I’m wrong) What it means is that, It is hard to insert a video window inside a form created with C#. If you are using Visual Studio the window will open seperately to display the video. Think you got the point. Do some research, you’ll find the importance.
So let’s go to the topic..
Installing and configuring QT to work with OpenCV in Windows
FIrst we need to download and install the complete QT SDK. Download it here and get it installed. ( I have installed Qt SDK version 1.1.4 which includes the QT Creator IDE version 2.3 into the folder “C:\\QtSDK”)
Install CMake. Download it here. (I used CMake 2.8.2)
Download OpenCV-2.2.0-win.zip and extract it to a folder (In my case it is C:\\OpenCV2.2 ). I’m using the version 2.2 here. Newer versions also can be used in the same way i describe here with minor changes.
Now we need to comiple the OpenCV libraries. Run the CMake GUI.
Now give the source folder ( Mine is C:\\OpenCV2.2) and create a folder for the binaries to be build (my case it is C:\\OpenCV2.2MinGw ) and give the path to the “Where to build binaries” box.
Now press configure. Select the generator as MinGW Makefiles.
And select Use default native compilers and press finish.
Wait some time and you’ll get a configuration screen.
Set “DEBUG;RELEASE” for CMAKE_BUILD_TYPE.
If you like you can check the box for BUILD_EXAMPLES, so you can play with the examples
Now press configure again.
Now you’ll see a similar window to the last one and it asks for the path of qmake.exe. You need to puth the path to the qmake.exe here.
For me it is
Press configure again.
Now press Generate, so it will try to generate the makefiles.
“Missing libgmp-10.dll” problem
Most probably you’ll get a message saying that missing libgmp-10.dll is missing. Solution is simple just add the bin folder of MinGW to the System Path variable
( My Computer -> View System Information -> Advanced -> Environment Variables -> System Variables -> Path -. Edit (or New) )
In my case this path is
Now you are ready to proceed. Press generate button of the CMake window again.
Now you’ll get the required files in the folder which you gave as build folder above. Now we need to compile these files with MinGW.
Open Command Prompt and change your directory to the build folder
Now give the command
Have a nap because it takes some time for this process to complete
After completion of step 9 give the command
You are DONE!
Playing with QT : Check whether everything is working fine..
Download this. Double Click and open the Sanj.pro file. It will be opened with QT Creator.
In the Sanj.pro file change the paths “INCLUDEPATH” and “LIBS”, if you used paths other than the ones I used.
Now run the project. Enjoy using QT
Good books I have come across :
- For OpenCV with QT : OpenCV 2 Computer Vision Application Programming Cookbook book (Packt Publishers) (This is where I took the above simple example)
- For learning OpenCV : Learning OpenCV – O’Reilly Media
You may have come across this problem. When you add the availability information in the backend for a product, in the frontened the availability image will be displayed with a phrase “Usually ships in” which you may not need.
Let’s see how to solve this. (I’m using Virtuemart 1.9 package. For older versions also similar method may apply).
This is what you get normally.
Now let’s try to remove this “Usually ships in” phrase.
Find the “english.php” file in “/administrator/components/com_virtuemart/languages/common/” folder.
Then find “Usually ships in” phrase there. Around line 362 you’ll find the line
'PHPSHOP_DELIVERY_TIME' => 'Usually ships in',
Replace it with
'PHPSHOP_DELIVERY_TIME' => '',
Now save and check the flypage in the frontend. You’ll get something like this.
Now you’ll see that the “Usually Ships in” phrase is removed. But a colon is seen there. Let’s try to remove it.
Find “availability.tpl.php” file in the “components/com_virtuemart/themes/default/templates/common/” folder. (here “default” is your virtuemart theme’s name if you are using one other than the default)
There search for “PHPSHOP_DELIVERY_TIME” ( Think you understand why we are searching for this phrase.)
In around line 36 you’ll see this line
<!--?php echo $VM_LANG--->_('PHPSHOP_DELIVERY_TIME') ?>:
There remove the colon “:”. So the new line must be
<!--?php echo $VM_LANG--->_('PHPSHOP_DELIVERY_TIME') ?>
See the frontend. You are done.
You’ll get something like this nowGoogle+
Note: You can view this also in CompSoc.lk web site.
You may have heard the word “CMS” several times. Do you wonder what a CMS is …? Well it Content Management System is presented in the abbreviation CMS. Whatever it is, what does it do really?
Also have you ever think of how large sites manage their content? News sites like adaderana.lk, dailymirror.lk needs to be updated so often. If you are a person who only knows about web designing with HTML you may have wondered how these people manage their sites. Because editing html files and updating them in the server is not a much easy task. You need to edit the page locally and then update the remote server. Managing huge amount of content is not an easy task in this way.
Just imagine about a business. Most probably the business owner or managing director is a non-tech guy. Even though they have a web site it is difficult to update the site as needed. Think the manager needs to update the site with an immediate notice. What does he have to do? He contacts the web designing company and says his requirement. Then he may email the required content and after some time the site will be updated by the designing company. This takes much time and even cost much too. What if this non-tech guy have the chance of updating the site quickly?
Also we may add several types of content to the web site. We may add photos, audio, video and so on. Also we may need to provide a facility of user registraion, logging in and displaying user specific content. How about coding from the scratch ?
For all these problems the solution is Content Management Systems which we call CMSs in short. So what is a CMS? What do they do ?
In simple terms : CMS is a system that manages content. Telling it in a descriptive manner,
“A CMS is a tool that enables a variety of technical and non technical staff to create, edit, manage and finally publish a variety of content (such as text, graphics, video, documents etc), whilst being constrained by a centralized set of rules, process and workflows that ensure coherent, validated electronic content….”
Watch this video so you’ll understand well……
So now you know what a CMS is. There are several types of CMSs.
- Enterprise content management systems
- Web content management systems
- Web group content management systems
- Component content management system
- Here we are going to discuss about the web content management systems. For others as well just look for this wikipedia article.
So what are the available CMSs ?
There are so many CMSs for different tasks. Joomla, Drupal, WordPress, DotNetNuke, phpNuke are some of the popular CMSs. You can see a huge list here.
We wil start discussing about Web Designing with Joomla in the next articles.
How do they really work?
These CMSs are web applications. Written in a server programming language like php. So we’ll install them in the server and they will work like a software where we can continue developing the site.
Installing a software in the server? Oops
No no .. no need to fear. It’s not in the type u think of. Not much difficult. We’ll continue learning about Joomla in the next articles. So you would get a good knowledge and will be able to create a working web 2.0 site in minutes.
Comments are welcome!Google+
Here you can find some information about how to work with files when using an SVN
Now the installation is completed and so you need to import files from a remote SVN host. Go to File>> Import. There select SVN >>Checkout projects from SVN.
And select create a new repository location. There you can add the svn url. ( In assembla you can find this URL in Source/SVN page). After that it will show the file structure in the remote host. Select the folder to be checked out from the SVN.
After pressing next you’ll get a window for a New Project which you are already familiar. So you can create a new project in workspace or at an existing location. If you are developing a component for a web application like Joomla you can select exact folder for that component in a local Joomla installation. OK now you are ready to go. Files will be downloaded from the server and you can continue on editing those files. Once edited you can submit the file to the server by right clicking on a file in the Explorer in the left (For me it’s the PHP explorer).
Here when you go to Team you’ll see several items. If you use Commit your file will be uploaded overwriting the file in the server(be careful ). Merge will merge your file with the one in the server. (Assembla will mail all team members about the changes in the files). So find out what those commands mean and use them according to the need. So now you are ready to work with your team .Google+
When we are developing a software with the collaboration of several members we need a way of sharing the code files, software versioning and revision control. We can use a Subversion system for this. SVN is one. See more information about svn here.
We can get a free host to host our files. Assembla is one which gives free services as well as paid ones.
So now we need a client software to work with an SVN. One popular software is TortoiseSVN. It’s a great software that can be used very easily.
If you are using Eclipse as your development IDE it is easy to work with an SVN. We need to install Subversion to the eclipse IDE.
Let’s get it installed.
( The screenshots below are taken using the “Eclipse for PHP Developers” Version: Helios Service Release 1)
First go to Help>>Install New Software
In the window you see next Click “Add” for in the right top corner.
You’ll get a window to Add a Repository. There add http://subclipse.tigris.org/update_1.6.x as the Location and press OK.
After a while you will be provided with a list. Check them as shown below and press next.
It will now take some time and show you a list of items to be installed. Press next and it will download the necessary files and install.
You’ll need to restart Eclipse after installation.
How to import Files ?Google+
From time to time we engage in different types of societies, and mingle with different types of people. At school time we get together with our fellow students in societies there. Some people get the chance of participating in clubs, societies in their neighborhood.
Each of these gives us one valuable thing; a unique experience which we won’t get from any other activity. We learn to live and learn to how to behave.
At university stage also most of us get a similar opportunity through faculty or university societies. But we rarely get the chance of interacting with people from other institutions. But if the community is open for several universities, the members can work with others too.
One such community is the Microsoft Student Champs, which is the largest, active undergraduate community in Sri Lanka. For people who don’t know what’s happening inside the Champs community: Champs get together mainly at monthly meetings and share their knowledge. Techies from industry come and share their knowledge with students. Technical workshops are conducted all over the country. Not just the technical knowledge and experience, Champs get the chance of learning other things like soft skills development and lot more. This is just a very brief introduction on few things happen inside the community. Even if you aren’t a champ yet, you may now know a bit what it is.
So then what’s Champs Networking Month? It’s all about getting together with several communities, societies.
Most universities and institutions have clubs and societies for their own students. If these societies get connected with the Champs community it will benefit all parties and increase the collaboration between students of different universities. Also a champ will find it easy to do something for their institution.
Two good examples from my experience are the Dot Net Workshop at UCSC and the last years distribution of Microsoft’s software among undergraduates.
We found that the collaboration with the CompSoc (Computer Science Society of University of Colombo) was very fruitful on those events. Combined effort of Champs and CompSoc made the Dot Net Workshop end very successfully.
Also I remember how the Microsoft’s “Software for 21st Century” program was delivered at UCSC last year successfully with the help of CompSoc.
Networking with Champs is a win-win situation. All will get lots of benefits.
So why think twice? Get Networked!Google+