Shell C PHP Python Perl C++ Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
backup daily Aug 15, 2018
debian-setup daily Aug 15, 2018
image daily Jul 10, 2018
input daily Jul 10, 2018
mail website/html -> website/code and add non-ascii-hu.sh Aug 17, 2018
monitoring website/html -> website/code and add non-ascii-hu.sh Aug 17, 2018
mysql daily Aug 8, 2018
package website/html -> website/code and add non-ascii-hu.sh Aug 17, 2018
repo @ 362c130 daily Jul 29, 2018
security website/html -> website/code and add non-ascii-hu.sh Aug 17, 2018
tools daily Jul 11, 2018
virtualization daily Jul 29, 2018
webserver website/html -> website/code and add non-ascii-hu.sh Aug 17, 2018
.editorconfig daily Aug 11, 2018
.gitattributes linguist-language Feb 6, 2018
.gitignore daily May 5, 2017
.gitmodules daily May 17, 2018
.travis.yml daily Dec 4, 2016
Application-infrastructure.png daily Apr 6, 2018
Bash-exit-codes.md daily Jul 19, 2018
CV-WordPress.md daily Jul 31, 2018
CV.md daily Jul 12, 2018
Git-pull.sh daily Apr 4, 2017
Hosting.md daily Jun 5, 2018
LICENSE Initial commit Aug 1, 2014
Onboarding.md daily Aug 15, 2018
Page-html-load-time.png Add Page-html-load-time.png Mar 23, 2018
README.md daily May 21, 2018
clone-server-debconf.sh daily May 12, 2018
clone-server-snapshot.sh First preparation to stretch Apr 29, 2017
debian-convert-ext3-ext4.sh daily Apr 5, 2018
debian-image-check.sh daily Jul 12, 2017
debian-image-normalize.sh daily May 1, 2018
debian-install-preseed.sh daily Feb 25, 2017
debian-resizefs.sh daily Apr 5, 2018
debian-setup-baremetal.sh daily May 11, 2017
debian-setup-functions.inc.sh PHP version independence Apr 20, 2018
debian-setup-starter.sh daily Jul 20, 2018
debian-setup.sh daily Jul 25, 2018
debian-setup2.sh daily Jul 19, 2018
install-cron.sh daily Jul 10, 2018
install.sh daily Jul 10, 2018
managed-hosting.png today Nov 17, 2015
server.yml daily Jun 10, 2018
uninstall-cron.sh daily Jul 10, 2018
uninstall.sh daily Jul 10, 2018
upcloud-init.sh daily Jul 6, 2018
upcloud-os-image-cleanup.sh daily Nov 13, 2016
upcloud_create_server.py daily Jul 29, 2018
upcloud_destroy_server.py daily Jul 31, 2018
update.sh daily Jan 29, 2017

README.md

Debian server tools

Various scripts and tools mainly for Debian servers.

World's fastest cloud servers

Install Debian on UpCloud

How to choose VPS provider?

See https://github.com/szepeviktor/wordpress-speedtest/blob/master/README.md#how-to-choose-vps-provider

Model of how systems work

Richard Cook at Velocity NY 2013

Debian install with UTC as timezone

Select Expert install.

Directories

  • /backup - Tools related to archiving
  • /image - Tools related to image optimization
  • /input - Tools related to the terminal
  • /mail - Tools related to email account management
  • /monitoring - Tools related to server monitoring, alert and statistics emails
  • /mysql - Tools related to database management
  • /package - Tools related to Debian packages and general packaging
  • /security - Security and SSL certificate related tools
  • /tools - Various small tools
  • /virtualization - Docker containers
  • /webserver - Tools related to building webservers

Script development

Install your own SSH key

S="${HOME}/.ssh";mkdir --mode 0700 "$S";editor "${S}/authorized_keys"
ssh-keygen -v -l -f "${S}/authorized_keys"

authorized_keys parameters:

# restrict == no-port-forwarding,no-agent-forwarding,no-X11-forwarding,no-pty,no-user-rc
restrict,command="echo 'Please login as the user \"debian\" rather than the user \"root\".';echo;sleep 10" ssh-rsa AAAA...

Install a user's SSH key

u bash -c 'S="${HOME}/.ssh";mkdir --mode 0700 "$S";editor "${S}/authorized_keys"'
U="$(stat -c %U .)";S="$(getent passwd $U|cut -d: -f6)/.ssh";mkdir -m 0700 "$S";editor "${S}/authorized_keys";chown -R $U:$U "$S"

Retrieve public key from private key

ssh-keygen -y -f ~/.ssh/id_ecdsa

List sshd host keys

ls /etc/ssh/ssh_host_*_key.pub | xargs -n 1 ssh-keygen -l -f

Record terminal session

script --timing=NAME.time --append NAME.script
scriptreplay --maxdelay 1 NAME.time NAME.script

Fast and safe transit of scripts (or any data) via copy&paste

Pack
cat $SCRIPT|xz -9|base64 -w $((COLUMNS-1))
# alias: cat $SCRIPT | transit
Unpack
cat $PASTED_FILE|base64 -d|xz -d > $SCRIPT
# alias: cat $PASTED_FILE | transit-receive

Moving away git-dir

git init --separate-git-dir=/home/user/gitdir

Produces:

/home/user/work-dir/.git: gitdir: /home/user/git

/home/user/gitdir/config: worktree = /home/user/work-dir

Rescan the SCSI Bus to Add SCSI Devices

echo "- - -" > /sys/class/scsi_host/host0/scan

Flush Google public DNS cache

https://google-public-dns.appspot.com/cache

Free CDN for GitHub

https://rawgit.com/ https://cdn.rawgit.com/USER/REPO/TAG/FILE

ROA validation, RPKI status

whois -h whois.bgpmon.net 84.2.228.0

UNICODE owl domain name

﴾͡๏̯͡๏﴿.tk

Crontab format

.---------------- minute (0 - 59)
| .-------------- hour (0 - 23)
| |  .----------- day of month (1 - 31)
| |  | .--------- month (1 - 12)
| |  | | .------- day of week (0 - 6)
| |  | | |
* *  * * *  USER  COMMAND
crontab -e -u USER
.---------------- minute (0 - 59)
| .-------------- hour (0 - 23)
| |  .----------- day of month (1 - 31)
| |  | .--------- month (1 - 12)
| |  | | .------- day of week (0 - 6)
| |  | | |
* *  * * *  COMMAND

Looking for maintenance for your application or website?

Contact me: viktor@szepe.net