Skip to content

Instantly share code, notes, and snippets.

View alikhajeh1's full-sized avatar
🌤️

Ali Khajeh-Hosseini alikhajeh1

🌤️
View GitHub Profile
@alikhajeh1
alikhajeh1 / readme.md
Created March 2, 2023 03:16
Example Infracost output
resource "aws_instance" "test_instance" {
  ami           = "ami-123"
  instance_type = "c6i.large"
}

aws_instance.test_instance
 ├─ Instance usage (Linux/UNIX, on-demand, c6i.large)                   730  hours   $62.05 
@alikhajeh1
alikhajeh1 / windows-ssh-keys.md
Created November 8, 2017 15:26
Prerequisites for generating SSH keys on Windows

Creating SSH keys on Windows

  1. Download OpenSSH for Windows and install it.
  2. Setup the environment variables needed to run the SSH Agent by opening a command line shell, and running ssh-agent -s. This will output 2 environment variables that you can set by running set SSH_AUTH_SOCK=value_here and set SSH_AGENT_PID=value_here.
  3. In the command line shell, run ssh-agent to start the SSH Agent.
@alikhajeh1
alikhajeh1 / example
Last active August 29, 2015 14:20
CA API example
See the API docs at http://reference.rightscale.com/cloud_analytics/analytics_api/index.html for login details
# Getting a list of available Filters. These filters can be used to create Scheduled Reports, Budget Alerts etc.
curl -G https://analytics.rightscale.com/api/instances/actions/filter_options \
-H X-Api-Version:1.0 \
-H Content-Type:application/json \
-b rightscalecookies \
-d start_time=2015-04-01 \
-d end_time=2015-05-06 \
-d filter_types[]=instance:account_id \
@alikhajeh1
alikhajeh1 / Gemfile
Created March 12, 2013 22:29
Rake task to convert a Postgres DB to a MySQL DB using the taps gem (https://github.com/ricardochimal/taps)
# Gems needed to convert a Postgres DB to MySQL
gem 'pg', '~> 0.14.0'
gem 'mysql2', '~> 0.3.11'
gem 'taps', '~> 0.3.24'
gem 'sqlite3', '~> 1.2'
@alikhajeh1
alikhajeh1 / s3_website.rake
Created April 23, 2012 13:36
Rake task to upload static website to AWS S3 using the s3cmd command-line tool
require 'fileutils'
OUT_DIR = 'public'
desc 'Prepare and upload the static site to S3'
task :upload, [:name] do |t, args|
raise Exception.new('You must provide the name of site to upload to, e.g., be rake upload[www]') unless args[:name]
puts "Removing existing output directory"
FileUtils.rm_rf OUT_DIR if File.exists?(OUT_DIR)
@alikhajeh1
alikhajeh1 / PostRequest.txt
Created February 1, 2012 16:19
Web App Experiment Post Request
Request URL:http://localhost:3000/videos
Request Method:POST
Status Code:302 Found
Request Headersview parsed
POST /videos HTTP/1.1
Host: localhost:3000
Connection: keep-alive
Content-Length: 707456
Cache-Control: max-age=0
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
@alikhajeh1
alikhajeh1 / New.html
Created February 1, 2012 16:10
Web App Experiment New Page, GET /videos/new returns this page
<!DOCTYPE html>
<html>
<head>
<title>MyApp</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/twitter/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/scaffolds.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/videos.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
@alikhajeh1
alikhajeh1 / Show.html
Created February 1, 2012 16:06
Web App Experiment Show Page, GET /videos/ID returns this page
<!DOCTYPE html>
<html>
<head>
<title>MyApp</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/twitter/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/scaffolds.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/videos.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
@alikhajeh1
alikhajeh1 / index.html
Created February 1, 2012 16:02
Web App Experiment Index Page, GET /videos returns this page
<!DOCTYPE html>
<html>
<head>
<title>MyApp</title>
<link href="/assets/application.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/twitter/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/scaffolds.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/videos.css?body=1" media="all" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>