Skip to content

Commit

Permalink
daily
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor committed Oct 29, 2016
1 parent 8bc78ed commit c7857e3
Show file tree
Hide file tree
Showing 22 changed files with 84 additions and 52 deletions.
20 changes: 18 additions & 2 deletions backup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,35 @@ chmod -v 0600 ~/.s3ql/authinfo2

### S3QL on Amazon S3

```bash
cat > ~/.s3ql/authinfo2 <<EOF
[s3]
storage-url: s3://${S3_BUCKET}/${S3_PREFIX}
backend-login:
backend-password:
fs-passphrase: $(apg -m32 -n1)
EOF
chmod -v 0600 ~/.s3ql/authinfo2
```

### S3QL on any S3

http://www.rath.org/s3ql-docs/backends.html

```bash
cat > ~/.s3ql/authinfo2 <<EOF
[s3]
storage-url: s3://${BUCKET/${PREFIX}
storage-url: s3c://${S3_HOST}/${S3_BUCKET}/${S3_PREFIX}
backend-login:
backend-password:
fs-passphrase: $(apg -m32 -n1)
EOF
chmod -v 0600 ~/.s3ql/authinfo2
```

### OpenStack client

```
```bash
pip3 install -U python-openstackclient
openstack --os-cloud system-backup complete > /etc/bash_completion.d/openstack
mkdir -p ~/.config/openstack
Expand Down
10 changes: 5 additions & 5 deletions clone-server-debconf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ clear; dpkg -l | grep -E "^\S+\s+linux-image"
grep "^linux-image" packages.selection

# Remove systemd??
apt-get update -qq -y
apt-get install -qq -y sysvinit-core sysvinit-utils
apt-get update -qq
apt-get install -qq sysvinit-core sysvinit-utils
cp -v /usr/share/sysvinit/inittab /etc/inittab
echo -e 'Package: *systemd*\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd
# Schedule removal of systemd
echo "PATH=/usr/sbin:/usr/bin:/sbin:/bin
@reboot root apt-get purge -qq -y --auto-remove systemd >/dev/null;rm -f /etc/cron.d/withoutsystemd" > /etc/cron.d/withoutsystemd
@reboot root apt-get purge -qq --auto-remove systemd >/dev/null;rm -f /etc/cron.d/withoutsystemd" > /etc/cron.d/withoutsystemd

# Normalize OS
../debian-image-normalize.sh
Expand All @@ -94,7 +94,7 @@ xargs -I%% cp -vf /root%% %% < etc-blacklist.txt
# Recreate homes
sed -ne 's/^\(\S\+\):x:1[0-9][0-9][0-9]:.*$/\1/p' /etc/passwd | xargs -n1 mkhomedir_helper
#tar -C /home/ -xvf ./homes.tar.gz
apt-get update -qq -y
apt-get update -qq

# Kernel modules
ls -l /etc/modprobe.d/
Expand All @@ -121,7 +121,7 @@ pvdisplay && lvs
ifconfig

# Restore packages
apt-get install -qq -y apt-transport-https apt-utils dselect debsums
apt-get install -qq apt-transport-https apt-utils dselect debsums
dselect update
clear; debconf-set-selections < debconf.selections
# @FIXME Question type: error
Expand Down
2 changes: 1 addition & 1 deletion clone-server-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exit 0
# On the "donor" before snapshoting

# Switch to DHCP
apt-get install -qq -y isc-dhcp-client
apt-get install -qq isc-dhcp-client
cp -a /etc/network/interfaces /etc/network/interfaces.clone
cp -a /etc/resolv.conf /etc/resolv.conf.clone
editor /etc/network/interfaces
Expand Down
18 changes: 9 additions & 9 deletions debian-image-normalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Info "Reinstall tasks"
debconf-show tasksel
tasksel --list-tasks | grep -v "^u " || true
# shellcheck disable=SC2046
apt-get purge -qq -y $(${APTI_SEARCH} '?and(?installed, ?or(?name(^task-), ?name(^tasksel)))')
apt-get purge -qq $(${APTI_SEARCH} '?and(?installed, ?or(?name(^task-), ?name(^tasksel)))')
#tasksel --task-packages ssh-server; tasksel --task-packages standard #'
echo "tasksel tasksel/first select" | debconf-set-selections -v
echo "tasksel tasksel/desktop multiselect" | debconf-set-selections -v
echo "tasksel tasksel/first multiselect ssh-server, standard" | debconf-set-selections -v
echo "tasksel tasksel/tasks multiselect ssh-server" | debconf-set-selections -v
apt-get install -qq -y tasksel
apt-get install -qq tasksel
# May take a while
tasksel --new-install

