I was super excited to pick up ReadyNas on black friday but the joy quickly ended when I tried to set up my Time Machine backup.

The problem I was having did not let my Mac’s TM see the Nas on my network. I was tired of googling the problem because no one provided a clear answer except to “Connect Directly”. I then decided to try and search for “ReadyNas Time Machine and Fios” and walla. The problem seems to originate from the router’s IGMP Proxy and its Host Multicast Filtering. I enabled IGMP on the NAS’s IP and all was magic after that. 

Router -> Advanced -> IGMP Proxy -> Host Multicast Filtering -> Edit Nas IP and enable IGMP Allowed

After hours of looking for a way to share an attached USB with Windows, without passwords, I found this: http://elinux.org/R-Pi_NAS#Configure_a_public_storage_area_on_the_RPi

Although the tutorial looks good, I ended up with a variation from other tutorials, of which I can’t find the links for.

The idea is almost the same but my /etc/fstab looks like this:

UUID=5D42-JB31 /home/pi/usb32gb vfat    defaults,rw,user,uid=1000,umask=000  0  0

and my /etc/samba/smb.conf addition looks like this:

[usbstick]
comment = USB Share
path = /home/pi/usb32gb
guest ok = yes
read only = no
browseable = yes

I also changed the workgroup setting to “HOME” for windows 7:

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = HOME

Remember this?

Remember this?

STEP 1: Web Server - Code Repo

For this example, I’ll use a fictitious blog web site… blog.git

cd ~
mkdir code
cd code
mkdir blog.git
git init --bare blog.git

STEP 2: Web Server - Live Site Folder

Assuming that the path for our live site is /var/www/html/blog

cd /var/www/html
git clone ~/code/blog.git blog

# now protect the .git folder from public viewers
cd blog
chmod -R og-rx .git

STEP 3: Create a Local SSH Alias to the Web Server

In order to simplify deployments, I’ll set up an SSH alias that points to a particular private key for my SSH connection to the web server. This allows us to do Git pushes/commits without having to enter the server’s username/password.

Create an empty, or append to the, config file in your user’s .ssh folder .ssh/config and paste the following text. Update IdentityFile with the correct path to your private key. This example uses / in a windows enironment under MINGW32 (Git Bash).

Host webserver
HostName webserver.com
User username
IdentityFile /c/Users/myname/.ssh/my_custom_private_rsa

Now you can use “webserver” like in $ ssh webserver to connect to webserver.com using the local private SSH key.

STEP 4: Local Dev Machine

Now that we have created an ssh shortcut, alias, to webserver.com, the following command can be re-written like this:

git clone ssh://username@webserver.com/home/username/code/blog.git ./blogdev
to
git clone ssh://webserver/home/username/code/blog.git ./blogdev

STEP 5: Automate Deploys (Server-side Hooks)

This example uses the Git server-side hook, post-receive /code/blog.git/hooks/post-receive

Git Hooks - http://git-scm.com/book/ch7-3.html

touch /home/username/code/blog.git/hooks/post-receive
chmod u+x /home/username/code/blog.git/hooks/post-receive
nano -w /home/username/code/blog.git/hooks/post-receive

…and paste the following code:

#!/bin/bash
#CONFIG
LIVE="/var/www/html"

read oldrev newrev refname
if [ $refname = "refs/heads/master" ]; then
echo "===== DEPLOYING TO LIVE SITE ====="
unset GIT_DIR
cd $LIVE
git pull origin master
echo "===== DONE ====="
fi

That’s it! You can now start coding locally and pushing to the live site like $ git push origin master

This post was inspired by http://www.saintsjd.com/2011/03/automated-deployment-of-wordpress-using-git/

Static (Fixed) IP Address in Ubuntu (guest) Windows 7 (host) VirtualBox

I’ll keep this quick and dirty. You may need a static IP in your networked machine for accessibility between other machines. This is also a great way to host a web development environment, locally.

First: Setup VirtualBox networking

image

Attached to: Bridged Adapter

Second: Update the guest system’s interface config with the desired static IP info.

$ sudo nano /etc/network/interfaces

image

Notice that I just added the necessary IP info:

address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1

Finally: Restart the networking interface. If you get errors loading the new interface config, check that the wrapping comments have a # in front of each line.

sudo /etc/init.d/networking restart

Done!

Also, checkout this article on setting up User’s public_html directories. Apache2: Activating User public_html Directories & Virtual Directories- Hosts- Domains under Ubuntu Linux for a Private LAN

No words to explain how freaking cool this is!!!!

This post assumes that you have Virtualbox 4.1.8 running a fresh copy of Ubuntu 11.10 Server (guest) on Windows 7 (host). After hours of trying to figure out why I couldn’t get Guest Additions installed, I found the answer! I hope this helps…

Update & Upgrade apt-get and get dependancies for Guest Additions.

$ sudo apt-get update && sudo apt-get upgrade

$ sudo apt-get install dkms build-essential linux-headers-generic

Load the Guest Additions ISO from the main terminal window menu. I find it easier to mount this as a cdrom within the guest.

  1. Devices > CD/DVD Devices > Choose a virtual CD/DVD disk file…
  2. Browse to C:\Program Files\Oracle\VirtualBox and select VBoxGuestAdditions.iso

Mount the VBoxGuestAdditions.iso within Ubuntu.

$ sudo mount /dev/cdrom /media/cdrom

Install the Guest Additions.

$ sudo ./media/cdrom/VBoxLinuxAdditions.run

Reboot.

$ sudo reboot

Mounting Shared Folders. When creating the share folder from the main terminal’s menu, choose Auto-mount and Make Permanent.

With Linux guests, auto-mounted shared folders are mounted into the /media directory, along with the prefix sf_. For example, the shared folder myfiles would be mounted to /media/sf_myfiles on Linux and /mnt/sf_myfiles on Solaris.

NOTE: Access to auto-mounted shared folders is only granted to the user group vboxsf, which is created by the VirtualBox Guest Additions installer. Hence guest users have to be member of that group to have read/write access or to have read-only access in case the folder is not mapped writable.

Add a user to the vboxsf Group to access the mounted shared folders.

$ sudo usermod -G vboxsf -a 'name-of-user'

To assign the new group, log off and reconnect.

All done. At this point, you can access the mounted shared folder. Now, you can use symlinks to make it easier to work with.

Super awesome query that puts MS Excel to shame!

SELECT * FROM Table1 WHERE Table1.principal NOT IN (SELECT principal FROM table2)

with data export to file:

SELECT *
INTO OUTFILE "c:/mydata.csv"
	FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
	LINES TERMINATED BY "\n"
FROM Table1
WHERE Table1.principal
NOT IN (SELECT principal FROM table2)

My Hero!

This release includes the functionality to close the drop down when the user clicks off it. If demand needs it, I’ll work on the blur with a timeout too. Enjoy.

Styled Dropdown

1 2 3 4