Skip to content

Instantly share code, notes, and snippets.

@froop
Last active December 23, 2021 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save froop/224549dad2a39c584b571ee16ca66142 to your computer and use it in GitHub Desktop.
Save froop/224549dad2a39c584b571ee16ca66142 to your computer and use it in GitHub Desktop.
[Linux][EC2] CentOS 7環境構築
#cloud-config
timezone: Asia/Tokyo
runcmd:
- cd /home/centos
- curl -L -o init-os.sh https://gist.github.com/froop/224549dad2a39c584b571ee16ca66142/raw/init-centos7-ec2.sh
- chmod +x init-os.sh
- ./init-os.sh
- rm init-os.sh
#!/bin/bash -eu
# swap file
dd if=/dev/zero of=/swapfile bs=128M count=8
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo '/swapfile swap swap defaults 0 0' >> /etc/fstab
#localectl set-locale LANG=ja_JP.UTF-8
#timedatectl set-timezone Asia/Tokyo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment