How to Share files in Linux?
In order to share files in Linux, you need to have following installed in your system.
If it is not installed, first install it.
sudo apt-get install samba
Once the server is install, issue the following command:
sudo gedit /etc/samba/smb.conf
Make the following changes:
workgroup = WORKGROUP
underneath it, add
netbios name = name_of_your_server (no spaces)
netbios name = pintu_smb_server
Make sure “security” is set to “user”.
Scroll down until you see “[homes]”, set:
browseable = yes
writable = yes
Then save the changes.
Finally, create a SMB user, make sure this account exists on your Ubuntu Linux.
sudo smbpasswd -a `whoami`
and set your password
There are two ways to access it:
- My network places > Entire Network > My Windows Network > Workgroup
- In the address type in “\\[whatever you named the Samba server]”. From my example above, I used “\\pintu_smb_server\“.
You should see a folder call “homes”, click on it, and it will ask you for your username and password. Enter your Ubuntu Login Name and whatever you choose for the password when you used command “smbpasswd”.
Keep in mind that you are sharing, /home/[login name]/*
You want to install Linux ( Mint/Ubuntu or any other) OS in your old PC but the DVD drive is not working.
Don’t worry you can do it assuming that you can boot into your windows OS and have broadband Internet connection with sufficient disk space.
1. Download the Mint iso installer file
2. Download Virtual Clone drive
3. Install virtual clone drive on your system
5. Open the iso file and Mount it. If your clone drive is associated with the ISO extention then double clicking on the iso file will automatically mount.
6. Now you have virtual DVD drive with Linux DVD mounted.
7. You can now perform all the steps as it is done when installing from physical drive.
As a software tester, knowledge of basic Linux commands is a necessary. Before going in to details commands we should be aware of some of the facts of Linux OS.
- You can do almost anything in a terminal which you can also do from GUI
- Most command was first designed to work in the terminal then GUI was put on top. Hence some of the GUI is not well designed and may be buggy.
- Your current directory or folder(for windows users terminology) can be noted by the . operator. Most commands when they act on the current folder selection operate on .
- Commands, locations and files are case sensitive. /home is not same as /Home or /HOME
- Use the tab key to complete file names. If you have a long driver titled, for example,
- driver-128947232jaseu.sh, simply type dri and it will fill in the rest, provided you don’t have 2 names starting with “dri” and if you do, add another character to make it “driv” and try again.
- Almost any command can be read about in full using the manpage or by typing -h or –help after writing the initial command. This syntax is either man command_name, command_name -h, orcommand_name –help.
- Almost any command can also explicitly display what is happening. This is done usually by the -v or–verbose
BASIC LINUX COMMANDS
1. cd –> Used to navigate the directories. You can move to any location by path.
- cd This will move you back to your home, same as cd ~
- cd .. This will take you back exactly one directory. Starting in /home/xxx/Desktop, cd .. will put me into /home/xxx. This can be expanded upon, cd ../../ from the Desktop location instead will move me 2 back, from my Desktop to /home.
- cd foldername/ This will move you forward to the given folder in your current folder. Take note of the missing prefix / it is an important omission. if I am in /home/xxx and I want to get to Desktop, I must type cd Desktop/ without the / before Desktop. Typing / before it places us in the root of file system, which is incorrect.
- cd /some/other/path This will take you to the specified folder path, supposing it exists as typed exactly. Don’t forget your tab completion!
2. ls –> Used to list folder contents. You can view many kinds of file and folder attributes.
- ls By itself, ls will simply list all your files in the current folder.
- ls -l Provides a longer listing format including owners, permissions, size, and date modified.
- ls -a Displays hidden files and folders as well as the normal listing.
- ls -al Combine options to display both hidden files and in the long format.
- ls -h Show file sizes in human readable format (K, M, Gbyte) filesizes instead of bytes. Often used in conjuction with the -l flag.
- You can view files in directories you are not even in. If I am in /home/justin/Desktop, and I want to view a file in /home/justin, I can do ls ../ list files one directory back (and not have to go back to do so.)
3. cp –> copy files
- cp file /path/to/folder Copies specified file to the given path.
- cp -r folder /path/to/folder Copies recursively the contents of the folder to another folder.
- cp *.extension /path/to/folder Copies files matching the given extension to the new folder. To copy all .doc files, it becomes cp *.doc /path/to/folder and the folder must exis.
- cp name* /path/to/folder Copies all files starting with ‘name’ to the given folder. To copy all files starting with example, it becomes cp example* /path/to/folder and the folder must exist.
4. mv –> move files
5. rm –> Remove files
- rm file Remove the specified file from the system.
- rm -r folder Remove the specified folder from the system
- rm -rf folder Removes the specified folder forcefully from the system. This command can severely break your configuration if used incorrectly as it will not prompt you if something critical is being deleted. If you have to use this, chances are something more is broken or there was a mistake made. This should only be used as an absolute last resort method and is not recommended.
Removing files via rm is permanent. It does not use the Trash bin. Use with caution and make sure you are deleting explicitly what you want, not what you think you want.
6. mkdir –> Make directories
- mkdir folder_name Creates the folder with the specified name
- mkdir -p /path/to/folder/name Creates each folder as necessary. To create folder /home/xxx/newfolder/2ndfolder, and only /home/xxx exists, using mkdir -p will make both directories newfolder and 2ndfolder.
7. ps –> List Processes
8. kill / killall / xkill –> Kill offending processes.
- kill PID PID is a process id number number of the process which need to be killed. One should obtain the PID from a command like ps. If a process refuses to die, one can alternatively specify kill -9 PID which should terminate the process forcefully.
- killall program Killall kills *by name* all instances of said program. If there are for example 3 firefox sessions open, killall firefox will do just that; kill all firefox sessions.
- xkill is a GUI way to click and kill windows. Typing in xkill should present a skull-and-crossbones icon, and the next window clicked on will be killed.
9. Pipes (|) –> Redirecting output of a program to another program.
Pipes takes output from one program and route it to be used as input of another program. example- who | wc -l or ps aux | wc -l
10. > and >> redirectors –> Se nd output to a file instead of terminal
> is used to overwrite currently existing file and >> is used to append information to the file
Example: ls -l > file1 or ls -l >> file2
11. sudo execute commands with root rights
Some TIPS in using Linux
- Appending new path to PATH variable.
- Lost yourself in a directory?
Type pwd to print working directory
- Want to calculate your disk space quickly?
df -h can give you a quick checkup
- Want to calculate the size of a folder or file quickly?
du -cksh target_name can do exactly that.
- Want to calculate the size of the current folder?
- Need to mark a file executable?
chmod +x filename can do that. To give all permission use chmod 777 filename.
Although Linux is a really stable platform, there will be some times that a program will freeze. In those cases most people are stuck on what to do.
Generally you have two choices for closing a stuck program:
Continue reading “Linux Tips – How to close a program that has frozen”
No Sound from Ubuntu linux or Mint
Searched google for possible answer to the problem but solution mentioned was not sufficient to solve my issues. I wasted couple of weekends resolving this issue.Finally I solved by removing PulseAudio and ALSA packages and installing OSS(Open Sound System)
What is OSS?
OSS provides low -level audio drivers for users and a common API(application program interface) for developers. Unbutu and Mint by default uses ALSA ( Advanced Linux Sound Architecture) to provide audio drivers.
Does OSS support my hardware?
Check the list of supported hardware from the below link.
Preparing to install OSS
1. REMOVE Pulseaudio packages
sudo apt-get purge pulseaudio gstreamer0.10-pulseaudio
2. Removing ALSA packages
sudo /etc/init.d/alsa-utils stop
sudo apt-get remove alsa-base alsa-utils
3. Blacklisting ALSA Kernel Modules
sudo dpkg-reconfigure linux-sound-base
4. Installing Prerequisite Packages
The second command contains some recommended packages.
sudo apt-get install -y binutils libgtk2.0-0 sed gcc libc6
sudo apt-get install -y libesd0 libsdl1.2debian-oss
1. Installing from DEB File
Download the OSS deb file from the 4front website(http://www.opensound.com/download.cgi). Before you install OSS, Reboot your system so that the ALSA modules will not load or interfere with it. When you log back in, use the terminal to install the OSS deb file (GDebi fails to install this .deb for some reason)
sudo dpkg -i oss-linux*.deb
Configuring Applications to Use OSS
Type ossxmix in your terminal to launch the mixer.
YOU ARE DONE
“I have not failed. I’ve just found 10,000 ways that won’t work” –Thomas Edison