sdcard and local now match.

This commit is contained in:
root 2017-09-27 13:54:34 +01:00
parent f4f4e73e44
commit 28bd72f099
45 changed files with 1241 additions and 44 deletions

59
001-udev-rules.sh Normal file
View File

@ -0,0 +1,59 @@
cat > /etc/udev/rules.d/99-saleae-logic.rules << 'EOF'
# Rules for the Saleae Logic analyzer to allow to run the programs a normal user
# being part of the plugdev group. Simply copy the file to /etc/udev/rules.d/
# and plug the device
BUS!="usb", ACTION!="add", SUBSYSTEM!=="usb_device", GOTO="saleae_logic_rules_end"
# Saleae Logic analyzer (USB Based)
# Bus 006 Device 006: ID 0925:3881 Lakeview Research
# Bus 001 Device 009: ID 21a9:1004 Product: Logic S/16, Manufacturer: Saleae LLC
ATTRS{idVendor}=="0925", ATTRS{idProduct}=="3881", MODE="664", GROUP="plugdev"
ATTRS{idVendor}=="21a9", ATTRS{idProduct}=="1004", MODE="664", GROUP="plugdev"
LABEL="saleae_logic_rules_end"
EOF
cat > /etc/udev/rules.d/99-xf2-logic.rules << 'EOF'
SUBSYSTEM!="usb", GOTO="fx2-probe--programming_rules_end"
ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", MODE="0664", GROUP="plugdev"
LABEL="fx2-probe--programming_rules_end"
EOF
echo 'blacklist usbtest' >> /etc/modprobe.d/blacklist.conf
cat > /etc/udev/rules.d/60-blackmagic-probe.rules << 'EOF'
SUBSYSTEM!="usb", GOTO="blackmagic-probe-programming_rules_end"
ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="6017", MODE="0666", GROUP="plugdev"
LABEL="blackmagic-probe-programming_rules_end"
EOF
cat > /etc/udev/rules.d/60-st-linkv2.rules << 'EOF'
## Now in stlink-utils 49-stlinkv2.rules
#SUBSYSTEM!="usb", GOTO="st-link-v2-programming_rules_end"
#
#ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE="0666", GROUP="plugdev"
#
#LABEL="st-link-v2-programming_rules_end"
EOF
cat > /etc/udev/rules.d/60-cp210x.rules << 'EOF'
# udev rules file for CP210x device to be programmable py
# cp210x-program
SUBSYSTEM!="tty", GOTO="cp210x-programming_rules_end"
ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA60", MODE="0666", GROUP="plugdev"
ATTRS{idVendor}=="10C4", ATTRS{idProduct}=="EA61", MODE="0666", GROUP="plugdev"
LABEL="cp210x-programming_rules_end"
EOF
cat > /etc/udev/rules.d/81-thinkpad-dock.rules << 'EOF'
KERNEL=="dock.0", ACTION=="change", RUN+="/usr/local/sbin/thinkpad-dock.sh"
EOF

View File

@ -45,6 +45,21 @@ deb-src http://auto.mirror.devuan.org/merged/ ascii-updates main
EOF
sudo bash -c "cat > /etc/apt/sources.list.d/devuan_beowulf.list" <<'EOF'
# deb http://us.mirror.devuan.org/merged/ beowulf main
deb http://auto.mirror.devuan.org/merged/ beowulf main
deb-src http://auto.mirror.devuan.org/merged/ beowulf main
# beowulf-security, previously known as 'volatile'
deb http://auto.mirror.devuan.org/merged/ beowulf-security main
deb-src http://auto.mirror.devuan.org/merged/ beowulf-security main
# ascii-updates, previously known as 'volatile'
deb http://auto.mirror.devuan.org/merged/ beowulf-updates main
deb-src http://auto.mirror.devuan.org/merged/ beowulf-updates main
EOF
sudo bash -c "cat > /etc/apt/sources.list.d/devuan_ceres.list" <<'EOF'
# deb http://us.mirror.devuan.org/merged/ ceres main

View File

@ -1,4 +1,4 @@
## Docker likes kernel swappiness support (on reboot)
#sudo bash -c `perl -p -i -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"/g' /etc/default/grub`
Now that your server supports swap limit capabilities in your docker run command you can use --memory-swappiness=0 and set --memory-swap equal to --memory. You also need to set -Des.bootstrap.mlockall=true.
#Now that your server supports swap limit capabilities in your docker run command you can use --memory-swappiness=0 and set --memory-swap equal to --memory. You also need to set -Des.bootstrap.mlockall=true.

View File

@ -9,6 +9,7 @@ rm -r ~/.config/pulse
sudo rm -rf /tmp/pulse*
sudo apt-get -y install alsa-base alsa-tools alsa-tools-gui alsa-utils alsa-oss alsamixergui libalsaplayer0
sudo apt-get -y install pnmixer
sudo /etc/init.d/alsa-utils restart

View File

@ -1,6 +1,9 @@
sudo apt-get -y install curl apt-file
sudo apt-get -y install xclip
sudo apt-get -y install sshpass
sudo apt-get -y install git
sudo apt-get -y install meld
sudo apt-get -y install gitk
sudo apt-get -y install zsync
sudo apt-get -y install jq
sudo apt-get -y install pv

115
010_saltstack.sh Normal file
View File

@ -0,0 +1,115 @@
# Install salt
# ascii/stretch version 2016.11.2+ds-1
# ceres version 2017.7.1+ds-1
# saltstack repo version 2017.7.1+ds-1
# Jessie
# Pin to minor release
# wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main
# Pin to major version
# wget -O - https://repo.saltstack.com/apt/debian/8/amd64/2017.7/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# deb http://repo.saltstack.com/apt/debian/8/amd64/2017.7 jessie main
# Pin to latest release
# wget -O - https://repo.saltstack.com/apt/debian/8/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# deb http://repo.saltstack.com/apt/debian/8/amd64/latest jessie main
# Stretch
# Pin to minor release
# wget -O - https://repo.saltstack.com/apt/debian/9/amd64/archive/2017.7.1/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# deb http://repo.saltstack.com/apt/debian/9/amd64/archive/2017.7.1 stretch main
# Pin to major version
# wget -O - https://repo.saltstack.com/apt/debian/9/amd64/2017.7/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# deb http://repo.saltstack.com/apt/debian/9/amd64/2017.7 stretch main
# Pin to latest release
# wget -O - https://repo.saltstack.com/apt/debian/9/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# deb http://repo.saltstack.com/apt/debian/9/amd64/latest stretch main
DEBIAN_VERSION=8
DEBIAN_RELEASE=jessie
#DEBIAN_VERSION=9
#DEBIAN_RELEASE=stretch
SALT_VERSION=2016.3
SALT_VERSION=2016.11
SALT_VERSION=2017.7
SALT_VERSION=archive/2017.7.1
SALT_VERSION=latest
REFRESHED_AT=2017-09-31
mkdir -p /etc/apt/sources.list-available
#sudo bash -c "wget -q -O- "http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key" | apt-key add -"
wget -O - https://repo.saltstack.com/apt/debian/${DEBIAN_VERSION}/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
# NB Packages now have dh-systemd deps and --with-systemd treat as debian upstream
echo "#wget -O - https://repo.saltstack.com/apt/debian/${DEBIAN_VERSION}/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -" >> /etc/apt/sources.list-available/saltstack-${DEBIAN_RELEASE}.list
echo "deb http://repo.saltstack.com/apt/debian/${DEBIAN_VERSION}/amd64/${SALT_VERSION} ${DEBIAN_VERSION} main" > /etc/apt/sources.list-available/saltstack-${DEBIAN_RELEASE}.list
#ln -s /etc/apt/sources.list-available/saltstack-${DEBIAN_RELEASE}.list /etc/apt/sources.list.d/saltstack-${DEBIAN_RELEASE}.list
# Upgrade The System
apt-get update && apt-get upgrade -y -o DPkg::Options::=--force-confold
# salt-api - Generic, modular network access system
# salt-cloud - public cloud VM management system
# salt-common - shared libraries that salt requires for all packages
# salt-doc - additional documentation for salt, the distributed remote execution system
# salt-master - remote manager to administer servers via salt
# salt-minion - client package for salt, the distributed remote execution system
# salt-proxy - Proxy client package for salt stack
# salt-ssh - remote manager to administer servers via Salt SSH
# salt-syndic - master-of-masters for salt, the distributed remote execution system
# salt-formula-kubernetes - Salt formula for Kubernetes
# salt-formula-ceilometer - Salt formula for OpenStack Ceilometer
# salt-formula-cinder - Salt formula for OpenStack Cinder
# salt-formula-glance - Salt formula for OpenStack Glance
# salt-formula-heat - Salt formula for OpenStack Heat
# salt-formula-horizon - Salt formula for OpenStack Horizon
# salt-formula-keystone - Salt formula for OpenStack Keystone
# salt-formula-neutron - Salt formula for OpenStack Neutron
# salt-formula-nova - Salt formula for OpenStack Nova
# salt-formula-swift - Salt formula for OpenStack Swift
# Install Salt Dependencies
apt-get install -y -o DPkg::Options::=--force-confold \
python \
apt-utils \
python-software-properties \
software-properties-common \
python-yaml \
python-m2crypto \
python-crypto \
python-msgpack \
python-zmq \
python2.7-doc \
python-jinja2 \
python-requests
sudo apt-get -y install salt-client
# Salt-master
apt-get install -yq -o -o DPkg::Options::=--force-confold --no-install-recommends \
salt-master \
salt-api \
salt-ssh \
salt-syndic \
salt-cloud \
reclass \
python-apt \
python-git \
python-openssl \
python-cherrypy3 \
git \
openssh-client \
make
# Or get the development version
# apt-get upgrade -y -o DPkg::Options::=--force-confold && \
# apt-get install -y -o DPkg::Options::=--force-confold curl
# curl -L https://bootstrap.saltstack.com | sh -s -- -X git develop

