Skip to content

Instantly share code, notes, and snippets.

@gfrancesco
Last active December 12, 2015 01:48
Show Gist options
  • Save gfrancesco/4693644 to your computer and use it in GitHub Desktop.
Save gfrancesco/4693644 to your computer and use it in GitHub Desktop.
# emerge --sync
# eselect profile set 1
# eselect news read new
# USE="-perl nginx_modules_http_gzip_static -nginx_modules_http_geo -X -alsa -cups -ant -vim" >> /etc/make.conf
# MAKEOPTS="-j1" >> /etc/make.conf
# emerge portage
# emerge eix
# eix-update
# emerge app-misc/screen
# screen -R eme
# emerge -C module-init-tools
# emerge -uDNa --with-bdeps=y world
# echo clock="local" >> /etc/conf.d/hwclock
# nano /etc/locale.gen
# echo 'LANG="en_US.UTF-8"' > /etc/env.d/02locale
# echo 'LC_COLLATE="C"' >> /etc/env.d/02local
# locale-gen
# echo "gem: --no-ri --no-rdoc" > /etc/skel/.gemrc
# echo "umask 002" >> /etc/skel/.bashrc
# echo "export RBENV_ROOT=/usr/local/rbenv" >> /etc/skel/.bashrc
# echo 'export PATH="$RBENV_ROOT/shims:$RBENV_ROOT/bin:$PATH"' >> /etc/skel/.bashrc
# groupadd web, sftponly
# useradd -m -g web -G users,wheel,cron -s /bin/bash your_regular_user
# passwd your_regular_user
# useradd -m -g web -G users,cron -s /bin/bash deployer
# passwd deployer
# useradd -m -g web -G users,[wheel],[sftponly],[cron] -s /bin/bash hosted_site_user
# passwd hosted_site_user
# chgrp root /home/hosted_site_user
# chown root /home/hosted_site_user
# mkdir /home/hosted_site_user/www
# mkdir /home/hosted_site_user/www/app
# chmod g+w /home/hosted_site_user/www/app
# chgrp web /home/hosted_site_user/www/app
# chown hosted_site_user /home/hosted_site_user/www/app
[sftponly] -> add sftp access and blocks remote ssh login
# cp /usr/share/zoneinfo/Europe/Rome /etc/localtime
# echo "Europe/Rome" > /etc/timezone
# netselect -s 3 pool.ntp.org >> /etc/ntp.conf
# emerge nginx sqlite git
# nano /etc/ssh/sshd_config
Subsystem sftp internal-sftp
Match Group sftponly
ChrootDirectory %h/www/
AllowTCPForwarding no
X11Forwarding no
ForceCommand internal-sftp -u 0002
# emerge -a --depclean
# emerge -uDNa --with-bdeps=y world
# revdep-rebuild
# Shared rbenv
# cd /usr/local
# git clone git://github.com/sstephenson/rbenv.git rbenv
# chgrp -R web rbenv/
# chmod g+w rbenv/
# mkdir /usr/local/rbenv/plugins
# cd /usr/local/rbenv/plugins
# git clone git://github.com/sstephenson/ruby-build.git
# chgrp -R web ruby-build
# emerge libyaml
$ rbenv install --list
$ rbenv install 1.9.3-p362
$ rbenv rehash
$ rbenv global 1.9.3-p362
$ gem install bundler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment