<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OanhNN's blog</title>
    <description>I am a web developer and an open-source contributor. I like making something that help people's work and I hope those will make a world better.
</description>
    <link>https://oanhnn.com/</link>
    <atom:link href="https://oanhnn.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 08 Dec 2023 16:10:08 +0700</pubDate>
    <lastBuildDate>Fri, 08 Dec 2023 16:10:08 +0700</lastBuildDate>
    <generator>Jekyll v3.9.3</generator>
    
      <item>
        <title>Bảo vệ hotlink của bạn</title>
        <description>&lt;h2 id=&quot;bảo-vệ-hotlink-là-gì&quot;&gt;Bảo vệ Hotlink là gì?&lt;/h2&gt;

&lt;p&gt;Hotlink là một quá trình sử dụng hình ảnh trang web của bạn, tài sản tĩnh (CSS, Javascript, Phông chữ, v.v.) đến các trang web khác không liên quan đến bạn. Do đó, hiệu suất trang web của bạn sẽ giảm đáng kể. Mỗi khi trang web người dùng khác tải nó sẽ lấy tài nguyên từ trang web của bạn.&lt;/p&gt;

&lt;p&gt;Không cần phải lo lắng vì chúng ta có thể ngăn chặn nó bằng phương pháp sau&lt;/p&gt;

&lt;h2 id=&quot;triển-khai-trong-máy-chủ-web-nginx&quot;&gt;Triển khai trong Máy chủ Web Nginx&lt;/h2&gt;

&lt;div class=&quot;language-nginx highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;rouge-gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;rouge-code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;valid_referers&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;none&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;blocked&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yoursite.com&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;*.yoursite.com&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$invalid_referer&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;return&lt;/span&gt;   &lt;span class=&quot;mi&quot;&gt;403&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;VD: Đoạn mã triển khai đầy đủ trong Máy chủ Web Nginx&lt;/p&gt;

&lt;div class=&quot;language-nginx highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;rouge-gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
7
8
9
10
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;rouge-code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;\&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;.(gif|otf|jpg|jpeg|png|css|js)&lt;/span&gt;$ &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;valid_referers&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;none&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;blocked&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;yoursite.com&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;*.yoursite.com&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$invalid_referer&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;kn&quot;&gt;return&lt;/span&gt;   &lt;span class=&quot;mi&quot;&gt;403&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Cache-Control&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Pragma&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;add_header&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Vary&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;Accept-Encoding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;expires&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;tham-khảo&quot;&gt;Tham khảo:&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;https://stackcoder.in/posts/hotlink-protection-in-nginx (bài gốc)&lt;/li&gt;
  &lt;li&gt;https://nginx.org/en/docs/http/ngx_http_referer_module.html#valid_referers&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 26 Feb 2021 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2021-02-26/protected-your-hotlink.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2021-02-26/protected-your-hotlink.html</guid>
        
        <category>skill</category>
        
        
        <category>blogs</category>
        
      </item>
    
      <item>
        <title>Good Product Team / Bad Product Team</title>
        <description>&lt;p&gt;Làm thế nào để dánh giá một team sản phẩm là tốt hay không? Câu hỏi này vẫn là
