<commit_before>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generic Kickstart for Ubuntu 14.04 (Trusty Tahr)
# Platform: x86 and x86-64
#  
# Author: <NAME>
#
# Description:
# - Look through config for any changes you want to do.
#
# - You may want to change the initial admin user, or enable root 
#   user to login. current user name is openstack and password is
#   <PASSWORD>, also you may want to change the list of installed 
#  packages. tried to keep it as minimal as possible.
#
# - Place this somewhere that the machine /VM will be able to see.
#   Web server on LAN would be best.
#
# - People setting up in VMware the kernel has support for VMXNET3
#   compiled in so you can use it for initial install.
#
# Usage:
# - Boot up from ISO
# - Press F6 and hit escape so you can edit the boot line. Add the following
#   the end before the ---. For example if you did include the '--' the end 
#   of boot line would be:
#
#       ks=http://your-server/openstack/ubuntu/ks-trusty.cfg --
#
# - That's it!, It will grab an ip via dhcp server on eth0 and setup the system.
#
# References:
# - https://help.ubuntu.com/14.04/installation-guide/amd64/ch04s06.html

# Load the minimal server preseed off cdrom
# This should be done when you following directions above
preseed preseed/file=/cdrom/preseed/ubuntu-server-minimalvm.seed

# System language
lang en_US

# Language modules to install
langsupport en_US

# System keyboard
keyboard us

# System mouse
mouse

# System timezone
timezone Australia/Sydney

# uncomment to disable root user
#rootpw --disabled

# uncomment to enable root login and set password, don't forget to comment rootpw on above
# Encrypted password created with $openssl passwd -1 "password"
rootpw --iscrypted $1$rpIlKEJ5$gv4xcKLjYhlwfLRIfFvKY1

# Initial user (user with sudo capabilities, please change the password before install )
user captainl --fullname "Captain.L" --iscrypted --password <PASSWORD>.

# The user account will be added to some standard initial groups. To 
# override that, use this. 
preseed passwd/user-default-groups string sudo

# Reboot after installation
reboot

# Use text mode install
text

# Install OS instead of upgrade
install

# Installation media
cdrom

# System bootloader configuration
bootloader --location=mbr

# Clear the Master Boot Record
zerombr yes

# Partition clearing information
clearpart --all --initlabel

# Basic disk partition
part / --fstype ext4 --size 1 --grow --asprimary
part swap --size 256

# Advanced partition
#part /boot --fstype=ext4 --size=500 --asprimary
#part pv.aQcByA-UM0N-siuB-Y96L-rmd3-n6vz-NMo8Vr --grow --size=1
#volgroup vg_mygroup --pesize=4096 pv.aQcByA-UM0N-siuB-Y96L-rmd3-n6vz-NMo8Vr
#logvol / --fstype=ext4 --name=lv_root --vgname=vg_mygroup --grow --size=10240 --maxsize=20480
#logvol swap --name=lv_swap --vgname=vg_mygroup --grow --size=1024 --maxsize=8192

# System authorization infomation
auth --useshadow --enablemd5 

# Network information
network --bootproto=dhcp --device=eth0

### Mirror settings 
# If you select ftp, the mirror/country string does not need to be set. 
#d-i mirror/protocol string ftp 
preseed mirror/country string manual 
preseed mirror/http/hostname string au.archive.ubuntu.com 
preseed mirror/http/directory string /ubuntu
preseed mirror/http/proxy string 

# Alternatively: by default, the installer uses CC.archive.ubuntu.com where 
# CC is the ISO-3166-2 code for the selected country. You can preseed this 
# so that it does so without asking. 
preseed mirror/http/mirror select au.archive.ubuntu.com 

### Base system installation 
# Configure APT to not install recommended packages by default. Use of this 
# option can result in an incomplete system and should only be used by very 
# experienced users. 
preseed base-installer/install-recommends boolean false 

# APT setup
# You can choose to install restricted and universe software, or to install 
# software from the backports repository
preseed apt-setup/restricted boolean false
preseed apt-setup/universe boolean true
preseed apt-setup/backports boolean false
# Uncomment this if you don't want to use a network mirror.
preseed apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used. 
# Values shown below are the normal defaults. 
preseed apt-setup/services-select multiselect security 
preseed apt-setup/security_host string au.archive.ubuntu.com 
preseed apt-setup/security_path string /ubuntu 

# Whether to upgrade packages after debootstrap. 
# Allowed values: none, safe-upgrade, full-upgrade 
preseed pkgsel/upgrade select none 

# By default, the system's locate database will be updated after
# installer has finished installing most package, This may take a while, so
# if you don't want it, you can set this to "false" to turn it off
preseed pkgsel/updatedb boolean false

# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
preseed pkgsel/update-policy select none

# Firewall configuration
firewall --disabled --trust=eth0 --ssh 

# Do not configure the X Window System
skipx

# Additional packages to install
%packages
ubuntu-minimal
openssh-server
nano
wget
curl

# Post installation shell commands
%post

## Variables -----------------------------------------------------------------
REPO_URL=${REPO_URL:-"http://www.yongxin.info/projects/captainL"}
BOOTSTRAP=${BOOTSTRAP:-"yes"}
# Ubuntu repos
UBUNTU_RELEASE=$(lsb_release -sc)
UBUNTU_REPO=${UBUNTU_REPO:-"http://au.archive.ubuntu.com/ubuntu"}
UBUNTU_SEC_REPO=${UBUNTU_SEC_REPO:-"http://au.archive.ubuntu.com/ubuntu"}

# Add noatime to /etc/fstab
echo -n "/etc/fstab fixes."
sed -i -e 's/\(errors=remount-ro\)/noatime,\1/' /etc/fstab
sed -i -e 's/\(boot.*defaults\)/\1,noatime,nodev/' /etc/fstab
sed -i -e 's/\(home.*defaults\)/\1,noatime,nodev/' /etc/fstab
sed -i -e 's/\(usr.*defaults\)/\1,noatime,nodev/' /etc/fstab
sed -i '/\/dev\/fd0/d' /etc/fstab
echo .

# Set localhost names
echo "captainl.yongxin.info" > /etc/hostname<commit_msg>update repo_url to Github repository<commit_after>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generic Kickstart for Ubuntu 14.04 (Trusty Tahr)
# Platform: x86 and x86-64
#  
# Author: <NAME>
#
# Description:
# - Look through config for any changes you want to do.
#
# - You may want to change the initial admin user, or enable root 
#   user to login. current user name is openstack and password is
#   <PASSWORD>, also you may want to change the list of installed 
#  packages. tried to keep it as minimal as possible.
#
# - Place this somewhere that the machine /VM will be able to see.
#   Web server on LAN would be best.
#
# - People setting up in VMware the kernel has support for VMXNET3
#   compiled in so you can use it for initial install.
#
# Usage:
# - Boot up from ISO
# - Press F6 and hit escape so you can edit the boot line. Add the following
#   the end before the ---. For example if you did include the '--' the end 
#   of boot line would be:
#
#       ks=http://your-server/openstack/ubuntu/ks-trusty.cfg --
#
# - That's it!, It will grab an ip via dhcp server on eth0 and setup the system.
#
# References:
# - https://help.ubuntu.com/14.04/installation-guide/amd64/ch04s06.html

# Load the minimal server preseed off cdrom
# This should be done when you following directions above
preseed preseed/file=/cdrom/preseed/ubuntu-server-minimalvm.seed

# System language
lang en_US

# Language modules to install
langsupport en_US

# System keyboard
keyboard us

# System mouse
mouse

# System timezone
timezone Australia/Sydney

# uncomment to disable root user
#rootpw --disabled

# uncomment to enable root login and set password, don't forget to comment rootpw on above
# Encrypted password created with $openssl passwd -1 "password"
rootpw --iscrypted $1$rpIlKEJ5$gv4xcKLjYhlwfLRIfFvKY1

# Initial user (user with sudo capabilities, please change the password before install )
user captainl --fullname "Captain.L" --iscrypted --password <PASSWORD>.

# The user account will be added to some standard initial groups. To 
# override that, use this. 
preseed passwd/user-default-groups string sudo

# Reboot after installation
reboot

# Use text mode install
text

# Install OS instead of upgrade
install

# Installation media
cdrom

# System bootloader configuration
bootloader --location=mbr

# Clear the Master Boot Record
zerombr yes

# Partition clearing information
clearpart --all --initlabel

