Commit b03399a6 authored by david's avatar david 💬

cleaned up repo and started on something new

parent 7cb5c4f1
# .dotfiles
*vim, zsh and stuff*
*This repository holds various personal configs, homemade zsh plugins and random scripts. Go ahead and reuse.*
* [Installation](#installation)
* [ZSH plugins](#zsh-plugins)
## Installation
Here goes a online installer:
```
curl -xyz https://socialg.it/david/dotfiles/install.sh; bash install.sh
```
## ZSH plugins
* public ssh key deployment
* ubuntu prep script
- setup strong root password
* nice motd (+checks)
* snmp setup (for ubuntus, and else?)
* let's encrypt/getssl/dns verification/miab deployment
* fail2ban setup (for ssh on ubuntus, and else?)
* duplicity/backup deployment
- setup backup
- easy restore
- notification mails (only on error) -> [ ] make enterprise & relativity backup notification more silent
* openssh setup (for ubuntus and else?)
- set strong ciphers/methods (check!)
- disable PasswordAuthentication (check!)
- disable AllowRootLogin (check!)
- setup sshusers group and configure sshd accordingly (check! list users)
- deploy SSHFP DNS records to MIAB (check!)
- reset hostkeys (make secure hostkeys) (check for strong keys!)
- setup fail2ban for ssh (check?)
- make chroot for users easy
* miab post-install/-upgrade script
- script to disable owncloud/nextcloud in miab
- also maybe enforce dmarc (spf/dkim)
- patch -p 22 in backup script (or make a pr)
#!/bin/bash
# this is just a collection of lines i used to install my new thinkpad
fdisk -ll
clear
sudo fdisk /dev/sda
mkfs.ext4 /dev/sda1
sudo mount /dev/sda1 /mnt
pacman -Sy
pacstrap /mnt base zsh wget openssh curl htop nload bash-completion zsh sshuttle xorg-server i3 i3status dmenu vim firefox sudo grub
genfstab -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt
vim /etc/hostname
vim /etc/hosts
ln -sf /usr/share/zoneinfo/Europe/Vienna /etc/localtime
vim /etc/locale.gen
locale-gen
echo en_US.UTF-8 > /etc/locale.conf
vim /etc/console.conf
mkinitcpio -p linux
/bin/sh
#!/bin/bash
# basic installer for my configs
# Basic installer for my personal dotfiles.
# vim, vifm, zsh, i3(for desktops)
# maybe also: powerline fonts, gnome-terminal and some terminal multiplexer
# author: david@socialnerds.org
# license: MIT
# git: https://socialg.it/david/dotfiles.git
#which host am i
#create links in ~ accordingly
echo "creating link for greywind"
# **** vars ****
command="$0"
root="$HOME/.dotfiles"
logfile="$HOME/.dotfiles.log"
timestamp=$(date +"%Y%m%d%H%M")
repo="https://socialg.it/david/dotfiles.git"
debug=1
# **** functions ****
message() {
if [ $1 == "e" ]; then
level="\033[31m✗\033[0m"
elif [ $1 == "i" ]; then
level="\033[32m✓\033[0m"
elif [ $1 == "w" ]; then
level="\033[33m!\033[0m"
elif [ $1 == "d" ]; then
if [ $debug -eq 1 ]; then
level="\033[2md\033[0m"
else
return 0
fi
else
message e "Unknown message level[$1]."
return 1
fi
echo -e [$level] ${@:2}
echo -e [$timestamp][$command][$1] ${@:2} >> $logfile
sleep 0.1
}
echo "what do you want me to do?"
read input
echo $input
failsafe() {
if [ $1 -ne 0 ]; then
message e "Installer died horribly!"
if [ $2 ]; then
message d "Dumping last output to logfile[$logfile] and stdout."
echo ${@:2} | tee -a $logfile
fi
exit 1
fi
}
# **** debugging/testing stuff ****
#rm -rf $root*
#ln -s $HOME/Git/dotfiles $root
# **** start of script ****
message d "Warming up dotfiles installer."
message d "Initiating preflight checks."
# check if logfile exists and is writeable, if not try to create it with failsafe
# check dependencies, try to install missing with failsafe
# (awk tee ls git wget/curl rm mv sleep date)
# check for preexisting data at install destination, get rid of it
if [ -h $root ]; then
link=$(ls -la $root | awk '{print $9" "$10" "$11}')
# It should be safe to just remove symbolic links because no data is actually deleted.
message d "Symbolic link exists at the install destination, attempting to remove it[$link]."
output=$(rm $root 2>&1); failsafe $? $output
message i "Removed symbolic link at the install destination."
elif [ -a $root ]; then
message d "Data exists at install destination, attempting to create a backup[$root.old.$timestamp]."
output=$(mv $root $root.old.$timestamp 2>&1); failsafe $? $output
message i "Created a backup of a preexisting folder at the install destination[$root.old.$timestamp]."
fi
# clone dotfiles
message d "Attempting to clone git repository[$repo] into $root."
output=$(git clone $repo $root 2>&1); failsafe $? $output
message i "Cloned git repository into $root."
message d "Installer finished."
# **** end of script ****
# needed git repo
https://github.com/vifm/vifm-colors.git
https://github.com/robbyrussell/oh-my-zsh.git
git@socialg.it:david/dotfiles.git
# software
_my software setup_
## resource setup
- archlinux
- Xorg
- some tiny login manager (autologin)
- i3, i3status, i3lock, dmenu, feh
- some terminal (maybe gnome-terminal)
- zsh, oh-my-zsh, vim, powerline
- sshuttle
- multimc
- vlc
- git
- mumble
- some filemanager (nautilus/vifm/pcmanfm)
- some image viewer (the gnome thing is fine)
- firefox, chrome, chromium
- openssh (server & client)
- infinality fonts
- gtk theme
- .. to be continued
## random tool
- htop
- nload
- tshark / wireshark-cli
- powertop
## what needs?
-
Host defiant
KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms ssh-dss
Host valiant
KexAlgorithms +diffie-hellman-group1-sha1
HostkeyAlgorithms ssh-dss
/.*
spell
!.gitignore
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment