Howdy. Welcome to our webdesign blog!

Thanks for dropping by! Please make yourself at home by leaving comments and subscribing to the RSS feed to stay updated.

  • Categories:

  • Blogroll

  • Archives:
  • Connect Windows (vista or 7) to a linux share – Ubuntu

    February 25, 2010

    Have you ever thought it would be great to have a linux dropbox to share files from computer to computer in your network? Well, I did and found it was a bit difficult to set up right off the bat!

    Sharing Folders on Ubuntu Linux

    Before you share any folders, you will need to do a little setup on ubuntu. After some digging, I found the following blog that explains this setup.

    http://www.goitexpert.com/general/connect-vista-to-a-linux-share–ubuntu/

    The blog article goes on to say that there are two things that need to be done. First make sure your samba version is 3.0.22 or higher. Second you need to give samba a username and password. This will be the username and password that windows will use to connect to the share.

    1.  
    2. sudo smbpasswd -a username
    3.  

    Once you have samba upgraded and configured a username and password, you can start sharing folders and files. To Share folders or files, you need to right click on the item and go to sharing options. Then enable sharing.

    Connecting to the Share via Windows Vista or Windows 7

    In windows you need to go to your network. If your lucky, it will show up in the list of servers, but you will probably have to plug the local alias or local ip into the address bar.

    1. \\server-name
    2.  

    or
    1.  
    2. \\192.168.1.#
    3.  

    Windows should now bring up a login window. I don’t know if it matters about the host in this login prompt, but I didn’t bother taking chances. I entered my username as

    server-name\username

    And voila, you can now access your linux shared folder. Amazing!

    Debug javascript without alerts through the Firebug console

    February 14, 2010

    If you are a javascript developer at all, most likely you have had to debug your code with an alert box. This can be horribly annoying when trying to detect line numbers or when working with periodical functions. This is where the Firebug console can be super handy

    I have taken my information for this post from David Walsh’s blog (because it is a great ref for mootools, and because his posts are always helpful).

    Getting Started

    First off, you are gonna need firefox and a little plugin called firebug. I personally enjoy the web developer toolbar for firefox as well. Now you should have these up and running.

    To start out, you will need to open firebug by clicking on the little bug icon at the bottom right corner of firefox.

    Now click the arrow next to “console” and click “enable”. You can enable different features of firebug for different domains.

    Lastly, go to your site where you have written some javascript.

    Hello World meet Hello Console

    Now, it’s time to write some basic debug javascript. A list of console commands can be found on David Walsh’s blog, here:

    http://davidwalsh.name/firebug-console-log

    here is a basic “hello world” type of example of the firebug console:

    1. console.log('hello console');
    2.  

    now refresh your page to run that javascript, and say hello to firebug console. Now close your console and refresh the page again, or try to run the page in IE. You get a javascript error, and your browser throws a temper tantrum. Next, I will show you a little fix for this. I want to make a major note that I do NOT condone leaving debug code in your javascript, but the next section will allow you to sniff for firebug and for the console.

    Sniff out firebug and it’s console friend

    As stated on Walsh’s blog, some site get bogged down under firebug because of many ajax requests. Or you might want to just run your site on IE real quick without removing your debug console code. Well, Walsh comes to the rescue again with some awesome snippets found here:

    http://davidwalsh.name/how-to-sniff-firebug-disable

    1. if (! ('console' in window) || !('firebug' in console)) {
    2.  var names = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml',
    3. 'group', 'groupEnd', 'time', 'timeEnd', 'count', 'trace', 'profile', 'profileEnd'];
    4.  window.console = {};
    5. for (var i = 0; i < names.length; ++i) window.console[names[i]] = function() {};
    6. }
    7.