ăn khoăn của không ít các nhà quản lý. &lt;br /&gt;
Mình vừa đọc được bài này thấy hay nên note lại cho mọi người.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;http://svpg.com/good-product-team-bad-product-team/&quot;&gt;&lt;strong&gt;Good Product Team / Bad Product Team&lt;/strong&gt;&lt;/a&gt; &lt;br /&gt;
– Marty Cagan | Jun 13, 2014&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Tue, 11 Jul 2017 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2017-07-11/good-product-team-bad-product-team.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2017-07-11/good-product-team-bad-product-team.html</guid>
        
        <category>skill</category>
        
        
        <category>blogs</category>
        
      </item>
    
      <item>
        <title>Cố chút hạnh phúc từ twitter</title>
        <description>&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;&lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;&lt;a href=&quot;https://twitter.com/hashtag/typescript?src=hash&quot;&gt;#typescript&lt;/a&gt; is now supported by Laravel Mix (v0.12). &lt;br /&gt;Big thanks to &lt;a href=&quot;https://twitter.com/oanhnn&quot;&gt;@oanhnn&lt;/a&gt; &amp;amp; &lt;a href=&quot;https://twitter.com/jeffrey_way&quot;&gt;@jeffrey_way&lt;/a&gt; 🙌&lt;a href=&quot;https://t.co/Pnw7D0ISSi&quot;&gt;https://t.co/Pnw7D0ISSi&lt;/a&gt;&lt;/p&gt;&amp;mdash; ARCANEDEV (@Arcanedev) &lt;a href=&quot;https://twitter.com/Arcanedev/status/867050078334312448&quot;&gt;May 23, 2017&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;

&lt;p&gt;Đây sẽ là lời động viên để mình cố gắng đống góp cho cộng đồng mã nguồn mở nhiều hơn nữa. &lt;br /&gt;
Xin cảm ơn bạn!&lt;/p&gt;
</description>
        <pubDate>Wed, 24 May 2017 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2017-05-24/a-little-happiness.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2017-05-24/a-little-happiness.html</guid>
        
        
        <category>blog</category>
        
      </item>
    
      <item>
        <title>Configure your SSL certificate and HTTPS site to rank A+</title>
        <description>&lt;p&gt;&lt;strong&gt;This blog is out of date&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Today, I made a HTTPS site with invalid SSL certificate configuration to rank A+.
And now, i will share my how to do.&lt;/p&gt;

</description>
        <pubDate>Mon, 15 May 2017 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2017-05-15/configure-your-ssl-certificate-to-rank-a-plus.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2017-05-15/configure-your-ssl-certificate-to-rank-a-plus.html</guid>
        
        <category>skill</category>
        
        
        <category>tutorial-tips</category>
        
      </item>
    
      <item>
        <title>Vào lại tài khoản Twitter và mình có chút vui vẻ</title>
        <description>&lt;p&gt;Hôm nay mình vừa tài khoản Twitter của mình sau một khoảng thời gian dài bận rộn.
Thật là vui khi thấy bài này:&lt;/p&gt;

</description>
        <pubDate>Fri, 17 Feb 2017 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2017-02-17/i-come-back-my-twitter-and-feeling-happy.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2017-02-17/i-come-back-my-twitter-and-feeling-happy.html</guid>
        
        
        <category>blog</category>
        
      </item>
    
      <item>
        <title>Run docker without sudo in Fedora 25</title>
        <description>&lt;p&gt;I was setup new computer in my company, i installed Fedora 25 OS for it.
After i installed &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker&lt;/code&gt; following &lt;a href=&quot;https://docs.docker.com/engine/installation/linux/fedora/&quot;&gt;the Docker document&lt;/a&gt;,
I has a problem about run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;docker&lt;/code&gt; without &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo&lt;/code&gt; (reasons are explained
on the Docker document page linked here, I’m not going to repeat them).&lt;/p&gt;

</description>
        <pubDate>Wed, 15 Feb 2017 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2017-02-15/run-docker-without-sudo-in-fedora-25.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2017-02-15/run-docker-without-sudo-in-fedora-25.html</guid>
        
        <category>skill</category>
        
        <category>dev-ops</category>
        
        
        <category>tutorial-tips</category>
        
      </item>
    
      <item>
        <title>Liệt kê nhanh các câu truy vấn SQL trong Flarum</title>
        <description>&lt;p&gt;Vừa qua mình có code một dự án với thằng &lt;a href=&quot;http://flarum.org/&quot;&gt;Flarum&lt;/a&gt;. Phải công nhận là thằng này
có nhiều cái hay để mình học hỏi nhưng cũng phải nói là nó vần còn nhiều cái tù
(vì cũng còn đang là beta-6 mà).&lt;/p&gt;

