Wednesday, August 7, 2013

Fast apt-get with apt-fast

Ever experience slow download even with 10Mbps++ internet? The author has written a very useful article to share how to speed everything up with apt-fast:

[Linux] file_mode, dir_mode or permission not working correctly in Samba Share or Mount folder

Users permission in Linux is really complicated, for samba share, you need to take care:

  1. the folder permission of the parents folder where your samba share is located (at server side)
  2. the folder permission of the parents folder where your fstab mounted folder is located
  3. the create mask and directory mask in /etc/samba/smb.conf on your server
  4. the file_mode, directory_mode, nopermrw and credentials in your /etc/fstab on client PC
General rules are parent folders permission will always overwrite the smb.conf & fstab

When do I need to check the parents folder permission?
  1. If you have set everything in both files and still cannot get the correct permission for new created file/directory in your samba shares. Check client PCs mount folder's parent's permission
  2. If client PCs has problem access the samba shares, even with the correct username & password entered. Check server samba share parent's folder permission
  3. When you need valid users = xxx, xxx to give access to client PCs. Check server samba share parent's folder permission
I have set the samba/fstab/parent folder permission, but I still don't have write permission?
  1. you need to add uid=***your current user name*** at the fstab mount option.
Known Issue
  1. When creating file/directory in the mount folder (using Ubuntu 12.10), it does not honor the create mask & directory mask set by the server's smb.conf. I'm still looking for a solution... appreciate if anyone can help.

Saturday, August 3, 2013

[Ubuntu] Can access samba network share by IP but not Netbios name from Windows

After whole long day of troubleshooting why we cannot resolve samba shared folders using the NetBIOS Name defined in smb.conf.. finally I have figured out the root of the problem:
Hostname CANNOT equal to NetBIOS name!!!
A bit of background...

  1. our server hostname is server1
  2. our NetBIOS name is server1 (defined in smb.conf)
  3. IP-address is

From Windows 7 / OSX we can access the samba shares using \\\share, as well as \\server1.local\share (the .local is a result of running avahi-daemon). We can also ping or server1 or server1.local, but we simply cannot access with \\server1\share

By changing the Hostname in /etc/hosts & /etc/hostname to any name other than "server1", or change the NetBIOS name in smb.conf to any other name, we can now get it work.

This is rather weird for a Windows user like me, where only hostname need to be set and we can access directly from other PC in the network without bothering what is NetBIOS. Linux is indeed too tricky!

Anyway, kind of fun when able to figure out what's wrong. It makes me love and hate Linux at the same moment!

[Ubuntu] Can ping internet IP address but cannot resolve web address

If you got error when trying to ping any web address e.g., but can ping its IP address, there could be something wrong with the resolv.conf.

Despite you could have set the dns-nameservers in /etc/network/interfaces, the resolv.conf may not be updated yet. And if you have some running process and could not do ifdown / ifup, you can do nano /etc/resolv.conf, comment the original nameserver to nameserver (or the DNS provided by your ISP).

Ubuntu should now resolve the web address correctly!