apple option escape
Wednesday, December 21, 2011
Mac equivalent to CTRL + ALT + DELETE
Not groundbreaking but I can never remember this
Friday, December 16, 2011
Monday, December 12, 2011
Wednesday, November 23, 2011
Ruby super is not the super you used to know
Worth reading before you try and extend / override anything http://blog.ethanvizitei.com/2008/07/ruby-inheritance-gotcha.html
Monday, November 21, 2011
Andriod ADB Device Not Showing Up In Ubuntu?
I've been debugging an Android app in Ubuntu and have had ongoing issues getting the debugger to recognize my device. Starting and stopping the ADB server seems to do the trick every time:
$ANDROID_HOME/android-sdk-linux/platform-tools$ sudo ./adb kill-server $ANDROID_HOME/android-sdk-linux/platform-tools$ sudo ./adb start-server
Monday, November 7, 2011
MySQL Vertical Output
To see results structured vertically in the mysql console use \G instead of ; mysql> select * from users \G *************************** 1. row *************************** id: 1 email: user1@somedomain.com encrypted_password: asdf123 created_at: 2011-11-07 22:24:46 updated_at: 2011-11-07 22:24:46 roles_mask: 1 *************************** 2. row *************************** id: 2 email: user2@somedomain.com encrypted_password: asdf123 created_at: 2011-11-07 22:27:33 updated_at: 2011-11-07 22:28:18 roles_mask: 0
Saturday, April 30, 2011
View table details in MySQL
show table status like 'yourtablename';
Will display info on row_count, auto_increment value, etc. Handy.
Friday, April 29, 2011
View utf-8 values in mysql
mysql --default-character-set=utf8 -uroot -pbondaxe dataviews_production
Without the --default-character-set "Ã…landsbanken" will look like "�landsbanken"
Monday, April 18, 2011
Chrome asks permission every time i open a link. WTF?
Finally found a fix for this really annoying issue:
- open %USERPROFILE%\AppData\Local\Google\Chrome\Application
- right click chrome.exe and choose Properties
- Compatibility tab
- Change Settings for All Users
- un-check Run as Administrator
- restart chrome
Bear Mountain Hike
What I didn't bring and learned I needed. We had a very wet & cold overnight hike at bear Mountain this weekend. Being my first event of this type I was a little under prepared. Thankfully Antonio and Brownie had enough foresight to bring the following.
- A folding bow saw. This was truly indispensable for cutting green wood. Even the dead stuff was soaked pretty good.
- Sleeping pad. The bottom of the tent was freezing & damp, I think a water resistant sleeping pad would have made a huge difference. A synthetic rather than down sleeping bag would have been a much wiser choice when you know the rain is coming. Synthetic keeps you warm when wet, down although lighter is useless when soaked.
- Fire starter. Cotton balls covered in Vasoline is a great homemade solution - thanks Antonio.
- A tarp. Having a communal shelter over the fire made a huge difference. 4 people hanging out in a 2.5 person tent for 5 hours would have been brutal if not impossible.
- A little more water. I ran out on the hike back, my 3 liters should have been 4.
- Gloves. Cold & rain is tough on the digits.
- Waterproof matches for obvious reasons.
Configure Git Commit Email
1. Verify sendmail is installed
2. Execute the following git commands on the repo sending the email notification. Note: some of these config settings may be superfluous.
3. In the /hooks directory of your bare repository (.git/hooks in a non-bare repo) copy/rename post-receive.sample to post-receive.
4. Edit post-receive and add the following line (your path to post-receive-email may be different)
5. Edit the description file in your repo (.git/description in a non-bare repo) and replace the text with the name of your project. The text in the description file will show up in the subject line of the commit email.
$ git config --global sendemail.smtpserver yourmailserver.com $ git config --global sendemail.smtpserverport 25 $ git config --global sendmail.to youremail@address.com $ git config --global user.name "BFI GIT" $ git config --global user.email git@bfi.com $ git config --global sendemail.smtpuser $ git config --global sendemail.smtppass $ git config --global hooks.mailinglist yourmailinglist@address.com $ git config --global hooks.envelopesender whothisis@from.com $ git config --global hooks.emailprefix [GIT]
3. In the /hooks directory of your bare repository (.git/hooks in a non-bare repo) copy/rename post-receive.sample to post-receive.
4. Edit post-receive and add the following line (your path to post-receive-email may be different)
. /usr/share/doc/git/contrib/hooks/post-receive-email
5. Edit the description file in your repo (.git/description in a non-bare repo) and replace the text with the name of your project. The text in the description file will show up in the subject line of the commit email.
Friday, April 15, 2011
Oracle: Select column names for a specific table
select distinct column_name from all_tab_columns where table_name = upper('country') order by column_name asc
Monday, April 11, 2011
http://ninite.com/ The Easiest, Fastest Way to Update or Install
I can never remember their url http://ninite.com/
Sunday, April 10, 2011
Wednesday, April 6, 2011
Auto indent in vim
1. + g to see how many lines in the file (if you don't have line numbers turned on)
2. n== (where n is the number of lines from step 1)
3. you're beautified!
2. n== (where n is the number of lines from step 1)
3. you're beautified!
Tuesday, April 5, 2011
Sunday, April 3, 2011
Push a pre-existing repo to an already created heroku app
Say your buddy created an app on heroku but you've been working on the same code directly from github, when it comes time to push from your local repo to github you'll need to:
git remote add heroku git@heroku.com:YOURAPP.gitthen you can
git push heroku
Friday, March 25, 2011
#2002 Cannot log in to the MySQL server
If you're getting "#2002 Cannot log in to the MySQL server" when logging in to phpmyadmin on mac os, try editing phpmyadmin/config.inc.php and change:
Did the trick for me (after spending 2 hours on it).
$cfg['Servers'][$i]['host'] = 'localhost';to:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
Did the trick for me (after spending 2 hours on it).
Monday, March 14, 2011
Oracle with Ruby 1.9.2 / rvm
Thanks mikecomstock for pointing me to this ruby oracle tut
I’m running rvm so a couple things to note
remove sudo before building the ruby-oci8 gem
$ sudo env LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 /usr/bin/gem install ruby-oci8
just run
$ env LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 /usr/bin/gem install ruby-oci8
with rvm, you’ll need to specify your env before executing the sql.rb script from the tutorial
$ env LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2 ruby sql.rb
Useful link: http://www.pixellatedvisions.com/2009/03/25/rails-on-oracle-part-1-installing-the-oracle-instant-client-on-mac-os-x
Saturday, March 12, 2011
Mac OSX Start/Stop SSH
Start:
$sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plistStop:
$sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist
Thursday, March 10, 2011
How to View Hidden Files and Folders in Ubuntu File Browser
ctrl+hhttp://www.debianadmin.com/how-to-view-hidden-files-and-folders-in-ubuntu-file-browser.html
Monday, January 31, 2011
Thursday, January 20, 2011
Copy music from an IPod to iTunes (Mac OS X)
I recently picked up a new iPod Nano and needed to get music off my old iPod onto the new device. Unfortunately I also recently had a hard drive crash on the laptop that held my iTunes library. Here are the steps I used to pull music off my old iPod onto my new laptop and ultimately onto my new Nano.
- Plug in the IPod you want to copy music from
- In iTunes, select your iPod from the left hand menu "Devices > Your iPod". Under "Options" check the box "Enable disk use"
- Open a new Finder Window and you should see your iPod listed under devices
- Navigate to "Your iPod > iPod Control"
- Copy the Music folder to your drive. Let it finish.
- The Music folder needs to be "un-hidden" before you can import it into iTunes. Open a terminal window and navigate to the folder where you copied the Music folder. Run the following command to unhide Music
- In iTunes select "File > Add to Library"
- Select the Music folder
- Music from your iPod should now be copied to your library. When it's finished you can plug in a different iPod and sync your music.
$ chflags -R nohidden MusicThe folder should now be accesible in iTunes
Hope this helps.
Use Ruby To Retrieve a User's Public Twitter Timeline
Install the twitter gem:
Write the code:
Run the code:
$ gem install Twitter
Write the code:
#!/usr/bin/env ruby require 'rubygems' require 'twitter' screen_name = String.new ARGV[0] timeline = Twitter.user_timeline(screen_name) timeline.each do |t| puts "#{t.text}" end
Run the code:
ruby twitter.rb ryantremaine
Tuesday, January 4, 2011
Update the locate commands filename database on Mac OS
sudo /usr/libexec/locate.updatedb
Saturday, January 1, 2011
Setting Up Rails 3.0 On EC2
This tutorial assumes you followed my steps in Creating a (free) Linux EC2 Instance. If you're doing this on a 32-bit instance step 8 will be slightly different.
1. SSH into your instance
Expect to see some "No definition" errors.
To keep things simple I'm opening port 3000 which is the default WEBrick binding. Login to the AWS Management Console and select the security group for your instance. Add a new entry with the following values.
The remaining steps are taken from the Getting Started with Rails tutorial. I'm only using the first few steps here to verify Rails and MySQL are configured and running correctly.
12. Create A Test Project
Edit config/database.yml
16. Welcome Aboard!
Browse to http://50.16.195.2:3000/ (using your Elastic Ip). If everything worked you will be greeted with the welcome aboard page.
You should be all set. If you're new to Rails I recommend continuing the Getting Started with Rails tutorial, to keep going with it start at 4.2 Say “Hello”, Rails.
1. SSH into your instance
$ ssh ec2-user@50.16.195.2 -i ~/rtremainekey.pem2. Install GCC - enter "y" when prompted
$ sudo yum install gcc3. Install MySQL - enter "y" when prompted
$ sudo yum install mysql-server mysql-libs mysql-devel4. Install Ruby - enter "y" when prompted
sudo yum install ruby ruby-devel ruby-irb ruby-rdoc ruby-ri5. Install RubyGems
$ cd /tmp $ wget -q http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz $ tar xzf rubygems-1.3.7.tgz $ cd rubygems-1.3.7 $ sudo ruby setup.rb6. Install Rails - this one will take a while
$ sudo gem install rails7. Start MySQL
$ sudo /etc/init.d/mysqld start8. Give the root MySQL user a password
$ mysqladmin -u root password yourpassword
9. Create symlinks to MySQL libraries$ cd /usr/lib64/ $ sudo ln -s mysql/libmysqlclient.so $ sudo ln -s mysql/libmysqlclient.so.16 $ sudo ln -s mysql/libmysqlclient_r.so $ sudo ln -s mysql/libmysqlclient_r.so.1610. Install MySQL Gem
Expect to see some "No definition" errors.
$ sudo gem install mysql11. Open Port 3000
To keep things simple I'm opening port 3000 which is the default WEBrick binding. Login to the AWS Management Console and select the security group for your instance. Add a new entry with the following values.
- Connection Method: HTTP
- Protocol: TCP
- From Port: 3000
- To Port: 3000
The remaining steps are taken from the Getting Started with Rails tutorial. I'm only using the first few steps here to verify Rails and MySQL are configured and running correctly.
12. Create A Test Project
$ cd ~ $ rails new blog --database=mysql $ cd blog $ sudo bundle install13. Set your MySQL password
Edit config/database.yml
$ nano config/database.ymland apply the root password from step 8. You'll need to add it in 3 places, your database.yml should look like this when finished:
development: adapter: mysql2 encoding: utf8 reconnect: false database: blog_development pool: 5 username: root password: yourpassword socket: /var/lib/mysql/mysql.sock test: adapter: mysql2 encoding: utf8 reconnect: false database: blog_test pool: 5 username: root password: yourpassword socket: /var/lib/mysql/mysql.sock production: adapter: mysql2 encoding: utf8 reconnect: false database: blog_production pool: 5 username: root password: yourpassword socket: /var/lib/mysql/mysql.sock14. Create The Database
$ rake db:create15. Start WEBrick
$ rails serverNote: WEBrick should really only be used for development & testing. For a production level web server you'll want something like Mongrel.
16. Welcome Aboard!
Browse to http://50.16.195.2:3000/ (using your Elastic Ip). If everything worked you will be greeted with the welcome aboard page.
You should be all set. If you're new to Rails I recommend continuing the Getting Started with Rails tutorial, to keep going with it start at 4.2 Say “Hello”, Rails.
Subscribe to:
Posts (Atom)