Find the current vnc port:
ps aux | grep vnc
Then run vinagre to connect to the vnc server:
vinagre
Find the current vnc port:
ps aux | grep vnc
Then run vinagre to connect to the vnc server:
vinagre
Yet another step-by-step for my own reference.
1. Generate keys for new domain
mkdir /etc/opendkim/keys/example.com /usr/sbin/opendkim-genkey -D /etc/opendkim/keys/example.com/ -d example.com -s default chown -R opendkim:opendkim /etc/opendkim/keys/example.com mv /etc/opendkim/keys/example.com/default.private /etc/opendkim/keys/example.com/default
2. Edit KeyTable
vi /etc/opendkim/KeyTable
Add new line
default._domainkey.example.com example.com:default:/etc/opendkim/keys/example.com/default
3. Add domain to SigningTable
vi /etc/opendkim/SigningTable
Add a new line:
*@example.com default._domainkey.example.com
4. Add appropriate entries to TXT records for example.com
Done
ActiveRecord::StatementInvalid: SQLite3::SQLException: near "SAVEPOINT": syntax error: SAVEPOINT active_record_1
Was getting the above error, and found that I needed to upgrade CentOS default version of sqlite. Pretty simple right?
Problems arose:
Thanks to Stackoverflow again, all I really needed to do was manually install the sqlite rubygem pointing to the updated static libraries, as per:
bundle config build.sqlite3 \ --with-sqlite3-include=$HOME/sqlite3.7.7.1/include \ --with-sqlite3-lib=$HOME/sqlite3.7.7.1/lib \ --with-sqlite3-dir=$HOME/sqlite3.7.7.1/bin bundle install
After upgrading to WordPress 3.4, I tried to update my database but the process seemed to hang, with a blank page.
The fix is pretty simple:
mv [blog-root]/wp-content/db.php db.bak
And then try refreshing the page that hanged.
(alternate Post Title: My First Gem, please be gentle)
Filtering rails logs is like trying eat soup with a fork in space while going through a black hole. Ok, not that bad, but it takes some work.
Why would you want to filter logs by IP?
Enter Distilled
Distilled gem allows you to filter out rails logs by IP. Its pretty easy to setup, just install the gem, and create a one line initializer to set the IP addresses.
SampleApp::Application.config.middleware.swap( Rails::Rack::Logger, Distilled::DistilledLogger, :filtered_ips => ['123.456.789.1', '127.0.0.1'] )
To search for the next occurence of the text ‘maybe’ from the current cursor position, type:
/maybe
Search backward from the current position by using ? instead of / in the command.
Once you have searched for something, you can find the next occurrence by pressing nor the previous occurrence with N.
Searching in vi/vim is enhanced with regular expressions. For example, to find the next occurence of the text ‘Total’ that occurs at the beginning of a line, use:
/^Total
Open up terminal.
defaults -currentHost write -globalDomain AppleFontSmoothing -int 2
You will need to restart applications (including things like Finder) in order to see the affect.
Revert back to default setting through:
defaults -currentHost delete -globalDomain AppleFontSmoothing
Go to https://m.google.com/sync/settings/iconfig
Select the calendars you want to sync and refresh your iPhone calendar.
Done.
Having your own local version of Ruby on Rails documentation has its benefits, including offline use, merged documentation for Ruby and Rails, and having docs for the exact versions that your current project uses.
Creating them is pretty simple thanks to the sdoc gem.
Create a home for your Ruby and Rails docs:
mkdir railsdoc cd railsdoc
sdoc provides all the magic to generate searchable ruby docs in HTML. So the first thing to do is to install the sdoc gem. I use RVM, so I created its own gemspec with a .rvmrc file:
rvm use --create ruby-1.9.2-p290@railsdoc
Either way you’ll need to install sdoc.
sudo gem install sdoc
git clone https://github.com/rails/rails.git git clone https://github.com/ruby/ruby.git
cd ruby
Now here you have to decide what version of ruby you want to document. Using git, checkout the version / tag you want. (In the following example, I switching to ruby version 1.9.2-p290) Then have sdoc create the docs.
git co v1_9_2_290 sdoc -o doc/ruby ruby cd ..
Repeat for the rails doc. Here I’m documenting rails version 3.2.0.
cd rails git co v3.2.0 sdoc --fmt=sdoc -g -o doc/rails -A rails cd ..
Now that we’ve generated our ruby docs and rails docs, now its time to merge them into on directory. sdoc provides a command to merge them.
I would change the title of the command below to reflect what versions of ruby and rails you have.
sdoc-merge --title "Ruby 1.9.2-p290 and Rails 3.2.0" --op merged --names "Ruby,Rails" doc/ruby doc/rails
That’s it folks.
Point your browser to “merged/index.html” and rejoice in your merged, local, and searchable Ruby on Rails docs!
If you’re osx you can run the following to open it up:
open merged/index.html
With your railsdoc directory, you can easily update the docs by:
I keep forgetting how to change the time in the android emulator.
$ adb shell date –- 2009-10-01 14:24:59 20070325.123456 date –s 20070325.123456