Expand All @@ -106,14 +106,14 @@ STANDARD_PACKAGES="$(${APTI_SEARCH} \
# '?and(?architecture(native), ?or(?essential, ?priority(required), ?priority(important), ?priority(standard)))' \
# | grep -Evx "$STANDARD_BLACKLIST")"
# shellcheck disable=SC2086
apt-get -qq -y install ${STANDARD_PACKAGES}
apt-get -qq install ${STANDARD_PACKAGES}

Info "Install missing recommended packages"

MISSING_RECOMMENDS="$(${APTI_SEARCH} \
'?and(?reverse-recommends(?installed), ?version(TARGET), ?not(?installed))' | grep -Evx "$STANDARD_BLACKLIST" || true)"
# shellcheck disable=SC2086
apt-get -qq -y install ${MISSING_RECOMMENDS}
apt-get -qq install ${MISSING_RECOMMENDS}
echo "$MISSING_RECOMMENDS" | xargs -r -L 1 apt-mark auto

Info "Remove non-standard packages"
Expand All @@ -122,23 +122,23 @@ MANUALLY_INSTALLED="$(${APTI_SEARCH} \
'?and(?installed, ?not(?automatic), ?not(?essential), ?not(?priority(required)), ?not(?priority(important)), ?not(?priority(standard)))' \
| grep -Evx "$BOOT_PACKAGES" | tee removed.pkgs || true)"
# shellcheck disable=SC2086
apt-get purge -qq -y ${MANUALLY_INSTALLED}
apt-get purge -qq ${MANUALLY_INSTALLED}

Info "Remove packages on standard-blacklist"

# shellcheck disable=SC2046
apt-get purge -qq -y $(${APTI_SEARCH} '?installed' | grep -Ex "$STANDARD_BLACKLIST" || true)
apt-get purge -qq $(${APTI_SEARCH} '?installed' | grep -Ex "$STANDARD_BLACKLIST" || true)
# Exim bug
getent passwd "Debian-exim" > /dev/null && deluser --force --remove-home "Debian-exim"

Info "Do dist-upgrade finally"

apt-get dist-upgrade -qq -y
apt-get autoremove -qq --purge -y
apt-get dist-upgrade -qq
apt-get autoremove -qq --purge

Info "Check package integrity and cruft"

apt-get install -qq -y debsums cruft > /dev/null
apt-get install -qq debsums cruft > /dev/null
# Should be empty
debsums --all --changed 2>&1 | sed -e 's/$/ # integrity/' | tee integrity.log
cruft --ignore /root > cruft.log 2>&1
Expand Down
4 changes: 2 additions & 2 deletions debian-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ debian-setup/base-files

# Remove wheezy packages
if Is_installed "libgnutls26"; then
apt-get purge -qq -y \
apt-get purge -qq \
libboost-iostreams1.49.0 libdb5.1 libgcrypt11 libgnutls26 \
libprocps0 libtasn1-3 libudev0 python2.6 python2.6-minimal
fi
# Remove ClamAV data
rm -rf /var/lib/clamav /var/log/clamav || true

# Packages used on top of SETUP_PACKAGES
apt-get install -qq -y ssh sudo apt-transport-https virt-what python-yaml
apt-get install -qq ssh sudo apt-transport-https virt-what python-yaml
# Install SHYAML (config reader)
wget -nv -O /usr/local/bin/shyaml "$SETUP_SHYAML_URL"
chmod +x /usr/local/bin/shyaml
Expand Down
2 changes: 1 addition & 1 deletion debian-setup/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ elasticstack-container
scx
omi
# Don't remove if mount --types nfs4; then
#apt-get install -qq -y nfs-common rpcbind
#apt-get install -qq nfs-common rpcbind
5 changes: 3 additions & 2 deletions debian-setup/adduser
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ cat > /root/.bashrc <<"EOF"
#export LANG=en_US.UTF-8
#export LC_ALL=en_US.UTF-8
#export IP="$(ip addr show dev eth0|sed -ne 's/^\s*inet \([0-9\.]\+\)\b.*$/\1/p')"
export IP="$(ifconfig|sed -ne '0,/^\s*inet addr:\([0-9\.]\+\)\b.*$/s//\1/p')"
#export IP="$(ip addr show dev eth0|sed -n -e 's/^\s*inet \([0-9.]\+\)\b.*$/\1/p')"
#export IP="$(ifconfig|sed -n -e '/^eth/{n;s/^\s*inet addr:\([0-9.]\+\)\b.*$/\1/p;q}')"
export IP="$(ifconfig|sed -n -e '0,/^\s*inet addr:\([0-9\.]\+\)\b.*$/s//\1/p')"
export LS_OPTIONS='--color=auto'
eval "$(dircolors)"
alias ls='ls $LS_OPTIONS'
Expand Down
2 changes: 1 addition & 1 deletion debian-setup/cloud-init
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e -x