8
010_sysctl.sh Normal file
View File

@ -0,0 +1,8 @@
# vm.swappiness (tendency to use swap,
# vm.vfs_cache_pressure (tendency to reclaim swap space back to memory
# vfs_cache_pressure value larger than 100 may negative performance impact: https://www.kernel.org/doc/Documentation/sysctl/vm.txt
cat > /etc/sysctl.d/01-local.conf << 'EOF'
vm.max_map_count=262144
vm.swappiness=1
vm.vfs_cache_pressure=50
EOF

View File

@ -4,4 +4,8 @@ apt-get install -y initramfs-tools dh-autoreconf
apt-get install -y spl spl-dkms
apt-get install -y zfs-dkms zfs-initramfs
apt-get install -y zfs-zed
# linux default, mount partitions even if non-empty, the no option really only makes sense if the directory being mounted on has been declared as a mount point only and is therefore guaranteed to be empty.
sed -i "s,^\(DO_OVERLAY_MOUNTS=\).*,\1\'yes\'," /etc/default/zfs
modprobe zfs

18
020_arduino.sh Normal file
View File

@ -0,0 +1,18 @@
cd /var/tmp
#ARDUINO_VERSION=1.8.3
ARDUINO_VERSION=nightly
wget -c https://downloads.arduino.cc/arduino-${ARDUINO_VERSION}-linux64.tar.xz && \
cd /opt && \
tar xf /var/tmp/arduino-${ARDUINO_VERSION}-linux64.tar.xz
sudo usermod -a -G dialout $USER && \
sudo apt-get install git python-serial
mkdir -p ~/Arduino/hardware/espressif && \
cd ~/Arduino/hardware/espressif && \
git clone https://github.com/espressif/arduino-esp32.git esp32 && \
cd esp32/tools/ && \
python get.py

90
020_chrome-browser.sh Normal file
View File

@ -0,0 +1,90 @@
wget -c --directory-prefix=/var/tmp https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i /var/tmp/google-chrome-stable_current_amd64.deb
apt-get -f install
apt-get autoremove
apt-get clean
# The post install script does a few things that assume installing chrome means you want it as
# the default browser and that it should auto update whenever it sees fit.
#Setting up google-chrome-stable (61.0.3163.100-1) ...
#update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
#update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
#update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
#sudo update-alternatives --query x-www-browser
#
#Name: x-www-browser
#Link: /usr/bin/x-www-browser
#Slaves:
# x-www-browser.1.gz /usr/share/man/man1/x-www-browser.1.gz
#Status: auto
#Best: /usr/bin/google-chrome-stable
#Value: /usr/bin/google-chrome-stable
#
#Alternative: /usr/bin/firefox-esr
#Priority: 70
#Slaves:
# x-www-browser.1.gz /usr/share/man/man1/firefox-esr.1.gz
#
#Alternative: /usr/bin/google-chrome-stable
#Priority: 200
#Slaves:
# Lets undo this:
PRIORITY=50
update-alternatives --install /usr/bin/x-www-browser x-www-browser \
/usr/bin/google-chrome-stable $PRIORITY
update-alternatives --install /usr/bin/gnome-www-browser gnome-www-browser \
/usr/bin/google-chrome-stable $PRIORITY
update-alternatives --install /usr/bin/google-chrome google-chrome \
/usr/bin/google-chrome-stable $PRIORITY
#----
# The post install script removes previous sources.list
#apt-config shell APT_SOURCEDIR 'Dir::Etc::sourceparts/d'
#APT_SOURCEDIR='/etc/apt/sources.list.d/'
# rm -f "$APT_SOURCESDIR/google-chrome.list" \
# "$APT_SOURCESDIR/google-chrome-stable.list"
# Don't do anything if the file isn't there, since that probably means the
# user disabled it.
rm -rf /etc/apt/sources.list.d/google-chrome.list
cat > /etc/apt/sources.list.d-available/google-chrome-stable.list << EOF
# wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
EOF
ln -sf /etc/apt/sources.list.d-available/google-chrome-stable.list /etc/apt/sources.list.d/google-chrome-stable.list
#----
#if [ ! -e "$DEFAULTS_FILE" ]; then
# echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
# echo 'repo_reenable_on_distupgrade="true"' >> "$DEFAULTS_FILE"
#fi
#
#cat /etc/default/google-chrome
#repo_add_once="false"
#repo_reenable_on_distupgrade="true"
DEFAULTS_FILE="/etc/default/google-chrome"
sed -i -e 's/^repo_add_once=.*$/repo_add_once=\"false\"/' ${DEFAULTS_FILE}
sed -i -e 's/^repo_reenable_on_distupgrade=.*$/repo_reenable_on_distupgrade=\"false\"/' ${DEFAULTS_FILE}
#----
# Remove daily cron optional with above changes to default
# It creates the repository configuration file for package updates, and it
# monitors that config to see if it has been disabled by the overly aggressive
# distro upgrade process (e.g. intrepid -> jaunty). When this situation is
# detected, the respository will be re-enabled. If the respository is disabled
# for any other reason, this won't re-enable it.
#
# This functionality can be controlled by creating the $DEFAULTS_FILE and
# setting "repo_add_once" and/or "repo_reenable_on_distupgrade" to "true" or
# "false" as desired. An empty $DEFAULTS_FILE is the same as setting both values
# to "false".
#rm /etc/cron.daily/google-chrome

View File

@ -1,10 +1,15 @@
sudo apt-get install conky-all
sudo apt-get -y install conky-all
mkdir -p ~/.conkyrc.d
#wget -q0- -O /tmp/tmp.zip https://dl.opendesktop.org/api/files/download/id/1465391516/137272-conky_grey.zip && unzip /tmp/tmp.zip && rm /tmp/tmp.zip
wget -qO- -O /tmp/tmp.tar.gz http://downloads.sourceforge.net/project/auroraconkytheme/Aurora_v3.0.4.tar.gz && tar xzvf /tmp/tmp.tar.gz && rm /tmp/tmp.tar.gz
wget -qO- -O /var/tmp/aurora.tar.gz http://downloads.sourceforge.net/project/auroraconkytheme/Aurora_v3.0.4.tar.gz && tar xzvf /var/tmp/aurora.tar.gz && mv Aurora/ ~/.conkyrc.d && rm /var/tmp/aurora.tar.gz
cd /tmp
git clone https://github.com/maxiwell/conky-seamod
apt-get install -y lm-sensors hddtemp dmidecode
chmod u+s /usr/sbin/hddtemp
chmod u+s /usr/sbin/dmidecode

27
020_console.sh Normal file
View File

