https://gist.github.com/willurd/5720255
Failed and working projects, notes etc.
UPDATE
git pull
make new local branch:
git checkout -b [name]
CHANGES
make changes, then add all:
git add .
commit:
git commit -m "comment"
push changes and create new branch:
git push
TO GET THE LATEST VERSION
git checkout master git pull git checkout [USER] git rebase master
Step 1. Fetch and check out the branch for this merge request
git fetch origin git checkout -b [USER] origin/[USER]
Step 2. Review the changes locally
Step 3. Merge the branch and fix any conflicts that come up
git fetch origin git checkout origin/master git merge --no-ff [USER]
Step 4. Push the result of the merge to GitLab
git push origin master
(In this case [USER] is foxsan. And you are not him.)
Virtualmin is a rock solid control panel for your VPS, it’s simple as that. It’s sometimes not so simple to set it up correctly due to its many options.
I’ve tried my best to make a decent manual that explains how to set up a domain and email in a quick and dirty way. I’m not talking about security and stuff yet. It’s just about setting things up.
I am also assuming your freshly (re)built VPS has a root password set and that you are now ssh-ing into it. If not, do it now.
ifconfig
It’s probably venet0 (that’s venetzero)
apt-get update
apt-get install wget nano curl ca-certificates -y
cd ~
wget http://software.virtualmin.com/gpl/scripts/install.sh
sudo /bin/sh install.sh
@ 1000 MX 10 mail.domainname.tld * 1000 A 0 VPS_IP_ADDRESS @ 1000 A 0 VPS_IP_ADDRESS ftp 1000 A 0 VPS_IP_ADDRESS localhost 1000 A 0 127.0.0.1 mail 1000 A 0 VPS_IP_ADDRESS pop 1000 A 0 VPS_IP_ADDRESS www 1000 A 0 VPS_IP_ADDRESS
Don’t worry about the SPF, domainkey, the acme-challenge and the dmarc yet.
All should be ready now and you should see a few success messages. If not, go fix.
apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove
apt-get autoclean
https://HOSTNAME:10000
Virtualmin is configured to setup DNS zones, but this system is not setup to use itself as a DNS server. Either add 127.0.0.1 to the list of DNS servers, or turn off the BIND feature on the module config page.
Click list of DNS servers and add 127.0.0.1 in the DNS Servers field and press Save. Next, click Apply Configuration. Then, click the Virtualmin on top, click System Settings and then Re-check Configuration.
Your Virtualmin installation is now ready to had domain names etc added.
DOMAINNAME 1000 TXT 0 v=spf1 a mx a:DOMAINNAME.TLD ip4:IPADDRESS1 ip4:IPADDRESS2 ?all
For the acme challenges:
_acme-challenge.mail 1000 TXT 0 RANDOMSTRING_OFCHARACTERS _acme-challenge 1000 TXT 0 RANDOMSTRING_OFCHARACTERS
Error requesting challenges: Error creating new authz :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/
Now this has been set up, you can poke your DNS settings again! Woo!
Now, clean up the rest in Notepad++:
“v=DKIM1; k=rsa; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAq8/I4PwduFS/q” “U4y6pDFNFYf868Z2p+BNw+QRMphZ6YnVt1MWeVtNIXnYvhUtf6jhAX2BZ5gl8R2ILyL9NCkFe8W5cAVR” “/cZkZl6OIc7fdTiLePYNCS3HcVcTiE0Szb3zwDRAZE2XyAqFvNQJuVe/H5tJxlOAu1vhqv3FuZM1viv9” “VfiPQ77oQ9eOmQMZH59+QL/Vw4fnUnui4QhqRaH+iLb1bQdcJqIu1y3M+bgSCmrSu7v40V1G+wmUY13J” “fg41SIvYbuEe+CGjwMjVW0KFC15x3m5ChwM3q68b5gBv0L+JeMG27+DDQ5CSUIZSAJU0XifyeAfTIfRe” “5L+Bec7hQIDAQAB”
VALIDATE and install FAIL2BAN
(sorry, i can’t remember how to proceed this installation since the last edit was two years ago.)
Good luck.
apt-get update
apt-get upgrade
apt-install git libjson-webtoken-perl libauthen-ntlm-perl libcgi-pm-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libfile-copy-recursive-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libhtml-parser-perl libjson-webtoken-perl libmail-imapclient-perl libparse-recdescent-perl libmodule-scandeps-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-mockobject-perl libtest-pod-perl libunicode-string-perl liburi-perl libwww-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus
cd /home
git clone https://github.com/imapsync/imapsync.git
cd imapsync
chmod +x imapsync
./imapsync
cpanm File::Tail
cp imapsync /usr/bin/
Done!
Item 10 is to make sure you can use this command anywhere on the server. Have fun!
Backports are recompiled packages from testing (mostly) and unstable (in a few cases only, e.g. security updates) in a stable environment so that they will run without new libraries (whenever it is possible) on a Debian stable distribution
Backports cannot be tested as extensively as Debian stable, and backports are provided on an as-is basis, with risk of incompatibilities with other components in Debian stable. Use with care!
It is therefore recommended to select single backported packages that fit your needs, and not use all available backports.
touch /etc/apt/sources.list.d/backports.list
nano /etc/apt/sources.list.d/backports.list
deb http://deb.debian.org/debian buster-backports main
apt-get update
apt-get -t buster-backports install "package"
source: https://backports.debian.org/Instructions/
su - usermod -aG sudo <username> exit exit
Now log back in as user (so not as root) and go on with your day.
git clone https://github.com/twolfson/sexy-bash-prompt.git
cd sexy-bash-prompt && make install && source ~/.bashrc
Sauce: https://github.com/twolfson/sexy-bash-prompt
su
enter root password
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
exit
node -v
Add user: adduser [username]
Change password: passwd [username]
For Debian 9 (and MacOS)
cd ~/.ssh
ls id_*
mkdir keys_backup
cp id_* keys_backup
ssh-keygen -t rsa -C "your_email@example.com"
cd ~/.ssh
Done.