&lt;p&gt;Trong quá trình phát triển, mình cần phải debug với câu truy vấn SQL của nó.
Lúc đầu mình cũng lúng túng, chưa biết làm như nào.&lt;/p&gt;

</description>
        <pubDate>Thu, 19 Jan 2017 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2017-01-19/quickly-dumping-sql-queries-in-flarum.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2017-01-19/quickly-dumping-sql-queries-in-flarum.html</guid>
        
        <category>php</category>
        
        <category>skill</category>
        
        <category>laravel</category>
        
        
        <category>tutorial</category>
        
      </item>
    
      <item>
        <title>Liệt kê nhanh các câu truy vấn trong Laravel</title>
        <description>&lt;p&gt;Khi bạn phát triển một ứng dụng với Laravel (hoặc với Eloquent), rất có thể bạn sẽ gặp một vài vấn đề.
Đó có thể là bạn lấy một bản ghi rồi lấy các bản ghi khác dựa theo kết quả lấy được, …
Hoặc là khi bạn đang sử dụng các truy vấn phức tạp và bạn muốn xem nó đã thực hiện truy vấn như nào đến cơ sở dữ liệu.
Để làm được điều đó thì bạn có thể sử dụng &lt;a href=&quot;https://laravel-news.com/laravel-debugbar/&quot;&gt;Laravel Debugbar&lt;/a&gt;
hoặc &lt;a href=&quot;https://github.com/dmitry-ivanov/laravel-db-profiler&quot;&gt;Laravel database profiler&lt;/a&gt; ở môi truờng phát triển của mình.
Tuy nhiên có 1 cách đơn giản mà không cần cài thêm thư viên gì cả.&lt;/p&gt;

</description>
        <pubDate>Wed, 28 Dec 2016 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2016-12-28/quickly-dumping-laravel-queries.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2016-12-28/quickly-dumping-laravel-queries.html</guid>
        
        <category>php</category>
        
        <category>skill</category>
        
        <category>laravel</category>
        
        
        <category>tutorial</category>
        
      </item>
    
      <item>
        <title>Một vài kinh nghiệm với crontab</title>
        <description>&lt;p&gt;Cron và crontab chắc là không còn xa lạ gì với anh em developers nhà mình rồi đúng ko?
Tuy nhiên để lập lịch cho một công việc hay sửa đổi nó cũng không hề đơn giản, đôi khi
cũng tốn không ít thời gian của anh em. Bản thân mình cũng vậy, nhiều lúc cũng toát
cả mồ hôi. Hôm nay mình chia sẻ với anh em một vài kinh nghiệm khi làm việc với nó.&lt;/p&gt;

</description>
        <pubDate>Sun, 20 Nov 2016 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2016-11-20/some-experience-with-crontab.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2016-11-20/some-experience-with-crontab.html</guid>
        
        <category>skill</category>
        
        <category>dev-ops</category>
        
        
        <category>tutorial-tips</category>
        
      </item>
    
      <item>
        <title>Sử dụng wget để tải một thư mục trên http</title>
        <description>&lt;p&gt;Đôi khi bạn muốn tải về tất cả các tài liệu mà thầy giáo bạn cho dưới dạng một thư mục. 
Bạn đang lay hoay tìm phần mềm để tải về? Tại sao bạn ko thử dùng ngay wget?&lt;/p&gt;

</description>
        <pubDate>Thu, 17 Nov 2016 00:00:00 +0700</pubDate>
        <link>https://oanhnn.com/2016-11-17/using-wget-to-download-a-directory-on-http.html</link>
        <guid isPermaLink="true">https://oanhnn.com/2016-11-17/using-wget-to-download-a-directory-on-http.html</guid>
        
        <category>skill</category>
        
        <category>dev-ops</category>
        
        
        <category>tutorial-tips</category>
        
      </item>
    
  </channel>
</rss>