# Basic disk partition
part / --fstype ext4 --size 1 --grow --asprimary
part swap --size 256

# Advanced partition
#part /boot --fstype=ext4 --size=500 --asprimary
#part pv.aQcByA-UM0N-siuB-Y96L-rmd3-n6vz-NMo8Vr --grow --size=1
#volgroup vg_mygroup --pesize=4096 pv.aQcByA-UM0N-siuB-Y96L-rmd3-n6vz-NMo8Vr
#logvol / --fstype=ext4 --name=lv_root --vgname=vg_mygroup --grow --size=10240 --maxsize=20480
#logvol swap --name=lv_swap --vgname=vg_mygroup --grow --size=1024 --maxsize=8192

# System authorization infomation
auth --useshadow --enablemd5 

# Network information
network --bootproto=dhcp --device=eth0

### Mirror settings 
# If you select ftp, the mirror/country string does not need to be set. 
#d-i mirror/protocol string ftp 
preseed mirror/country string manual 
preseed mirror/http/hostname string au.archive.ubuntu.com 
preseed mirror/http/directory string /ubuntu
preseed mirror/http/proxy string 

# Alternatively: by default, the installer uses CC.archive.ubuntu.com where 
# CC is the ISO-3166-2 code for the selected country. You can preseed this 
# so that it does so without asking. 
preseed mirror/http/mirror select au.archive.ubuntu.com 

### Base system installation 
# Configure APT to not install recommended packages by default. Use of this 
# option can result in an incomplete system and should only be used by very 
# experienced users. 
preseed base-installer/install-recommends boolean false 

# APT setup
# You can choose to install restricted and universe software, or to install 
# software from the backports repository
preseed apt-setup/restricted boolean false
preseed apt-setup/universe boolean true
preseed apt-setup/backports boolean false
# Uncomment this if you don't want to use a network mirror.
preseed apt-setup/use_mirror boolean false
# Select which update services to use; define the mirrors to be used. 
# Values shown below are the normal defaults. 
preseed apt-setup/services-select multiselect security 
preseed apt-setup/security_host string au.archive.ubuntu.com 
preseed apt-setup/security_path string /ubuntu 

# Whether to upgrade packages after debootstrap. 
# Allowed values: none, safe-upgrade, full-upgrade 
preseed pkgsel/upgrade select none 

# By default, the system's locate database will be updated after
# installer has finished installing most package, This may take a while, so
# if you don't want it, you can set this to "false" to turn it off
preseed pkgsel/updatedb boolean false

# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
preseed pkgsel/update-policy select none

# Firewall configuration
firewall --disabled --trust=eth0 --ssh 

# Do not configure the X Window System
skipx

# Additional packages to install
%packages
ubuntu-minimal
openssh-server
nano
wget
curl

# Post installation shell commands
%post

## Variables -----------------------------------------------------------------
REPO_URL=${REPO_URL:-"https://raw.githubusercontent.com/GeorgeL1/captainL/master"}
BOOTSTRAP=${BOOTSTRAP:-"yes"}
# Ubuntu repos
UBUNTU_RELEASE=$(lsb_release -sc)
UBUNTU_REPO=${UBUNTU_REPO:-"http://au.archive.ubuntu.com/ubuntu"}
UBUNTU_SEC_REPO=${UBUNTU_SEC_REPO:-"http://au.archive.ubuntu.com/ubuntu"}

# Add noatime to /etc/fstab
echo -n "/etc/fstab fixes."
sed -i -e 's/\(errors=remount-ro\)/noatime,\1/' /etc/fstab
sed -i -e 's/\(boot.*defaults\)/\1,noatime,nodev/' /etc/fstab
sed -i -e 's/\(home.*defaults\)/\1,noatime,nodev/' /etc/fstab
sed -i -e 's/\(usr.*defaults\)/\1,noatime,nodev/' /etc/fstab
sed -i '/\/dev\/fd0/d' /etc/fstab
echo .

# Set localhost names
echo "captainl.yongxin.info" > /etc/hostname
{'fraction_non_alphanumeric': 0.10098187311178247, 'fraction_numerical': 0.013670694864048339, 'mean_word_length': 3.8254373177842567, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 3, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2090445', 'n_tokens_mistral': 4290, 'n_tokens_neox': 4006, 'n_words': 1563}