Monthly Archives: September 2012

index name too long in rails 3.2 and mysql 5.5

If you get an error that says the auto-generated index name is too long (limited to 64 characters) during a rails migration, add a name to it in the last argument to overwrite the generated name with your custom shorter name.

Sample Error Message:

== AddColumnNameToPrices: reverting ============================================
— remove_column(:prices, :column_name)
rake aborted!
An error has occurred, this and all later migrations canceled:

Index name ‘temp_index_altered_prices_on_column_and_other_column_and_third_column’ on table ‘altered_prices’ is too long; the limit is 64 characters

Solution:
add_index :designations, [ :scope_type, :scope_id, :role_id, :user_id ], :unique => true, :name => ‘my_index’

Retrieve Lost Bookmarks from Chrome

 

How to restore bookmarks from Chrome?  I’ve seen a couple cases where either an update on chrome removed all previous bookmarks or user accidentally deleted all of them to migrate to another computer and since google chrome syncs, it removed all it from the user’s account instead of just locally.  (yes, some people get confused about the login for chrome and syncing, vs gmail so they just sign out of gmail, they think logging into gmail is the same as logging into chrome.[i guess i can see why, since the credentials are the same], but if you are one of these people, you can think of it as different sites allowing you to sign in with your facebook credentials, you’ve all seen that right?)

On the mac…

I have a Mac so for all you Mac users go to ‘user’ folder –>Library –>Application Support –> GoogleChrome –> Default and you’ll then see ‘bookmarks’ and ‘bookmark.bak’.  Copy the bookmark.bak to  bookmarks.  This will make the backup copy into the current copy.  Then restart your chrome, and the bookmarks should be restored.

On Windows XP…

On XP: Go to C:\Documents and Settings\<your_username>\Local Settings\Application Data\Google\Chrome\User Data\Default\on Vista: C:\Users\<your_username>\AppData\Local\Google\Chrome\User Data\Default\     Same as above steps, copy bookmark.bak to bookmarks.

On Windows 7…

1.  Go to    C:\Users\<YOUR USERNAME>\AppData\Local\Google\Chrome\User Data\Default

2.Once there, you should see a bunch of files. Two of which are called “Bookmarks”, and “Bookmarks.bak”. Copy the Bookmarks.bak file to a safe location ( I copied the “bookmarks.bak” file to my desktop).

3. Now, close Chrome. Rename the “Bookmarks.bak” file you just copied to “Bookmarks”, and copy it back in to that directory, overwriting the original one.

source: Google Groups Forum on Chrome

How to remove EFI System partition in Windows 7

Drive was once used to as a boot recovery for mac osx.  Got a different drive for that now and wanted to use this drive on Windows 7.  When looking at the disk manager, there is a random 200MB partition that was used for the boot recovery for osx.  (EFI System Partition).   To delete this partition in Windows 7, do the following 5 steps.
  1. On the command prompt type diskpart and answer to any possible UAC prompt.
  2. On the new diskpart prompt, type list disk. Note the Disk ### column.
  3. Type, select disk ### (with ### being the disk you wish to delete. Usually the disk with partition 0 with a size of 200 MB)
  4. Finish by typing, clean.
  5. Type exit to exit diskpart

CD detection issue while installing Ubuntu 12.04 Server Edition from USB Flash Drive

Our servers were not able to detect the “cd rom” (the error message said something along the lines of cd rom could not find the ‘release’ files) while installing ubuntu 12.04 server edition from a flash drive using either YUMI or Universal USB Installer

  1. Hit F1 during error message
  2. Mount the ISO
  3. Symbolic link the ISO
  4. Hit Alt-F1
  5. Continue (Don’t check disk for defects as this will force you to link it again for some reason)
This works for YUMI and the other booters.

source:
http://demtrex.wordpress.com/2011/04/04/work-around-the-cd-rom-detection-issue-when-installing-ubuntu-server/

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

I’ve gotten this error on both ubuntu and mac osx.

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)

Simple quick fix solution is to create a symbolic link to it. The location i’ve seen it other than /var/run/mysqld is /tmp/mysql.sock

sudo ln -s /tmp/mysql.sock /var/run/mysqld/mysqld.sock

How to install rvm on Mountain Lion

Install rvm on OSX 10.8.1 Mountain Lion in 4 easy steps.
  1. Download & install Command line tools for Xcode 4.4 (you don’t need to download Xcode):https://developer.apple.com/downloads/index.action
  2. Install Homebrew: https://github.com/mxcl/homebrew/wiki/installation
  3. Install automake: brew install automake
  4. Install RVM as usual and select 1.9.3-head as the default ruby installation: https://rvm.io/rvm/install/

Optional step: You may need XQuartz for some components, for example for Imagemagick, so download & install XQuartz: http://xquartz.macosforge.org/trac/wiki

iPhone 1st Generation stuck on boot screen after erase all data / factor reset

Since the iphone 3G –> 3Gs –> 4 –> 4S –> and now iPhone 5 came out, i’m sure it’ll become more difficult to find solutions (if it isn’t so already) on troubleshooting your iphone 1st generation.  So i’m posting about one particular problem i ran into here for all the other people who have been using their iphone 1st gen for 3990324234+ years or got it as a hand me down.

I had to whip this bad boy out because my 62 year old mom decided she wanted to be a hipster and use a smart phone.  (although she refuses for me to purchase any of the new smart phones for her).  Typical frugal Asian mom, completely understandable.  

So I was trying to erase and reset all the existing data from the phone via the settings menu inside the iphone, it finished, rebooted, and then gets stuck on the boot screen with the apple and rotating daisy wheel.  I thought since this phone is slow as hell, maybe it needed to take longer to boot than what i remembered a few years back (….hmmm didn’t we use to think pentium 4’s were freeken fast as hell?? try using one now…seriously.), so i left it there for  a good hour and still nothing…stuck on the same screen…however noticing it reboots itself every once in a while only to get stuck again.

Finally I found the solution on apple’s forum, which worked like a charm.

– Plug one end of the cord into your phone and the other in your computer
– Remove the cord in your computer, leaving the cord in the phone still plugged in
– Hold both the home button and on/off button on the phone
– Once the screen turns off, let go of the on/off button but continue holding the home button
– Plug in the other end of the cord in your computer while still holding the home button on the phone
– Once the apple logo appears, continue holding until you see the plug into iTunes screen on your phone
– Click restore

source:
https://discussions.apple.com/thread/2088600?threadID=2088600

THANKS “T-Nice” for the solution…but why are you using a lenovo?!??! where’s the macbook?!?! ..It better at least be a ThainkPAD!…..=P jking…..kinda..

-macslut 4 life!  1st GEN iphone FTW!