@ -0,0 +1,27 @@
# dpkg-reconfigure console-setup
# Original settings
# sed -i 's,^\(ACTIVE_CONSOLES=\).*,\1'\"/dev/tty\[1-6\]\"',' /etc/default/console-setup
# sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
# sed -i 's,^\(CODESET=\).*,\1'\"Lat15\"',' /etc/default/console-setup
# sed -i 's,^\(FONTFACE=\).*,\1'\"Fixed\"',' /etc/default/console-setup
# sed -i 's,^\(FONTSIZE=\).*,\1'\"8x16\"',' /etc/default/console-setup
# sed -i 's,^\(VIDEOMODE=\).*,\1'\"\"',' /etc/default/console-setup
# Terminus - Uni2-Terminus16.psf.gz
#sed -i 's,^\(ACTIVE_CONSOLES=\).*,\1'\"/dev/tty\[1-6\]\"',' /etc/default/console-setup
#sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
#sed -i 's,^\(CODESET=\).*,\1'\"guess\"',' /etc/default/console-setup
#sed -i 's,^\(FONTFACE=\).*,\1'\"Terminus\"',' /etc/default/console-setup
#sed -i 's,^\(FONTSIZE=\).*,\1'\"8x16\"',' /etc/default/console-setup
#sed -i 's,^\(VIDEOMODE=\).*,\1'\"\"',' /etc/default/console-setup
# Powerline - ter-powerline-v16b.psf.gz
wget -c --directory-prefix /usr/share/fonts/PSF https://github.com/powerline/fonts/raw/master/Terminus/PSF/ter-powerline-v16b.psf.gz
sed -i 's,^\(ACTIVE_CONSOLES=\).*,\1'\"/dev/tty\[1-6\]\"',' /etc/default/console-setup
sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
sed -i 's,^\(CODESET=\).*,\1'\"guess\"',' /etc/default/console-setup
sed -i 's,^\(FONTFACE=\).*,\1'\"Terminess Powerline\"',' /etc/default/console-setup
sed -i 's,^\(FONTSIZE=\).*,\1'\"8x16\"',' /etc/default/console-setup
sed -i 's,^\(VIDEOMODE=\).*,\1'\"\"',' /etc/default/console-setup
echo "FONT=/usr/share/fonts/PSF/ter-powerline-v16b.psf" >> /etc/default/console-setup

View File

@ -1 +1,47 @@
apt-get install djmount
DJMOUNT_DIR=~/dlna
mkdir -p ${DJMOUNT_DIR}
bash -c "cat > ~/.config/autostart/djmount.desktop" <<EOF
[Desktop Entry]
Encoding=UTF-8
Version=0.71
Type=Application
Name=djmount
Comment=UPNP/DLNA mount
Exec=sh -c "/usr/bin/djmount ${DJMOUNT_DIR}"
StartupNotify=false
Terminal=false
Hidden=false
EOF
chmod +x ~/.config/autostart/djmount.desktop
bash -c "cat > /usr/share/applications/djmount.desktop" <<EOF
[Desktop Entry]
Encoding=UTF-8
Version=0.71
Type=Application
Name=djmount
Comment=UPNP/DLNA
Exec=sh -c "/usr/bin/djmount ${DJMOUNT_DIR}"
StartupNotify=false
Terminal=false
Hidden=false
EOF
#chmod +x /usr/share/applications/djmount.desktop
bash -c "cat > ~/.local/share/applications/djmount.desktop" <<EOF
[Desktop Entry]
Encoding=UTF-8
Version=0.71
Type=Application
Name=djmount
Comment=UPNP/DLNA
Exec=sh -c "/usr/bin/djmount ${DJMOUNT_DIR}"
StartupNotify=false
Terminal=false
Hidden=false
EOF
chmod +x ~/.local/share/applications/djmount.desktop

1
020_dmesg.sh Normal file
View File

@ -0,0 +1 @@
echo "kernel.dmesg_restrict=0" > /etc/sysctl.d/10-dmesg.conf

View File