if ! [ -s /var/lib/cloud/data/instance-id ]; then
apt-get purge -qq -y cloud-init cloud-initramfs-growroot
apt-get purge -qq cloud-init cloud-initramfs-growroot
fi

# @TODO
Expand Down
2 changes: 1 addition & 1 deletion debian-setup/grub-pc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e -x
# @FIXME
# # GRUB and PyGrub
# if ! [ -f /boot/grub/grub.cfg ] || ! grep -q "^menuentry\s" /boot/grub/grub.cfg; then
# apt-get purge -qq -y grub-pc
# apt-get purge -qq grub-pc
# fi

# Check MBR
Expand Down
2 changes: 1 addition & 1 deletion debian-setup/ifenslave
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -e -x

if ! lsmod | grep -q "^bonding\s"; then
apt-get purge -qq -y ifenslave
apt-get purge -qq ifenslave
fi
2 changes: 1 addition & 1 deletion debian-setup/lvm2
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -e

if ! pvdisplay -s &> /dev/null; then
apt-get purge -qq -y lvm2
apt-get purge -qq lvm2
fi
2 changes: 1 addition & 1 deletion debian-setup/mdadm
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -e -x

if ! [ -f /proc/mdstat ]; then
apt-get purge -qq -y mdadm
apt-get purge -qq mdadm
fi
2 changes: 1 addition & 1 deletion debian-setup/pppoeconf
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -e -x
# @FIXME pppoe also

if ! ps --no-headers -C pppd > /dev/null; then
apt-get purge -qq -y pppoeconf
apt-get purge -qq pppoeconf
fi
4 changes: 2 additions & 2 deletions debian-setup/systemd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ "$WITHOUT_SYSTEMD" == "yes" ]; then
echo -e 'Package: *systemd*\nPin: origin ""\nPin-Priority: -1' > /etc/apt/preferences.d/systemd
# Schedule removal of systemd
echo "PATH=/usr/sbin:/usr/bin:/sbin:/bin
@reboot root apt-get purge -qq -y --auto-remove systemd > /dev/null;rm -f /etc/cron.d/withoutsystemd" > /etc/cron.d/withoutsystemd
@reboot root apt-get purge -qq --auto-remove systemd > /dev/null;rm -f /etc/cron.d/withoutsystemd" > /etc/cron.d/withoutsystemd

set +x
echo
Expand All @@ -23,7 +23,7 @@ if [ "$WITHOUT_SYSTEMD" == "yes" ]; then
fi
elif [ "$(dpkg-query --showformat="\${Status}" --show sysvinit-core 2> /dev/null)" == "install ok installed" ]; then
# Remove SysVinit
apt-get purge -qq -y sysvinit-core
apt-get purge -qq sysvinit-core
# Time synchronization
timedatectl set-ntp 1
fi
2 changes: 1 addition & 1 deletion debian-setup/virt-what
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
set -e -x

virt-what > /root/virt-what.log
apt-get purge -qq -y virt-what
apt-get purge -qq virt-what
2 changes: 1 addition & 1 deletion debian-setup/waagent
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set -e -x
AZURE_DHCP_LEASES="/var/lib/dhcp/dhclient.eth0.leases"
if [ -f "$AZURE_DHCP_LEASES" ] && ! grep -q "unknown-245" "$AZURE_DHCP_LEASES"; then
# https://github.com/Azure/WALinuxAgent
apt-get purge -qq -y waagent
apt-get purge -qq waagent
fi
3 changes: 3 additions & 0 deletions package/s3ql-jessie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,7 @@ s3qlctrl --version

rm -f requirements.txt "$RELEASE_FILE" "${RELEASE_FILE}.asc"

# Optionally remove these packages
#apt-get purge -y libattr1-dev libfuse-dev libsqlite3-dev build-essential dpkg-dev pkg-config mercurial python3-dev

