Skip to content

Instantly share code, notes, and snippets.

@mattsve
Last active March 19, 2018 20:14
Show Gist options
  • Save mattsve/bdfc2566c7065fff8fd1 to your computer and use it in GitHub Desktop.
Save mattsve/bdfc2566c7065fff8fd1 to your computer and use it in GitHub Desktop.
Freebsd
#!/bin/sh
# sysctls for jail needs to be
# allow.raw_sockets=true,allow.sysvipc=1
# Enable sshd
sed -i .bak 's/sshd_enable="NO"/sshd_enable="YES"/' /etc/rc.conf
rm /etc/rc.conf.bak
# Add sudo
pkg install sudo
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /usr/local/etc/sudoers
# syncthing
pkg install syncthing
echo 'syncthing_enable="YES"' >> /etc/rc.conf
echo 'syncthing_dir="/mnt/syncthing"' >> /etc/rc.conf
# tmux
pkg install tmux
# postgresql
pkg install postgresql94-server
echo 'postgresql_enable="YES"' >> /etc/rc.conf
/usr/local/etc/rc.d/postgresql initdb
echo 'host all all 10.1.0.0/16 md5' >> /usr/local/pgsql/data/pg_hba.conf
sed -i .bak "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /usr/local/pgsql/data/postgresql.conf
rm /usr/local/pgsql/data/postgresql.conf.bak
#telldus
pkg install telldus-core
echo 'telldusd_enable="YES"' >> /etc/rc.conf
echo 'controller {' >> /usr/local/etc/tellstick.conf
echo ' id = 1' >> /usr/local/etc/tellstick.conf
echo ' # name = ""' >> /usr/local/etc/tellstick.conf
echo ' type = 2' >> /usr/local/etc/tellstick.conf
echo ' serial = "A501WG4C"' >> /usr/local/etc/tellstick.conf
echo '}' >> /usr/local/etc/tellstick.conf
echo 'deviceNode = "/dev/tellstick"' >> /usr/local/etc/tellstick.conf
#devel
pkg install gcc
pkg install python2
# need to build because link to postgresql93
pkg install py27-setuptools27
portsnap fetch extract
cd /usr/ports/databases/py-psycopg2/
make install clean
# pkg install py27-psycopg2
pkg install py27-pytz
pkg install py27-matplotlib
#!/bin/sh
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# weather_enable (bool): Set to NO by default.
# Set it to YES to enable weather.
. /etc/rc.subr
name=weather
rcvar=weather_enable
load_rc_config $name
: ${weather_enable:="NO"}
pidfile=/var/run/weather.pid
procname="/usr/local/bin/weather"
command="/usr/sbin/daemon"
command_args="-f -r -P ${pidfile} ${procname}"
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment