-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
381 lines (299 loc) · 25.9 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Alex Popov]]></title>
<link href="http://AlexVPopov.github.io/atom.xml" rel="self"/>
<link href="http://AlexVPopov.github.io/"/>
<updated>2013-11-26T09:41:42+02:00</updated>
<id>http://AlexVPopov.github.io/</id>
<author>
<name><![CDATA[Alex Popov]]></name>
</author>
<generator uri="http://octopress.org/">Octopress</generator>
<entry>
<title type="html"><![CDATA[Allow users to authenticate with username only using Devise, ActiveAdmin, Rails 4 and Ruby 2]]></title>
<link href="http://AlexVPopov.github.io/blog/2013/10/31/allow-users-to-authenticate-with-username-only-using-devise-activeadmin-rails-4-and-ruby-2/"/>
<updated>2013-10-31T16:10:00+02:00</updated>
<id>http://AlexVPopov.github.io/blog/2013/10/31/allow-users-to-authenticate-with-username-only-using-devise-activeadmin-rails-4-and-ruby-2</id>
<content type="html"><![CDATA[<p>Probably there are not many cases where one wouldn't wont their users to have email addresses. Nevertheless, I had exactly this situation recently. It was quite a challenge (for me at least) to figure out all the things one needs to change in Devise, so as not to expect users to provide an email upon registration and sign-in and to work properly. Finally, I was able to set it to work properly and decided to save you the trouble, in case some of you have a similar setup. <!-- more --></p>
<h2>Allow normal users to authenticate with username only, while keeping email authentication for admins in ActiveAdmin</h2>
<h3>Scenario</h3>
<p>You are using ActiveAdmin (AA), Devise, Rails 4 and Ruby 2. You have two models/AA resources - AdminUsers (created by default after installing AA) and Users (generated using Devise). You want your users to be able to login only with username and not have the email attribute at all. At the same time you want your admins to be able to log-in in the AA backend via email.</p>
<h3>Source</h3>
<p>You can view <a href="https://github.com/AlexVPopov/devise-username-only">the source on Github</a>.</p>
<h3>Conventions</h3>
<p>I refer to the files unser <code>app/models/</code> as <em>models</em> and the files under <code>app/admin/</code> as <em>resources</em>.</p>
<h3>Prerequisits:</h3>
<ul>
<li>Generate a new Rails application:</li>
</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rails new devise_username_only
</span></code></pre></td></tr></table></div></figure>
<ul>
<li>Add to Gemfile</li>
</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">gem</span> <span class="s1">'activeadmin'</span><span class="p">,</span> <span class="ss">github</span><span class="p">:</span> <span class="s1">'gregbell/active_admin'</span>
</span></code></pre></td></tr></table></div></figure>
<ul>
<li>Install gems:</li>
</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>bundle install
</span></code></pre></td></tr></table></div></figure>
<ul>
<li>Install ActiveAdmin:</li>
</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rails g active_admin:install
</span></code></pre></td></tr></table></div></figure>
<ul>
<li>Migrate the database:</li>
</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rake db:migrate
</span></code></pre></td></tr></table></div></figure>
<p>So far you should have a working app with an admin backend, containing an AdminUsers resource. Test it by starting the server with <code>rails s</code>, going to <a href="http://localhost:3000/admin"><code>http://localhost:3000/admin</code></a> and logging in with credentials <code>admin@example.com</code> and <code>password</code>.</p>
<h3>Actual work</h3>
<p>Now comes the real work of generating your user model and doing a few tweaks.</p>
<h4>Devise initializer</h4>
<p>Modify the Devise initializer under <code>config/initalizers/devire.rb</code>. In particular, change the following lines to look like this:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">config</span><span class="o">.</span><span class="n">case_insensitive_keys</span> <span class="o">=</span> <span class="o">[</span> <span class="ss">:email</span><span class="p">,</span> <span class="ss">:username</span> <span class="o">]</span>
</span><span class='line'><span class="n">config</span><span class="o">.</span><span class="n">strip_whitespace_keys</span> <span class="o">=</span> <span class="o">[</span> <span class="ss">:email</span><span class="p">,</span> <span class="ss">:username</span> <span class="o">]</span>
</span></code></pre></td></tr></table></div></figure>
<p>We we will leave the line:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="c1"># config.authentication_keys = [ :email ]</span>
</span></code></pre></td></tr></table></div></figure>
<p>commented out, as we don't want to change the authentication keys globally. We want our admin users to still be able to log in with email. We will change the authentication keys only within the user model.</p>
<p>Also, uncomment <code>config.scoped_views</code> and set it to <code>true</code>:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">config</span><span class="o">.</span><span class="n">scoped_views</span> <span class="o">=</span> <span class="kp">true</span>
</span></code></pre></td></tr></table></div></figure>
<p>We need this because we have more than one Devise model (AdminUsers and Users) and we want to modify the Users views. More info <a href="https://github.com/plataformatec/devise#configuring-views">here</a>.</p>
<h4>User model</h4>
<p>Generate the User model:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rails g devise User
</span></code></pre></td></tr></table></div></figure>
<p>In the user migration file under <code>db/migrate/20131031100550_devise_create_admin_users.rb</code> replace <code>:email</code> with <code>:username</code> so that you have the folloing two lines in the file:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">t</span><span class="o">.</span><span class="n">string</span> <span class="ss">:username</span><span class="p">,</span> <span class="n">null</span> <span class="o">=></span> <span class="kp">false</span><span class="p">,</span> <span class="ss">:default</span> <span class="o">=></span> <span class="s2">""</span>
</span><span class='line'><span class="n">add_index</span> <span class="ss">:users</span><span class="p">,</span> <span class="ss">:username</span><span class="p">,</span> <span class="ss">:unique</span> <span class="o">=></span> <span class="kp">true</span>
</span></code></pre></td></tr></table></div></figure>
<p>Tweak the User <em>model</em>:</p>
<ul>
<li>set the desired Devise modules;</li>
<li>add the authentication keys option;</li>
<li>overwrite <code>email_required?</code> and <code>email_changed?</code>.</li>
</ul>
<p>Your model should look something like this:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">class</span> <span class="nc">User</span> <span class="o"><</span> <span class="ss">ActiveRecord</span><span class="p">:</span><span class="ss">:Base</span>
</span><span class='line'> <span class="c1"># Include default devise modules. Others available are:</span>
</span><span class='line'> <span class="c1"># :confirmable, :lockable, :timeoutable, :omniauthable,</span>
</span><span class='line'> <span class="c1"># :registerable, :recoverable</span>
</span><span class='line'> <span class="n">devise</span> <span class="ss">:database_authenticatable</span><span class="p">,</span>
</span><span class='line'> <span class="ss">:rememberable</span><span class="p">,</span>
</span><span class='line'> <span class="ss">:trackable</span><span class="p">,</span>
</span><span class='line'> <span class="ss">:validatable</span><span class="p">,</span>
</span><span class='line'> <span class="ss">:authentication_keys</span> <span class="o">=></span> <span class="o">[</span><span class="ss">:username</span><span class="o">]</span>
</span><span class='line'>
</span><span class='line'> <span class="k">def</span> <span class="nf">email_required?</span>
</span><span class='line'> <span class="kp">false</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="k">def</span> <span class="nf">email_changed?</span>
</span><span class='line'> <span class="kp">false</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>I have not included <code>:confirmable</code>, <code>:registerable</code>, and <code>:recoverable</code> as I want all my user management to happen on the backend through ActiveAdmin. What's more, as the User model does not have the email attribute, these modules won't work anyway.</p>
<p>Finally, run the migration:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rake db:migrate
</span></code></pre></td></tr></table></div></figure>
<h4>User resource</h4>
<p>Register the User model as a resource in ActiveAdmin:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rails g active_admin:resource User
</span></code></pre></td></tr></table></div></figure>
<p>Modify the User <em>resource</em> to look like this:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="no">ActiveAdmin</span><span class="o">.</span><span class="n">register</span> <span class="no">User</span> <span class="k">do</span>
</span><span class='line'> <span class="c1"># This determines which attributes of the User model will be</span>
</span><span class='line'> <span class="c1"># displayed in the index page. I have left only username, but</span>
</span><span class='line'> <span class="c1"># feel free to uncomment the rest of the fields or add any</span>
</span><span class='line'> <span class="c1"># other of the User attributes.</span>
</span><span class='line'> <span class="n">index</span> <span class="k">do</span>
</span><span class='line'> <span class="n">column</span> <span class="ss">:username</span>
</span><span class='line'> <span class="c1"># column :current_sign_in_at</span>
</span><span class='line'> <span class="c1"># column :last_sign_in_at</span>
</span><span class='line'> <span class="c1"># column :sign_in_count</span>
</span><span class='line'> <span class="n">default_actions</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="c1"># Default is :email, but we need to replace this with :username</span>
</span><span class='line'> <span class="n">filter</span> <span class="ss">:username</span>
</span><span class='line'>
</span><span class='line'> <span class="c1"># This is the form for creating a new user using the Admin</span>
</span><span class='line'> <span class="c1"># backend. If you have added additional attributes to the</span>
</span><span class='line'> <span class="c1"># User model, you need to include them here.</span>
</span><span class='line'> <span class="n">form</span> <span class="k">do</span> <span class="o">|</span><span class="n">f</span><span class="o">|</span>
</span><span class='line'> <span class="n">f</span><span class="o">.</span><span class="n">inputs</span> <span class="s2">"User Details"</span> <span class="k">do</span>
</span><span class='line'> <span class="n">f</span><span class="o">.</span><span class="n">input</span> <span class="ss">:username</span>
</span><span class='line'> <span class="n">f</span><span class="o">.</span><span class="n">input</span> <span class="ss">:password</span>
</span><span class='line'> <span class="n">f</span><span class="o">.</span><span class="n">input</span> <span class="ss">:password_confirmation</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'> <span class="n">f</span><span class="o">.</span><span class="n">actions</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'>
</span><span class='line'> <span class="c1"># This is related to Rails 4 and how it handles strong parameters.</span>
</span><span class='line'> <span class="c1"># Here we replace :email with :username.</span>
</span><span class='line'> <span class="n">controller</span> <span class="k">do</span>
</span><span class='line'> <span class="k">def</span> <span class="nf">permitted_params</span>
</span><span class='line'> <span class="n">params</span><span class="o">.</span><span class="n">permit</span> <span class="ss">user</span><span class="p">:</span> <span class="o">[</span><span class="ss">:username</span><span class="p">,</span> <span class="ss">:password</span><span class="p">,</span> <span class="ss">:password_confirmation</span><span class="o">]</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'> <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<h4>Devise views</h4>
<p>The Devise views need to be modified in order to reflect that the user is using their username and not their email. First, generate them:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>rails g devise:views
</span></code></pre></td></tr></table></div></figure>
<p>Since I have not included the <code>:confirmable</code>, <code>:registerable</code>, and <code>:recoverable</code> modules, the only relevent view is <code>app/views/devise/sessions/new.html.erb</code>. You only need to change these lines:</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='erb'><span class='line'><span class="x"><div></span><span class="cp"><%=</span> <span class="n">f</span><span class="o">.</span><span class="n">label</span> <span class="ss">:username</span> <span class="cp">%></span><span class="x"><br /></span>
</span><span class='line'><span class="cp"><%=</span> <span class="n">f</span><span class="o">.</span><span class="n">text_field</span> <span class="ss">:username</span><span class="p">,</span> <span class="ss">:autofocus</span> <span class="o">=></span> <span class="kp">true</span> <span class="cp">%></span><span class="x"></div></span>
</span></code></pre></td></tr></table></div></figure>
<p>Note that <code>f.email_field</code> needs to be changed to <code>f.text_field</code>, otherwise in newer browsers the built-in validation won't pass and you'll get error when you enter a username in that field.</p>
<p>To test your work:</p>
<ul>
<li>create a new user via the admin back-end;</li>
<li>go to <a href="http://localhost:3000/users/sign_in"><code>http://localhost:3000/users/sign_in</code></a> and log in.</li>
</ul>
<p>Bear in mind that if you have not created a default home page containing a sign out link, you won't be able to log out by just entering <a href="http://localhost:3000/users/sign_out"><code>http://localhost:3000/users/sign_out</code></a> by default, as the sign-out route uses the <code>:delete</code> HTTP method. As a temporary workaround, in the Devise initializer set <code>config.sign_out_via</code> to <code>:get</code> and in <code>routes.rb</code> change <code>devise_for :users</code> to</p>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="n">devise_for</span> <span class="ss">:users</span> <span class="k">do</span> <span class="n">get</span> <span class="s1">'/users/sign_out'</span> <span class="o">=></span> <span class="s1">'devise/sessions#destroy'</span> <span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>
<p>I hope I have saved you some time.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Install Postgresql 9.2.4 on OS X Mountain Lion]]></title>
<link href="http://AlexVPopov.github.io/blog/2013/09/02/install-postgresql-9-dot-2-4-on-os-x-mountain-lion/"/>
<updated>2013-09-02T13:54:00+03:00</updated>
<id>http://AlexVPopov.github.io/blog/2013/09/02/install-postgresql-9-dot-2-4-on-os-x-mountain-lion</id>
<content type="html"><![CDATA[<h1>A quick way to get Postgres to work with your existing Rails app</h1>
<p><img class="left" src="http://AlexVPopov.github.io/images/postgres_app.png" width="300" title="Postgress.app" ></p>
<div style="clear:both;"></div>
<p>There are plenty of instructions for installing PSQL on OS X Mountain Lion such as <a href="https://coderwall.com/p/1mni7w">this</a> or <a href="http://metacog.elijames.org/post/28333408639/setting-up-a-development-environment-on-mountain-lion">this</a>. The problem here is that as of Mountain Lion Postgres opens a socket in <code>/var/pgsql_socket</code>, which is different from previous versions.<!-- more --> As a result, when you try to start Postgres with <code>psql</code> in the shell, you'll get an error message, similar to:</p>
<figure class='code'><figcaption><span>[PSQL starting error] </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>psql: could not connect to server: Permission denied
</span><span class='line'> Is the server running locally and accepting
</span><span class='line'> connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?</span></code></pre></td></tr></table></div></figure>
<p>The links I mentioned above provide a possible solution to this problem. You could also try the varios suggestions in <a href="http://stackoverflow.com/search?q=.s.PGSQL.5432">Stackoverflow</a>. Alas, I had no luck with any of them, but this is what saved my day:</p>
<ol>
<li>Install the <a href="http://postgresapp.com/">Postgress App</a>:
<ul>
<li><a href="http://postgresapp.com/download">Download the latest version</a>.</li>
<li>Unarchive it.</li>
<li>Drag-and-drop Postgres.app to your Applications folder</li>
</ul></li>
<li><p>Amend your PATH by running this in the shell: </p>
<p><code>export PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"</code></p></li>
<li><p>Start the Postgres.app from your Applications folder. You should be seeing a black elephant in the menu bar.</p></li>
<li><p>Create a role with the same name as the one you have specified in your <code>database.yml</code> file with these commands</p>
<ul>
<li><code>psql</code> to startthe psql.</li>
<li>Create the role with <code>CREATE ROLE <username> SUPERUSER LOGIN;</code>.</li>
<li><code>\q</code> to quit the psql shell.</li>
</ul></li>
<li><p>After that run these commands to recreate the development and environment databases of your app:</p>
<ul>
<li><code>rake:db:create:all</code></li>
<li><code>rake:db:migrate</code></li>
<li><code>rake:db:migrate RAILS_ENV=test</code></li>
</ul></li>
</ol>
<p>You should be good to go.</p>
<p>P.S. Also check out this <a href="http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast">#342 Migrating to PostgreSQL</a> Railscast for a full guide on migrating from SQLite to Postgres and this <a href="http://stackoverflow.com/questions/11092807/installing-postgresql-on-ubuntu-for-ruby-on-rails">Stackoverflow question</a> for similar instructions for Ubuntu.</p>
]]></content>
</entry>
<entry>
<title type="html"><![CDATA[Hello World]]></title>
<link href="http://AlexVPopov.github.io/blog/2013/08/31/hello-world/"/>
<updated>2013-08-31T00:01:00+03:00</updated>
<id>http://AlexVPopov.github.io/blog/2013/08/31/hello-world</id>
<content type="html"><![CDATA[<h2>A post to get my blog going</h2>
<p><img class="center" src="http://AlexVPopov.github.io/images/github_page_and_octopress.png" width="600" title="Octocat and Octopress" alt="Octocat and Octopress"></p>
<p>This is it. I made it. I installed <a href="http://octopress.org/">Octopress</a>, deployed my blog on <a href="http://pages.github.com/">GitHub Pages</a> and am writing my first blog post. I decided to create this blog for two reasons: <!-- more --></p>
<ol>
<li>I spend a lot of time solving problems in the course of my learning, my work, my life in general. This costs me time. I want to share my knowledge and save other people's time. Octopress happens to be a beautiful and very flexible way to do this.</li>
<li>Blogging on Octopress involves many technologies, such as <a href="https://www.ruby-lang.org/en/">Ruby</a>, <a href="http://jekyllrb.com/">Jekyll</a>, <a href="http://octopress.org/">Octopress</a> (obviously), <a href="http://daringfireball.net/projects/markdown/">Markdown</a> and many more. I like using beautiful, simple and yet powerfull technologies and I like learning.</li>
</ol>
<p>So there you have it. I promise to try and blog at least once a week and hope my posts will help you do the things you like faster and easier.</p>
<p>P.S. Although this blog will be primarily tech-oriented, I might also write about other interesting stuff from all corners of life.</p>
]]></content>
</entry>
</feed>