echo "OK."
39 changes: 23 additions & 16 deletions upcloud-init.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#!/bin/bash
#
# nano upcloud-init.sh
# Prepare UpCloud server with docker and pip.
#
# bash -x upcloud-init.sh
# Initialization script: https://github.com/szepeviktor/debian-server-tools/raw/master/upcloud-init.sh

# http://deb.debian.org/debian/pool/contrib/g/geoip-database-contrib/
GEOIP_VERSION="1.19"

export LC_ALL="C"
export DEBIAN_FRONTEND="noninteractive"

Auto_country() {
apt-get clean
apt-get update
apt-get install -qq -y geoip-bin netselect-apt
apt-get install -qq geoip-bin netselect-apt
wget -nv "http://deb.debian.org/debian/pool/contrib/g/geoip-database-contrib/geoip-database-contrib_${GEOIP_VERSION}_all.deb"
dpkg -i geoip-database-contrib_*_all.deb

Expand All @@ -27,36 +30,40 @@ Auto_country() {
| sed -e "s|@@MIRROR@@|${MIRROR}|" > /etc/apt/sources.list
}

set -e
set -e -x

# Create temporary files in /tmp
[ -d /tmp ] && cd /tmp/

# Change to home directory
cd || exit 100
# Output may end up in a log file
echo 'Dpkg::Use-Pty "0";' > /etc/apt/apt.conf.d/00usepty

# LeaseWeb sources
wget -nv -O /etc/apt/sources.list \
"https://github.com/szepeviktor/debian-server-tools/raw/master/package/apt-sources/jessie-for-upcloud.list"
#Auto_country

apt-get clean
apt-get update
apt-get clean -q
apt-get update -q
# Prevent kernel update
#apt-mark hold linux-image-amd64 "linux-image-[0-9].*-amd64"
apt-get dist-upgrade -y
apt-get dist-upgrade -q -y

# docker
apt-get install -qq -y apt-transport-https
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 2C52609D
apt-get install -qq apt-transport-https
apt-key adv --keyserver "hkp://p80.pool.sks-keyservers.net:80" --recv-keys 2C52609D
echo "deb https://apt.dockerproject.org/repo debian-jessie main" \
> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -qq -y docker-engine
apt-get update -q
apt-get install -qq docker-engine
docker version

# pip
apt-get install -qq -y python3-dev
apt-get install -qq python3-dev
wget -nv "https://bootstrap.pypa.io/get-pip.py"
python3 get-pip.py
pip3 --version
rm -f get-pip.py
pip3 --version

rm -f /etc/apt/apt.conf.d/00usepty

echo "OK."
1 change: 1 addition & 0 deletions virtualization/jessie-backport/debackport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#
# Hooks
#
# 0. Install all Debian packages from /opt/results/
# 1. init - Before everything else
# 2. source - Provide custom source, should change to source directory and set CHANGELOG_MSG
# 3. pre-deps - Just before dependency installation
Expand Down
5 changes: 4 additions & 1 deletion virtualization/jessie-backport/docker-backport-s3ql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@ Build s3ql/testing
# Clean up hook files
rm -f /opt/results/{debackport-init,debackport-pre-deps}

set +x
# First interface by name eth* with an IPv4 address
IP="$(ifconfig|sed -n -e '/^eth/{n;s/^\s*inet addr:\([0-9.]\+\)\s.*$/\1/p;q}')"
echo "4×OK."
echo "scp -r root@94.237.28.148:/opt/results/ ./"
echo "scp -r root@${IP}:/opt/results/ ./"
5 changes: 3 additions & 2 deletions webserver/Production-website.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,15 @@ Send to Analytics, report to `/js-error.php`

### Compatiblitity

- Toolbar color of Chrome for Android (`theme-color` meta)
- [Printer](http://www.printfriendly.com/)
- [Accessibility attributes](https://www.w3.org/TR/wai-aria/states_and_properties) for screen readers
- [Accessibility Guidelines](https://www.w3.org/TR/WCAG20/)
- Microsoft/Libre Office (copy-and-paste content or open URL)

### External resources (3rd party services)
### Integration (3rd party services)

Document in 3rd-party-README.md and check functionality.
Document in `3rd-party-README.md` and check functionality.

- External search
- Tracking codes (make *UA-number* `'UN'+'parse'+'able'`)
Expand Down

0 comments on commit c7857e3

Please sign in to comment.