- SSH to EC2 then exec
sudo visudo
then add linecentos ALL=(ALL) NOPASSWD:ALL
- exec
sudo su - root
- exec
sudo vi /etc/ssh/sshd_config
then edit/uncomment line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script takes a clean Ubuntu Server 24.04 LTS image and installs and configures | |
# everything needed to deploy a production-ready PostgreSQL server. | |
set -euo pipefail | |
# --- AESTHETICS --- | |
GREEN='\033[0;32m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for contact do |f| %> | |
<% if contact.errors.any? %> | |
<div class="form-errors"> | |
<div class="alert shadow-lg alert-error text-white"> | |
Your form's got some errors | |
</div> | |
</div> | |
<% end %> | |
<%= f.text_field :name, placeholder: "Your first name", class: "input input-bordered w-full max-w-xs my-5" %> | |
<%= inline_error_for(:name, contact) %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
require "net/http" | |
require "uri" | |
# The standard library Net::HTTP module is a bit convoluted, but here is an example of a flexible | |
# system for making different kinds of HTTP requests. To see some convenience methods you can | |
# consult the docs: https://ruby-doc.org/stdlib-2.5.5/libdoc/net/http/rdoc/Net/HTTP.html | |
class HttpConnection | |
def get(url, params = nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// This identifies your website in the createToken call below | |
Stripe.setPublishableKey('da_key'); | |
// ... | |
</script> | |
<script> | |
jQuery(function($) { | |
$('#form').submit(function(event) { | |
var $form = $(this); |
HTML form for file uploads
<!-- in templates/form.html -->
<form action="/upload" method="POST" enctype="multipart/form-data">
<input type="file" name="logo">
<button>Upload</button>
</form>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List of nationalities taken from Gist and Gem converted to yaml and translated: | |
# - https://github.com/JomaMinoza/nationality | |
# - http://www.codegist.net/code/rails-nationality-select/ | |
# - https://gist.github.com/marijn/274449 | |
# - https://gist.github.com/clawfire/5170433 (fr) | |
# | |
# Country: | |
# - https://github.com/stefanpenner/country_select | |
# - https://github.com/hexorx/countries/ | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#List of *hopefuly* all nationalities in list an tuple format for each python copy/paste | |
NATIONALITIES_tuple = ('Afghan', 'Albanian', 'Algerian', 'American', 'Andorran', 'Angolan', 'Antiguans', 'Argentinean', 'Armenian', 'Australian', 'Austrian', 'Azerbaijani', 'Bahamian', 'Bahraini', 'Bangladeshi', 'Barbadian', 'Barbudans', 'Batswana', 'Belarusian', 'Belgian', 'Belizean', 'Beninese', 'Bhutanese', 'Bolivian', 'Bosnian', 'Brazilian', 'British', 'Bruneian', 'Bulgarian', 'Burkinabe', 'Burmese', 'Burundian', 'Cambodian', 'Cameroonian', 'Canadian', 'Cape Verdean', 'Central African', 'Chadian', 'Chilean', 'Chinese', 'Colombian', 'Comoran', 'Congolese', 'Costa Rican', 'Croatian', 'Cuban', 'Cypriot', 'Czech', 'Danish', 'Djibouti', 'Dominican', 'Dutch', 'Dutchman', 'Dutchwoman', 'East Timorese', 'Ecuadorean', 'Egyptian', 'Emirian', 'Equatorial Guinean', 'Eritrean', 'Estonian', 'Ethiopian', 'Fijian', 'Filipino', 'Finnish', 'French', 'Gabonese', 'Gambian', 'Georgian', 'German', 'Ghanaian', 'Greek', 'Grenadian', 'Guate |