@ -3,18 +3,134 @@
#sudo bash -c "apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D"
sudo apt-get update
sudo apt-get -y install -q --no-install-recommends curl ca-certificates
sudo apt-get -y install --force-yes docker-engine
#sudo apt-get install -y --force-yes docker-engine=1.9.1-0~jessie
sudo mkdir -p /var/lib/docker
sudo umount /dev/mapper/vg_prime-varLibDockerLV
sudo mount /dev/mapper/vg_prime-varLibDockerLV /var/lib/docker
#sudo mkdir -p /var/lib/docker
#sudo umount /dev/mapper/vg_prime-varLibDockerLV
#sudo mount /dev/mapper/vg_prime-varLibDockerLV /var/lib/docker
sudo touch /etc
sudo bash -c `perl -p -i -e 's/#DOCKER_OPTS=""/DOCKER_OPTS="--restart=true"/g' /etc/default/docker`
sudo bash -c `sed -i "s/DOCKER_OPTS=\"\(.*\)\"/DOCKER_OPTS=\"\1 --storage-driver=zfs\"/" /etc/default/docker`
sudo bash -c `sed -i "s/DOCKER_OPTS=\"\(.*\)\"/DOCKER_OPTS=\"\1 --dns 8.8.8.8 --dns 8.8.4.4\"/" /etc/default/docker`
sudo bash -c `sed -i "s/DOCKER_OPTS=\"\(.*\)\"/DOCKER_OPTS=\"\1 zfs.fsname=rpool/docker\"/" /etc/default/docker`
# i2p container requires ipv6
sudo bash -c `sed -i "s/DOCKER_OPTS=\"\(.*\)\"/DOCKER_OPTS=\"\1 --ipv6\"/" /etc/default/docker`
# The above can also be passed in /etc/docker/daemon.json
# For other options:
# https://github.com/moby/moby/pull/23657/files?short_path=ca4f406
# https://gist.github.com/lvdh/1f2d50ad49274413d3e501b71a59e819
if [ ! -f /etc/docker/daemon.json ]
then
touch /etc/docker/daemon.json
echo "{}" > /etc/docker/daemon.json
else
echo "/etc/docker/daemon.json exits."
fi
DOCKER_OPT[0]='.["dns"] = ["8.8.8.8","8.8.4.4"]'
DOCKER_OPT[1]='.["storage-driver"] = "zfs"'
DOCKER_OPT[2]='.["storage-opts"] = ["zfs.fsname=rpool/docker","size=256"]'
for ((i = 0; i < ${#DOCKER_OPT[@]}; ++i)); do
OPTION="${DOCKER_OPT[$i]}"
jq "${OPTION}" /etc/docker/daemon.json > /tmp/daemon.json.new && \
mv -b /tmp/daemon.json.new /etc/docker/daemon.json
done
# General options
# Adding a personal registry.
DOCKER_OPT[0]='.["insecure-registries"] = ["mydocker-registry.net:5000"]'
# Allow live restore, keep containers alive when the daemon becomes unavailable.
# Not compatible with swarm mode.
DOCKER_OPT[1]='.["live-restore"] = ["true"]'
# Debugging on
DOCKER_OPT[2]='.["debug"] = ["true"]'
# IPv6 for i2p container
DOCKER_OPT[3]='["ipv6"] = ["true"]'
# Logging options
DOCKER_OPT[4]='.["log-driver"] = ["syslog"]'
#DOCKER_OPT[4]='.["log-opts"] = ["syslog-address","udp://1.2.3.4:1111"]'
for ((i = 0; i < ${#DOCKER_OPT[@]}; ++i)); do
OPTION="${DOCKER_OPT[$i]}"
jq "${OPTION}" /etc/docker/daemon.json > /tmp/daemon.json.new && \
mv -b /tmp/daemon.json.new /etc/docker/daemon.json
done
# Add tls - we keep the keys on the docker zfs dataset not /etc/docker/tls
DOCKER_OPT[0]='.["tls"] = ["true"]'
DOCKER_OPT[1]='.["tlscacert"] = ["/var/lib/docker/ca.pem"]'
DOCKER_OPT[2]='/["tlscert"] = ["/var/lib/docker/server.pem"]'
DOCKER_OPT[3]='.["tlskey"] = ["/var/lib/docker/serverkey.pem"]'
DOCKER_OPT[4]='.["tlsverify"] = ["true"]'
DOCKER_OPT[5]='.["hosts"] = ["tcp://192.168.59.3:2376"]'
for ((i = 0; i < ${#DOCKER_OPT[@]}; ++i)); do
OPTION="${DOCKER_OPT[$i]}"
jq "${OPTION}" /etc/docker/daemon.json > /tmp/daemon.json.new && \
mv -b /tmp/daemon.json.new /etc/docker/daemon.json
done
# Something similar to set up a swarm
DOCKER_OPT[0]='.["cluster-advertise"] = "192.168.1.116:12376"'
DOCKER_OPT[1]='.["cluster-store"] = "etcd://192.168.1.116:12379"'
DOCKER_OPT[2]='.["cluster-store-opts"] = { "kv.cacertfile" : "/var/lib/docker/discovery_certs/ca.pem", "kv.certfile" : "/var/lib/docker/discovery_certs/cert.pem", "kv.keyfile" : "/var/lib/docker/discovery_certs/key.pem" }'
for ((i = 0; i < ${#DOCKER_OPT[@]}; ++i)); do
OPTION="${DOCKER_OPT[$i]}"
jq "${OPTION}" /etc/docker/daemon.json > /tmp/daemon.json.new && \
mv -b /tmp/daemon.json.new /etc/docker/daemon.json
done
sudo /etc/init.d/docker restart
sudo dpkg -i /var/tmp/docker-compose/docker-compose_1.11.0-1_amd64.deb
#sudo dpkg -i /var/tmp/docker-compose/docker-compose_1.11.0-1_amd64.deb
LATEST_URL=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep docker-compose-$(uname -s)-$(uname -m))
RELEASE=$(echo ${LATEST_URL} | awk '{split($0,a,"/"); print a[8]}')
# make a containing directory
mkdir -p /var/tmp/docker-compose-${RELEASE}
cd /var/tmp/docker-compose-${RELEASE}
cat > ./description-pak << EOF
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a Compose file to configure your applications services. Then, using a single command, you create and start all the services from your configuration.
EOF
cat > ./checkinstall_it.sh << EOF
set +x
#
LATEST_URL=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep browser_download_url | cut -d '"' -f 4 | grep docker-compose-$(uname -s)-$(uname -m))
RELEASE=$(echo ${LATEST_URL} | awk '{split($0,a,"/"); print a[8]}')
LICENSE_URL='https://raw.githubusercontent.com/docker/compose/master/LICENSE'
wget -c ${LICENSE_URL}
# make a new temporary directory for this use
BASE_TMP_DIR=~/tmptmp/checkinstall_tmp
mkdir -p ${BASE_TMP_DIR}
# do your work
sudo checkinstall -y --fstrans \
--pkgname=docker-compose \
--pkgversion=${RELEASE} \
--pkgrelease=1 \
--pkgarch=amd64 \
--pkggroup=admin \
--pkglicense=LICENSE \
--pkgsource=${LATEST_URL} \
--maintainer=cyteen@ring-zero.co.uk \
--requires=docker-engine \
-D \
bash ./install.sh
EOF
cat > ./install.sh << EOF
set +x
# Download and copy the latest version to /usr/local/bin and make executable
curl -o /usr/local/bin/docker-compose -L https://api.github.com/repos/docker/compose/releases/latest && chmod +x /usr/local/bin/docker-compose
EOF
sudo bash -c ./checkinstall_it.sh

View File

@ -1,6 +1,9 @@
# https://www.openprinting.org/driver/epson-201106w/
DRIVER_VERSION=1.0.1-1lsb3.2
apt-get -y install lsb
wget -c --directory-prefix /var/tmp http://download.ebz.epson.net/dsc/op/stable/debian/dists/lsb3.2/main/binary-amd64/epson-inkjet-printer-201106w_${DRIVER_VERSION}_amd64.deb
dpkg -i /var/tmp/epson-inkjet-printer-201106w_${DRIVER_VERSION}_amd64.deb

View File

@ -65,4 +65,10 @@ end
alias subl "subl3"
alias vim "nvim"
set fish_function_path $fish_function_path "/usr/share/powerline/bindings/fish"
powerline-setup.fish
EOF
echo 'set fish_function_path $fish_function_path "/usr/share/powerline/bindings/fish"' >> ~/.config/fish/config.fish
echo 'powerline-setup.fish' >> ~/.config/fish/config.fish

View File

@ -1,4 +1,7 @@
sudo apt-get -y install free42-nologo
mkdir -p ~/.free42/
touch ~/.free42/print
touch ~/.free42/state
echo "0x00, 0x00, 0x00, 0x00, 0x0a" | xxd -r -p ~/.free42/print
echo "
0x32, 0x34, 0x6b, 0x46, 0x11, 0x00, 0x00, 0x00, 0x2c, 0x03, 0x00, 0x00,
@ -305,3 +308,16 @@ echo "
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x34, 0x6b,
0x46, 0x11, 0x00, 0x00, 0x00"| xxd -r -p > ~/.free42/state
#No one can remember free42, no oone uses xcalc so:
echo "alias xcalc=/usr/bin/free42bin" >> ~/.aliases
echo > ~/.bashrc << 'EOF'
if [ -f ~/.aliases ]; then
. ~/.aliases
fi
EOF
mkdir -p ~/.zsh_aliases.d
touch ~/.zsh_aliases.d/001_shared.zsh
echo "source ${HOME}/.aliases" > ~/.zsh_aliases.d/001_shared.zsh

View File

@ -1 +1,6 @@
apt-get install cadence catia claudia
apt-get -y install multimedia-jack
apt-get -y install patchage
apt-get -y install cadence
apt-get -y install catia
apt-get -y install claudia

6
020_kxstudio.sh Normal file
View File

@ -0,0 +1,6 @@
# Debian / Ubuntu
# All Debian and Ubuntu users can enable our repositories by installing this deb file: kxstudio-repos.deb.
# You can install it manually by running this:
# For the full install instructions see: https://github.com/KXStudio/KXStudio/blob/master/scripts/kxstudio-create-iso

87
020_lxc.sh Normal file
View File

@ -0,0 +1,87 @@
apt-get install lxc dnsmasq
# lxc-net configuration sourced from /usr/lib/x86_64-linux-gnu/lxc/lxc-net which contains the default values which means your bridge will be given a subnet of 10.0.3.0.
# The defaults, lets explicitly put them in /etc/default/lxc-net so we know where and what to change.
cat > /etc/default/lxc-net << 'EOF'
USE_LXC_BRIDGE="true"
LXC_BRIDGE="lxcbr0"
LXC_BRIDGE_MAC="00:16:3e:00:00:00"
LXC_ADDR="10.0.3.1"
LXC_NETMASK="255.255.255.0"
LXC_NETWORK="10.0.3.0/24"
LXC_DHCP_RANGE="10.0.3.2,10.0.3.254"
LXC_DHCP_MAX="253"
LXC_DHCP_CONFILE=""
LXC_DOMAIN=""
LXC_IPV6_ADDR=""
LXC_IPV6_MASK=""
LXC_IPV6_NETWORK=""
LXC_IPV6_NAT="false"
EOF
# Create template for new containers
# NB. For some reason lxc.network* will be replaced by lxc.net* in the configuration files below
# The /etc/lxc/default.conf only has one line at install:
## lxc.network.type = empty
# Just to make sure we don't squash future additions let change and append
sed -i 's,^\(lxc.network.type = \).*,\1'veth',' /etc/lxc/default.conf
# Newly created containers will be using the lxcbr0 bridge created by the lxc-net service.
cat >> /etc/lxc/default.conf << 'EOF'
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
lxc.network.ipv4 = 0.0.0.0/24
EOF
#Uncomment net.ipv4.ip_forward
sed -i -- 's/#net.ipv4.ip_forward/net.ipv4.ip_forward/g' /etc/sysctl.conf
#Change value of net.ipv4.ip_forward if not already 1
sed -i 's,^\(net.ipv4.ip_forward=\).*,\1'1',' /etc/sysctl.conf
#Activate on current system
echo 1 > /proc/sys/net/ipv4/ip_forward
/etc/init.d/lxc-net restart
# Other configuration in:
## /usr/share/lxc/config/
## /usr/share/lxm/config/common.conf.d
# This directory can be used by packages and users to dump LXC
# configuration snippets which will then be used by all containers using
# the common.conf configuration file (directly or indirectly).
#
#Configuration files must end with the .conf suffix and LXC will include
#those in alphabetical order.
# Needed for live migrate
sudo apt-get install criu
## then you can:
# lxc launch ubuntu $somename
# sleep 5s # let the container get to an interesting state
# lxc move host1:$somename host2:$somename
# But it would be nicer to use zfs features
# Add devuan template
# https://git.devuan.org/gregolsen/lxc-devuan
cd /var/tmp
git clone https://git.devuan.org/gregolsen/lxc-devuan.git
cp /var/tmp/lxc-devuan/templates/* /usr/share/lxc/templates/
cp /var/tmp/lxc-devuan/config/* /usr/share/lxc/config/
rm -rf /var/tmp/lxc-devuan
# LXC ZFS backingstore (amd64)
# no mount point need on create as it is created on init
# zfs create -o ${POOL_NAME}/lxc
POOL_NAME=rpool
echo "lxc.bdev.zfs.root = ${POOL_NAME}/lxc" >> /etc/lxc/lxc.conf
# Now you can use -B zfs
# lxc-create -t devuan -n devuan-jessie-box2 -B zfs

View File

@ -1 +1 @@
sudo apt-getinstall pidgin pidgin-otr pidgin-libnotify
sudo apt-get install -y pidgin pidgin-otr pidgin-libnotify

21
020_powerline-bash.sh Normal file
View File

@ -0,0 +1,21 @@
bash -c "cat > /etc/profile.d/powerline.sh" <<EOF
if [ -f $(which powerline-daemon) ]; then
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh
fi
EOF
mkdir -p ~/.config/powerline
bash -c "cat > ~/.config/powerline/config.json" <<EOF
{
"ext": {
"shell": {
"theme": "default_leftonly"
}
}
}
EOF
powerline-daemon --replace

1
020_qemu.sh Normal file
View File

@ -0,0 +1 @@
apt-get install qemu qemu-kvm qemu-utils

View File

@ -1,4 +1,4 @@
sudo apt-get install redshift
sudo apt-get -y install redshift
/usr/bin/xfconf-query -c xfce4-session -p /startup/redshift/enabled -n -t bool -s true

View File

@ -1,6 +1,6 @@
# get and install refracta stuff
# For jessie yad needs to be built from testing/ascii (and gtk3 dep changed in control)
apt-get install autotools-dev libgtk2.0-dev pkg-config intltool
apt-get -y install autotools-dev libgtk2.0-dev pkg-config intltool
cd /usr/src
apt-get source yad
@ -39,4 +39,4 @@ do
rm ${FILE}
done
sudo apt-get -f install
sudo apt-get -y -f install

View File

@ -1,5 +1,6 @@
# ROX-Filer settings
sudo apt-get intall rox-filer
sudo apt-get -y install rox-filer
sudo apt-get -y install xmlstarlet
# Options
# The Options and menus2 file are not created until first run

38
020_smartmon.sh Normal file
View File

@ -0,0 +1,38 @@
#!/bin/bash
apt-get install -y smartmontools gsmartcontrol
sed -i '/^#start_smartd=.*/ s/.*/&\nstart_smartd=yes/' ./smartmontools
sed -i '/^#enable_smart=.*/ s/.*/&\nenable_smart=\"\"/' ./smartmontools
sed -i '/^#smartd_opts=.*/ s/.*/&\nsmartd_opts=\"\"/' ./smartmontools
# smartd must run with the --savestates option as the disks themselves usually do not keep track of the last region tested.
for i in "--interval=1800" "--savestates=/var/lib/smartd/";
do
echo ${i};
sed -i "s|^smartd_opts=\"[ ]*\(.*\)\"|smartd_opts=\"\1 ${i}\"|" ./smartmontools
done
for i in $(smartctl --scan-open | awk {'print $2'});
do
echo ${i};
sed -i "s|^enable_smart=\"[ ]*\(.*\)\"|enable_smart=\"\1 ${i}\"|" ./smartmontools
done
EMAIL=root
#EMAIL=admin@my_domain.com
# Selective self test progressively tests the disks rather than having to wait for several hours for smartctl -t long to complete.
# You must initiate the first selective self test manually (-t select,0-${SIZE}) so smartd will know the slice size to test each day.
# To setup a full test of a 1TB disk within 20 days (one 50GB span each day), run this command once:
SIZE=99999999
for i in $(smartctl --scan-open | awk {'print $2'});
do
echo ${i};
smartctl -t select,0-${SIZE} ${i}
done
# To run the next test spans on Monday-Friday between 12-13am, run smartd with this directive:
RUNNER_OPT="n/../../[1-5]/12"
sed -i "s|^DEVICESCAN[ ]*\(.*\)|DEVICESCAN -d removable -n standby -m ${EMAIL} -M exec /usr/share/smartmontools/smartd-runner -s ${RUNNER_OPT}|" ./smartd.conf

4
020_themes.sh Normal file
View File

@ -0,0 +1,4 @@
apt-get install mate-themes
apt-get install albatross-gtk-theme
apt-get install blackbird-gtk-theme
apt-get install gtk2-engines-ubuntulooks

View File

@ -28,7 +28,7 @@ cat <<'EOF' >> ~/.config/tilda/config_0
tilda_config_version = "1.1.11"
# image = ""
# command = ""
font = "DejaVu"
font = "DejaVu Sans Mono 9"
key = "<Super>F1"
addtab_key = "<Shift><Control>t"
fullscreen_key = "F11"

View File

@ -1,3 +1,7 @@
apt-get install tmux
apt-get install tmux-plugin-manager
apt-get install tmuxinator
# https://github.com/Netherdrake/Dotfiles/tree/master/config/tmux
# wget -c --directory-prefix ~/.config/tmux/ https://raw.githubusercontent.com/Netherdrake/Dotfiles/master/config/tmux/default.sh
mkdir -p ~/.config/tmux

View File

@ -120,7 +120,7 @@ Plugin 'tpope/vim-fugitive'
Plugin 'wincent/command-t'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
#Plugin 'Valloric/YouCompleteMe'
"Plugin 'Valloric/YouCompleteMe'
Plugin 'davidhalter/jedi-vim'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
@ -137,7 +137,10 @@ Plugin 'mhinz/vim-startify'
Plugin 'airblade/vim-gitgutter'
Plugin 'edkolev/tmuxline.vim'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'sudar/vim-arduino-syntax'
Plugin 'ekalinin/Dockerfile.vim'
Plugin 'tmux-plugins/vim-tmux'
Plugin 'tmux-plugins/vim-tmux-focus-events'
" toggleable panels
Plugin 'tpope/vim-vinegar'
@ -160,6 +163,9 @@ Plugin 'klen/python-mode'
Plugin 'scrooloose/syntastic'
Plugin 'scrooloose/nerdcommenter'
" FZF
set rtp+=~/.fzf
Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" All of your Plugins must be added before the following line
call vundle#end() " required
@ -234,7 +240,7 @@ cat ~/.vimrc
#vim +PluginInstall +qall
# Install YouCompleteMe support
apt-get install build-essential cmake
apt-get install build-essential cmake exuberant-ctags
apt-get install python-dev python3-dev
# semantic support for C-family
@ -251,6 +257,6 @@ apt-get install python-dev python3-dev
#./build.py --all
# jedi-vim (since youcompleteme seems to just crash)
apt-get install pip3
apt-get install python-pip
pip install jedi

44
020_xorg.sh Normal file
View File

@ -0,0 +1,44 @@
# trackpoint
echo > /etc/X11/xorg.conf.d/trackpoint.conf << 'EOF'
Section "InputClass"
Identifier "TrackPoint Clone Acceleration and Middle Click Emulation"
MatchProduct "DualPoint Stick"
MatchDevicePath "/dev/input/event*"
# Option "EmulateWheel" "true"
# Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "true"
Option "AccelerationProfile" "7"
Option "AdaptiveDeceleration" "1.3"
Option "ConstantDeceleration" "1"
Option "ExpectedRate" "10"
# Option "XAxisMapping" "6 7"
# Option "YAxisMapping" "4 5"
EndSection
EOF
# trackpad
echo > /etc/X11/xorg.conf.d/trackpad.conf << 'EOF'
Section "InputDevice"
Identifier "SynapticsMouse1"
Driver "synaptics"
Option "EdgeMotionMinSpeed" "200"
Option "MaxTapTime" "0" # do not use taping, i.e. touching/tapping will not be taken as a mouse click
Option "MaxSpeed" "1.50"
Option "MinSpeed" "0.7"
Option "BottomEdge" "650"
Option "EdgeMotionMaxSpeed" "200"
Option "CircScrollTrigger" "2"
Option "UpDownScrolling" "0"
Option "SHMConfig" "on"
Option "LeftEdge" "120"
Option "FingerLow" "14"
Option "HorizScrollDelta" "20"
Option "MaxTapMove" "110"
Option "FingerHigh" "15"
Option "VertScrollDelta" "20"
Option "CircularScrolling" "1"
Option "RightEdge" "830"
Option "AccelFactor" "0.3"
Option "TopEdge" "120"
EndSection
EOF

43
020_zfs-auto-snapshot.sh Normal file
View File

@ -0,0 +1,43 @@
## PREREQUISITES:
## 1. zfs-auto-snapshot or equivalent package installed locally and regular
## snapshots enabled (hourly, daily, etc.)
# NB now available in ascii with:
# apt-get install zfs-auto-snapshot
# or:
## Make ZFS Snapshots work on Debian
## A .deb package can be created for zfs-auto-snapshot:
apt-get -y install git build-essential zfsnap
apt-get -y install zfs-auto-snapshot
ZSH_BUILD_HOME=/var/tmp/zfs-auto-snapshot
mkdir -p ${ZSH_BUILD_HOME} && \
cd ${ZSH_BUILD_HOME} && \
git clone https://github.com/zfsonlinux/zfs-auto-snapshot.git && \
cd ${ZSH_BUILD_HOME}/zfs-auto-snapshot &&\
git merge origin/debian && \
dpkg-buildpackage -b -uc -us && \
dpkg -i ../zfs-auto-snapshot_*.deb
## 2. home directory set for zfssnap role (the user taking snapshots and
## doing the sending):
# rolemod -d /path/to/home zfssnap
## 3. ssh keys set up between zfssnap@localhost and remuser@remhost:
# su - zfssnap
# ssh-keygen
## Copy the contents of .ssh/id_rsa.pub into ~remuser/.ssh/authorized_keys on remhost. Test that key-based ssh works:
# ssh remuser@remhost
## 4. zfs allow done for remuser on remhost:
# zfs allow remuser atime,create,destroy,mount,mountpoint,receive,rollback,snapshot,userprop backuppool/fs
## This can be done on a top-level filesystem, and is inherited by default.
## Depending on your usage, you may need to also allow further permissions such
## as share, sharenfs, hold, etc.
## 5. an initial (full) zfs send/receive done so that remhost has the fs we
## are backing up, and the associated snapshots -- something like:
# zfs send -R $POOL/$FS@zfs-auto-snap_daily-(latest) | ssh $REMUSER@$REMHOST zfs recv -dvF $REMPOOL
## Note: 'zfs send -R' will send *all* snapshots associated with a dataset, so
## if you wish to purge old snapshots, do that first.
## 6. zfs allow any additional permissions needed, to fix any errors produced in
## step 5
## 7. configure the TAG/PROP/REMUSER/REMHOST/REMPOOL variables in this script or
## in a config file
## 8. zfs set $PROP={ fullpath | basename | rootfs } pool/fs
## for each FS or volume you wish to back up.

210
020_zfs-sanoid.sh Normal file
View File

@ -0,0 +1,210 @@
apt-get install libconfig-inifiles-perl git
cd /opt
git clone https://github.com/jimsalterjrs/sanoid
ln -s /opt/sanoid/sanoid /usr/sbin/
mkdir -p /etc/sanoid
cp /opt/sanoid/sanoid.conf /etc/sanoid/sanoid.conf
cp /opt/sanoid/sanoid.defaults.conf /etc/sanoid/sanoid.defaults.conf
# ###################################################################################
# # default template - DO NOT EDIT THIS FILE DIRECTLY. #
# # If you wish to override default values, you can create your #
# # own [template_default] in /etc/sanoid/sanoid.conf. #
# # #
# # you have been warned. #
# ###################################################################################
#
# [template_default]
#
# # these settings don't make sense in a template, but we use the defaults file
# # as our list of allowable settings also, so they need to be present here even if
# # unset.
# path =
# recursive =
# use_template =
# process_children_only =
#
# # If any snapshot type is set to 0, we will not take snapshots for it - and will immediately
# # prune any of those type snapshots already present.
# #
# # Otherwise, if autoprune is set, we will prune any snapshots of that type which are older
# # than (setting * periodicity) - so if daily = 90, we'll prune any dailies older than 90 days.
# autoprune = yes
# hourly = 48
# daily = 90
# monthly = 6
# yearly = 0
# min_percent_free = 10
#
# # We will automatically take snapshots if autosnap is on, at the desired times configured
# # below (or immediately, if we don't have one since the last preferred time for that type).
# #
# # Note that we will not take snapshots for a given type if that type is set to 0 above,
# # regardless of the autosnap setting - for example, if yearly=0 we will not take yearlies
# # even if we've defined a preferred time for yearlies and autosnap is on.
# autosnap = 1;
# # hourly - top of the hour
# hourly_min = 0;
# # daily - at 23:59 (most people expect a daily to contain everything done DURING that day)
# daily_hour = 23;
# daily_min = 59;
# # monthly - immediately at the beginning of the month (ie 00:00 of day 1)
# monthly_mday = 1;
# monthly_hour = 0;
# monthly_min = 0;
# # yearly - immediately at the beginning of the year (ie 00:00 on Jan 1)
# yearly_mon = 1;
# yearly_mday = 1;
# yearly_hour = 0;
# yearly_min = 0;
#
# # monitoring plugin - define warn / crit levels for each snapshot type by age, in units of one period down
# # example hourly_warn = 90 means issue WARNING if most recent hourly snapshot is not less than 90 minutes old,
# # daily_crit = 36 means issue CRITICAL if most recent daily snapshot is not less than 36 hours old,
# # monthly_warn = 36 means issue WARNING if most recent monthly snapshot is not less than 36 days old... etc.
# #
# # monitor_dont_warn = yes will cause the monitoring service to report warnings as text, but with status OK.
# # monitor_dont_crit = yes will cause the monitoring service to report criticals as text, but with status OK.
# #
# # setting any value to 0 will keep the monitoring service from monitoring that snapshot type on that section at all.
# monitor = yes
# monitor_dont_warn = no
# monitor_dont_crit = no
# hourly_warn = 90
# hourly_crit = 360
# daily_warn = 28
# daily_crit = 32
# monthly_warn = 32
# monthly_crit = 35
# yearly_warn = 0
# yearly_crit = 0
## Examples
#
# * * * * * /usr/local/bin/sanoid --cron
#
# Only crontab entry you'll ever need. (You're of course perfectly welcome to do something like
#
# 0 * * * * /usr/local/bin/sanoid --cron
#
# instead if you want to limit number of executions possible.) different number of snapshots per volume
#
# Super easy. You can use templates, write your own templates, or override individual settings within a
# template.
#
# Some example usage, including recursive application (will apply to datasets that are children of the
# dataset being configured) and non-recursive, a custom template, and overriding individual settings in
# a template:
#/etc/sanoid/sanoid.conf:
#
#[pool/dataset1]
# use_template=production
# daily=60
# recursive=yes
#
#[pool/dataset2]
# use_template=production
# daily=15
# hourly=24
# recursive=yes
#
#[pool/dataset3]
# use_template=mytemplate
#
#[pool/dataset3/dataset4]
# use_template=production
#
##########################
#
#[template_production]
# hourly = 36
# daily = 30
# monthly = 3
# yearly = 0
# autosnap = yes
# autoprune = yes
#
#[template_mytemplate]
# hourly = 5
# daily = 10
# monthly = 0
# yearly = 0
# autosnap = yes
# autoprune = yes
cat > /etc/sanoid/sanoid.conf << 'EOF'
######################################
# This is a sample sanoid.conf file. #
# It should go in /etc/sanoid. #
######################################
# name your backup modules with the path to their ZFS dataset - no leading slash.
[zpoolname/datasetname]
# pick one or more templates - they're defined (and editable) below. Comma separated, processed in order.
# in this example, template_demo's daily value overrides template_production's daily value.
use_template = production,demo
# if you want to, you can override settings in the template directly inside module definitions like this.
# in this example, we override the template to only keep 12 hourly and 1 monthly snapshot for this dataset.
hourly = 12
monthly = 1
# you can also handle datasets recursively.
[zpoolname/parent]
use_template = production
recursive = yes
# if you want sanoid to manage the child datasets but leave this one alone, set process_children_only.
process_children_only = yes
# you can selectively override settings for child datasets which already fall under a recursive definition.
[zpoolname/parent/child]
# child datasets already initialized won't be wiped out, so if you use a new template, it will
# only override the values already set by the parent template, not replace it completely.
use_template = demo
#############################
# templates below this line #
#############################
# name your templates template_templatename. you can create your own, and use them in your module definitions above.
[template_demo]
daily = 60
[template_production]
hourly = 36
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = yes
[template_backup]
autoprune = yes
hourly = 30
daily = 90
monthly = 12
yearly = 0
### don't take new snapshots - snapshots on backup
### datasets are replicated in from source, not
### generated locally
autosnap = no
### monitor hourlies and dailies, but don't warn or
### crit until they're over 48h old, since replication
### is typically daily only
hourly_warn = 2880
hourly_crit = 3600
daily_warn = 48
daily_crit = 60
EOF

46
020_zfs-znapzend.sh Normal file
View File

@ -0,0 +1,46 @@
apt-get install mbuffer
## Using checkinstall
#ZZ_VERSION=0.17.0
#cd /var/tmp
#wget -c https://github.com/oetiker/znapzend/releases/download/v${ZZ_VERSION}/znapzend-${ZZ_VERSION}.tar.gz
#tar zxvf znapzend-${ZZ_VERSION}.tar.gz
#cd znapzend-${ZZ_VERSION}
#./configure --prefix=/opt/znapzend-${ZZ_VERSION}
#make
#checkinstall --fstrans=no bash -c 'make install && for x in /opt/znapzend-0.17.0/bin/*; do ln -s $x /usr/local/bin; done'
# rm -rf znapzend-${ZZ_VERSION}
# Using dpkg-buildpackage
ZFS_BUILD_HOME=/var/tmp/zfs-auto-snapshot
mkdir -p ${ZFS_BUILD_HOME}
cd ${ZFS_BUILD_HOME}
git clone https://github.com/oetiker/znapzend/
cd znapzend
git clone https://github.com/Gregy/znapzend-debian /tmp/debian
mv /tmp/debian/debian ${ZFS_BUILD_HOME}/znapzend
rm -rf /tmp/debian
sed -i -e 's/--with=systemd//g' debian/rules
sed -i -e '/override_dh_installinit:/,+1d' debian/rules
sed -i -e 's/, dh-systemd (.*)//; s/dh-systemd (.*)//; s/, dh-systemd//;' debian/control
sed -i -e 's/dh-systemd (.*)//; s/dh-systemd//' debian/control
dpkg-buildpackage -b -uc -us && \
dpkg -i ../znapzend_*.deb
## EXAMPLES
## create a complex backup task
#znapzendzetup create --recursive --mbuffer=/usr/bin/mbuffer \
# --mbuffersize=1G --tsformat='%Y-%m-%d-%H%M%S' \
# --pre-snap-command="/bin/sh /usr/local/bin/lock_flush_db.sh" \
# --post-snap-command="/bin/sh /usr/local/bin/unlock_db.sh" \
# SRC '7d=>1h,30d=>4h,90d=>1d' rpool/home \
# DST:a '7d=>1h,30d=>4h,90d=>1d,1y=>1w,10y=>1month' backup/home \
# DST:b '7d=>1h,30d=>4h,90d=>1d,1y=>1w,10y=>1month' root@bserv:backup/home "/root/znapzend.sh dst_b pool on" "/root/znapzend.sh dst_b pool off"
## copy the setup from one fileset to another
# znapzendzetup export rpool/home | znapzendzetup import --write rpool/new_home

View File

@ -0,0 +1,10 @@
ZZ_VERSION=0.17.0
cd /var/tmp
wget -c https://github.com/oetiker/znapzend/releases/download/v${ZZ_VERSION}/znapzend-${ZZ_VERSION}.tar.gz
tar zxvf znapzend-${ZZ_VERSION}.tar.gz
cd znapzend-${ZZ_VERSION}
./configure --prefix=/opt/znapzend-${ZZ_VERSION}
make
checkinstall --fstrans=no bash -c 'make install && for x in /opt/znapzend-0.17.0/bin/*; do ln -s $x /usr/local/bin; done'
# rm -rf znapzend-${ZZ_VERSION}

View File

@ -1,10 +1,12 @@
# http://www.zshwiki.org/home/zle/vi-mode
#
echo "This script is very broken, and squashes .vimrc EXITING - FIXME"
exit
cat > ~/.vimrc <<'EOF'
# Set vi command-line mode
" Set vi command-line mode
bindkey -v
# Use right prompt to display vi mode.
" Use right prompt to display vi mode.
precmd() {
RPROMPT=""
}
@ -20,22 +22,22 @@ zle-line-init() {
zle -N zle-keymap-select
zle -N zle-line-init
# Vim bindings.
" Vim bindings.
bindkey -a 'gg' beginning-of-buffer-or-history
bindkey -a 'g~' vi-oper-swap-case
bindkey -a G end-of-buffer-or-history
# In Vim backspace doesn't stop at the point where you started insert mode:
" In Vim backspace doesn't stop at the point where you started insert mode:
bindkey '^?' backward-delete-char
bindkey '^H' backward-delete-char
#
"
bindkey '^G' what-cursor-position
# Text Objects
# Some are provided as shell functions so need to be manually enabled. select-bracketed which selects
# text delimited by brackets and select-quoted which selects text delimited by quote characters.
# The following binds them to key combinations such as i" a( in both the visual and viopp keymaps.
" Text Objects
" Some are provided as shell functions so need to be manually enabled. select-bracketed which selects
" text delimited by brackets and select-quoted which selects text delimited by quote characters.
" The following binds them to key combinations such as i" a( in both the visual and viopp keymaps.
autoload -U select-bracketed select-quoted
zle -N select-bracketed
zle -N select-quoted
@ -49,7 +51,7 @@ zle -N select-quoted
done
done
# Clipboard integration using xclip
" Clipboard integration using xclip
[[ -n $DISPLAY ]] && (( $+commands[xclip] )) && {
function cutbuffer() {

View File

@ -1,4 +1,4 @@
sudo apt-get -y install zsh
sudo apt-get -y install zsh nodejs-legacy
# compaudit
# There are insecure directories: /usr/local/share/zsh/site-functions
@ -15,12 +15,17 @@ sudo apt-get install -y git
# Install zgen plugin manager and zsh quicktart to get a default setup for zsh
git clone http://github.com/tarjoilija/zgen # available with apt-get install zgen which installs to /usr/share/zgen
git clone http://github.com/unixorn/zsh-quickstart-kit # FIXME: needs to be packaged
mkdir -p ~/.zgen/robbyrussell/oh-my-zsh-master/
git clone http://github.com/robbyrussell/oh-my-zsh ~/.zgen/robbyrussell/oh-my-zsh-master/
ln -sf ~/zsh-quickstart-kit/zsh/.zshrc ~/.zshrc
ln -sf ~/zsh-quickstart-kit/zsh/.zsh_functions ~/.zsh_functions
ln -sf ~/zsh-quickstart-kit/zsh/.zsh_aliases ~/.zsh_aliases
ln -sf ~/zsh-quickstart-kit/zsh/.zgen-setup ~/.zgen-setup
#ln -sf ~/zsh-quickstart-kit/zsh/.zsh_completions ~/.zsh-completions
mkdir -p ~/.zshrc.d
echo "setopt PROMPT_SUBST" >> ~/.zshrc
echo "NVIM_PYTHON_LOG_FILE=/var/tmp/nvim_python.log" >> ~/.zshrc.d/008_nvim.zsh
echo "NVIM_PYTHON_LOG_LEVEL=DEBUG" >> ~/.zshrc.d/008_nvim.zsh
@ -63,7 +68,7 @@ cat > ~/.zgen-local-plugins << 'EOF'
bindkey "$terminfo[kcud1]" history-substring-search-down
# Tab complete rakefile targets
zgen load unixorn/rake-completion.zshplugin
#zgen load unixorn/rake-completion.zshplugin
# Automatically run zgen update and zgen selfupdate every 7 days
zgen load unixorn/autoupdate-zgen
@ -100,12 +105,13 @@ cat > ~/.zgen-local-plugins << 'EOF'
zgen oh-my-zsh plugins/pip
zgen oh-my-zsh plugins/sudo
zgen oh-my-zsh plugins/aws
zgen oh-my-zsh plugins/chruby
#zgen oh-my-zsh plugins/chruby
zgen oh-my-zsh plugins/colored-man-pages
zgen oh-my-zsh plugins/git
zgen oh-my-zsh plugins/github
zgen oh-my-zsh plugins/python
zgen oh-my-zsh plugins/rsync
zgen oh-my-zsh plugins/tmux
zgen oh-my-zsh plugins/screen
zgen oh-my-zsh plugins/vagrant
@ -126,8 +132,8 @@ cat > ~/.zgen-local-plugins << 'EOF'
# Docker completion
# zgen load srijanshetty/docker-zsh
zgen load oh-my-zsh plugins/docker
zgen load oh-my-zsh plugins/docker-compose
zgen load robbyrussell/oh-my-zsh plugins/docker
zgen load robbyrussell/oh-my-zsh plugins/docker-compose
# Load me last
GENCOMPL_FPATH=$HOME/.zsh/complete
@ -145,7 +151,8 @@ cat > ~/.zgen-local-plugins << 'EOF'
zgen load rimraf/k
# Bullet train prompt setup
zgen load caiogondim/bullet-train-oh-my-zsh-theme bullet-train
#zgen load caiogondim/bullet-train-oh-my-zsh-theme bullet-train
zgen load robbyrussell/oh-my-zsh themes/agnoster
## Load Prezto
# zgen prezto
@ -174,7 +181,14 @@ EOF
# example .d file use unset to prevent update
echo 'QUICKSTART_KIT_REFRESH_IN_DAYS=7' > ~/.zshrc.d/001-qs_refresh.zsh
sudo apt-get install fonts-powerline
sudo apt-get install -y fonts-powerline powerline
# sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' ~/.zshrc
# Use powerline-daemon to speedup the prompt.
echo 'powerline-daemon -q' > ~/.zshrc.d/006-powerline-daemon.zsh
sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
# set theme for zsh
cat > ~/.zshrc.d/002-theme.zsh << 'EOF'
@ -184,7 +198,7 @@ ZSH_THEME="agnoster" # powerline based theme
#ZSH_THEME="Pure"
EOF
git clone https://github.com/bhilburn/powerlevel9k.git ~/.zgen/robbyrussell/oh-my-zsh-master/themes/powerlevel9k
#git clone https://github.com/bhilburn/powerlevel9k.git ~/.zgen/robbyrussell/oh-my-zsh-master/themes/powerlevel9k
## add a separate zsh aliases directory
#echo > ~/.zshrc << 'EOF'

View File

@ -158,6 +158,41 @@ EOF
# fi
#done
#PROFILE_NAME="23k5nqzr.default-1404250880109"
#
#PROFILE_DIR="~/.mozilla/firefox/${PROFILE_NAME}"
#
#sudo for i in "browser.pocket.enabled"
#do
# print $1
# if grep $i ${PROFILE_DIR}/prefs.js
# then
# sed -i -e 's/^user_pref($i, \(true\|false\));$/user_pref($i, false);/' ${PROFILE_DIR}/prefs.js
# else
# echo "user_pref($i, true);" >> ${PROFILE_DIR}/prefs.js
# fi
#done
#
#network.http.speculative-parallel-limit to 0
#
#PROFILE_NAME="23k5nqzr.default-1404250880109"
#
#PROFILE_DIR="~/.mozilla/firefox/${PROFILE_NAME}"
#
#sudo for i in "network.http.speculative-parallel-limit"
#do
# print $1
# if grep $i ${PROFILE_DIR}/prefs.js
# then
# sed -i -e 's/^user_pref($i, \(0\|1\));$/user_pref($i, 0);/' ${PROFILE_DIR}/prefs.js
# else
# echo "user_pref($i, true);" >> ${PROFILE_DIR}/prefs.js
# fi
#done
# FIXME try firefox -install-global-extension ${YOUR_XPI_FILE] in a loop
#ublock-origin https://addons.mozilla.org/firefox/downloads/latest/607454/addon-607454-latest.xpi
#unplug https://addons.mozilla.org/firefox/downloads/latest/2254/addon-2254-latest.xpi
@ -191,7 +226,7 @@ https://addons.mozilla.org/firefox/downloads/latest/229918/addon-229918-latest.x
"
pwd
EXTENSIONS_HOME="/home/user"
EXTENSIONS_HOME="~/.mozilla"
EXTENSIONS_DIR="${EXTENSIONS_HOME}/extensions"
mkdir -p ${EXTENSIONS_DIR} && ls ${EXTENSIONS_DIR}
pwd

View File

@ -41,10 +41,9 @@ xfconf-query -c xfwm4 -p /general/workspace_count -n -s 8
#set uk keyboard
#sed -i 's,^\(layouts=\).*,\1'gb',' ~/.config/xfce4/panel/xkb-plugin-18.rc
sudo apt-get -y remove xfce4-xkb-plugin
sudo kill -HUP `ps aux | grep -v grep | grep xfce4-xkb-plugin | awk {'print $2'}`
sudo killall -HUP $(ps aux | grep -v grep | grep xfce4-xkb-plugin | awk {'print $2'})
xfconf-query -c keyboard-layout -p /Default/XkbLayout -n -t string -s gb
xfconf-query -c keyboard-layout -p /Default/XkbDisable -n -t bool -s false
# xfce4 terminal scrollback, because configuring everything one way would be too easy.
sed -i "s,^\(ScollingLines=\).*,\1'100000'," ~/.config/xfce4/terminal/terminalrc

View File

@ -6,7 +6,7 @@ sudo apt-get -y remove --purge libnm-gtk
sudo rm /home/user/.config/autostart/nm-applet.destop
sudo apt-get -y install wicd wicd-gtk wicd-curses
sudo apt-get -y --force=yes install wicd wicd-gtk wicd-curses
# Stop the gtk wicd client, it doesn't like files being changes under it. Even if you delette the file, when it exits it writes out its settings.
PID=`ps aux | grep python | grep wicd-client| awk {'print $2'}`

69
sources.list.sh Normal file
View File

@ -0,0 +1,69 @@
# Add security updates (default: yes)
cat > /etc/apt/sources.list.d/devuan-security.list <<EOD
# /etc/apt/sources.list.d/devuan-security.list
deb http://packages.devuan.org/merged jessie-security main
deb-src http://packages.devuan.org/merged jessie-security main
EOD
# Add stable updates for fast release packages (default: no)
cat > /etc/apt/sources.list.d/devuan-stable-updates.list <<EOD
# /etc/apt/sources.list.d/devuan-stable-updates.list
deb http://auto.mirror.devuan.org/merged jessie-updates main
deb-src http://auto.mirror.devuan.org/merged jessie-updates main
EOD
# Add stable proposed updates (default: no)
cat > /etc/apt/sources.list.d/devuan-stable-proposed-updates.list <<EOD
# /etc/apt/sources.list.d/devuan-stable-proposed-updates.list
deb http://auto.mirror.devuan.org/merged jessie-proposed main
deb-src http://auto.mirror.devuan.org/merged jessie-proposed main
EOD
# Add backports (default: no)
cat > /etc/apt/sources.list.d/devuan-jessie-backports.list <<EOD
# /etc/apt/sources.list.d/devuan-jessie-backports.list
deb http://auto.mirror.devuan.org/merged jessie-backports main
deb-src http://auto.mirror.devuan.org/merged jessie-backports main
EOD
# Add experimental (default: no)
cat > /etc/apt/sources.list.d/devuan-experimental.list <<EOD
# /etc/apt/sources.list.d/devuan-experimental.list
deb http://auto.mirror.devuan.org/devuan experimental main
deb-src http://auto.mirror.devuan.org/devuan experimental main
EOD
# Move to ascii (testing)
cat > /etc/apt/sources.list.d/devuan-ascii.list <<EOD
# /etc/apt/sources.list.d/devuan-ascii.list
deb http://auto.mirror.devuan.org/merged ascii main
deb-src http://auto.mirror.devuan.org/merged ascii main
EOD
cat > /etc/apt/sources.list.d/devuan-ascii.list <<EOD
# /etc/apt/sources.list.d/devuan-ascii-updates.list
deb http://auto.mirror.devuan.org/merged ascii-updates main
deb-src http://auto.mirror.devuan.org/merged ascii-updates main
EOD
cat > /etc/apt/sources.list.d/devuan-ascii.list <<EOD
# /etc/apt/sources.list.d/devuan-ascii-security.list
deb http://auto.mirror.devuan.org/merged ascii-security main
deb-src http://auto.mirror.devuan.org/merged ascii-security main
EOD

1
test_powerline.sh Normal file
View File

@ -0,0 +1 @@
echo " ±  ➦ ✘ ⚡ ⚙"

18
thinkpad-dock.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# wait for the dock state to change
sleep 0.5
DOCKED=$(cat /sys/devices/platform/dock.0/docked)
case "$DOCKED" in
"0")
#undocked event - lets remove all connected outputs apart from LVDS
for output in $(/usr/bin/xrandr -d :0.0 --verbose|grep " connected"|grep -v LVDS|awk '{print $1}')
do
/usr/bin/xrandr -d :0.0 --output $output --off
done
;;
"1")
#docked event - sample will created extended desktop with DVI1 to the right of LVDS1
#/usr/bin/xrandr -d :0.0 --output DVI1 --right-of LVDS1 --auto
;;
esac
exit 0