Edit etc\host on windows for remote localhost viewing

For the poor windows users to to my computer C:\Windows\System32\drivers\etc\hosts find file hosts in it and repalce the ip with your ip (of the computer you have your localhost running on. )                   [sourcecode language=”text”]   # Copyright (c) 1993-2009 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a ‘#’ symbol. # # pvosniadis@travelplanet24.com # elmopqvz # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host # localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 192.168.0.59 gr.local 192.168.0.59 pl.local 192.168.0.59 uk.local 192.168.0.59 de.local 192.168.0.59 ua.local   [/sourcecode]

What to do when you got a pop up on your mac and you don’t have a mouse handy…

PROBLEM: “How to control the native popup options on Mac OSX with only the keyboard?”

 

My magic mouse battery died on me ..

and of course the native mac os x message pops up asking me if i “want to save the changes”

 

 

If you need to be able to access that popup screen without a mouse , here is the simplest way to get to it.

Simply go to “System Preferences => Keyboard => Keyboard Shortcuts

 

 

 

Set the radio button to “All controls”

 

 

 

 

Your done

Now you can navigate with the Tab key using space as the executer !

 

 

 

 

Sync Files Outside of Dropbox

 

The popular cross-platform file-syncing application Dropbox is a hit among Lifehacker readers, but it has one major drawback: It only syncs files placed inside the My Dropbox folder. Here’s how to get around that limitation.

In order to sync files and folders that live outside the My Dropbox folder, you need to create a symbolic link between the My Dropbox folder and the folder on your drive that you want to sync. Symbolic links are sort of like shortcuts, so if you had a folder called SyncMe that lived on your desktop, you’d create a symbolic link that made it appear as though SyncMe also lived inside the My Dropbox folder.

This process varies depending on your operating system.

On OS X or Linux, try the following:

Use the ln command, for example:

 ln -s /path/to/desired-folder ~/Dropbox/desired-folder 

This works with files too:

 ln -s /path/to/desired-file ~/Dropbox/desired-file 

Another easy way to do this with Terminal is type the ln -s part, then from Finder drag the folder/file that you want into the Terminal window then drag the Dropbox folder and hit return.

Note that an Alias file or folder does not work.

 

On Windows:

Use either the JUNCTION utility from Sysinternals, or the MKLINK command built in to Windows Vista and Server 2008, for example:

 junction "C:Documents and SettingsUserMy DocumentsMy DropboxDesiredFolder" "C:PathToDesiredFolder"
 mklink /D "C:UsersSteveDocumentsDropboxDesiredFolder" "C:PathToDesiredFolder"

Or, if you prefer a GUI, install Link Shell Extension.

[You could also] use SyncToy to echo changes from another folder to your Dropbox folder. This keeps 2 copies on disk though.

 

http://lifehacker.com/5154698/sync-files-and-folders-outside-your-my-dropbox-folder

 

Extra read:

8 Useful Dropbox Tips & Tricks

http://loneplacebo.com/8-useful-dropbox-tips-tricks/

.bash_profile vs .bashrc

by Josh Staiger

WHEN working with Linux, Unix, and Mac OS X, I always forget which bash config file to edit when I want to set my PATH and other environmental variables for my shell. Should you edit.bash_profile or .bashrc in your home directory?

You can put configurations in either file, and you can create either if it doesn’t exist. But why two different files? What is the difference?

According to the bash man page, .bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.

What is a login or non-login shell?

When you login (type username and password) via console, either sitting at the machine, or remotely via ssh: .bash_profile is executed to configure your shell before the initial command prompt.

But, if you’ve already logged into your machine and open a new terminal window (xterm) inside Gnome or KDE, then .bashrc is executed before the window command prompt. .bashrc is also run when you start a new bash instance by typing /bin/bash in a terminal.

Why two different files?

Say, you’d like to print some lengthy diagnostic information about your machine each time you login (load average, memory usage, current users, etc). You only want to see it on login, so you only want to place this in your .bash_profile. If you put it in your .bashrc, you’d see it every time you open a new terminal window.

Mac OS X — an exception

An exception to the terminal window guidelines is Mac OS X’s Terminal.app, which runs a login shell by default for each new terminal window, calling .bash_profile instead of .bashrc. Other GUI terminal emulators may do the same, but most tend not to.

Recommendation

Most of the time you don’t want to maintain two separate config files for login and non-login shells — when you set a PATH, you want it to apply to both. You can fix this by sourcing .bashrc from your .bash_profilefile, then putting PATH and common settings in .bashrc.
To do this, add the following lines to .bash_profile:

if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
Now when you login to your machine from a console .bashrc will be called.