Skip to content

Instantly share code, notes, and snippets.

View saadbinakhlaq's full-sized avatar
🕴️
up

Saad saadbinakhlaq

🕴️
up
View GitHub Profile
@saadbinakhlaq
saadbinakhlaq / SSL_CERTBOT.md
Created January 18, 2026 19:49 — forked from HugaidaS/SSL_CERTBOT.md
Install SSL on EC2 with Certbot

This instruction will help you to install SSL certificate on your server using Certbot

1. Create an elastic IP for the EC2 instance you are integrating.

  1. Click Allocate new address in the Elastic IPs page.
  2. Then, click Allocate in the next page.
  3. Right-click the row of the newly created elastic IP, and click Associate address.
  4. Choose the EC2 instance you are integrating.

2. Create a DNS record for the domain you are integrating (GoDaddy in this example).

@saadbinakhlaq
saadbinakhlaq / attachment.rb
Created May 21, 2016 08:52 — forked from madwork/attachment.rb
Polymorphic attachments with CarrierWave and nested_attributes
class Attachment < ActiveRecord::Base
mount_uploader :attachment, AttachmentUploader
# Associations
belongs_to :attached_item, polymorphic: true
# Validations
validates_presence_of :attachment
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8