Skip to content

Instantly share code, notes, and snippets.

@npearce
npearce / install-docker.md
Last active April 9, 2024 12:48
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
def uncipher(str)
1.upto(26) do |shift|
key = Hash[('a'..'z').zip((97..122).collect{ |i| if (i+shift > 122) then ((i + shift) % 122) + 96 else i+shift end })].merge({' '=>' '.ord,','=>','.ord,'.'=>'.'.ord,'?'=>'?'.ord,'!'=>'!'.ord})
freqs = Hash.new(0)
tmp = str.split('').collect { |letter| switched = (key[letter]).chr; freqs[switched] += 1; switched }
total = 0
freqs.each { |e| total += e[1] }
puts tmp.join if freqs['e']/total.to_f * 100 > 7 and freqs['t']/total.to_f * 100 > 5 # Might want to eventually make more accomodating
end
end
import Data.List
main = print $ length . filter (\x -> sum x `elem` a) . filter (\x -> length x > 1) $ subsequences a
where a = [3, 4, 9, 14, 15, 19, 28, 37, 47, 50, 54, 56, 59, 61, 70, 73, 78, 81, 92, 95, 97, 99]