Upgrade Debian Jessie to Strech

June 24, 2017 Comments off

The upgrade process is easy via the cli.
Just complete the following and answer any questions.
I let the system restart daemons automatically and kept original conf files.
This has worked on three Debian 8 systems without a hitch.

apt-get update
apt-get upgrade
apt-get dist-upgrade
cp /etc/apt/sources.list /etc/apt/sources.list_backup
sed -i ‘s/jessie/stretch/g’ /etc/apt/sources.list
apt-get update
apt list –upgradable
apt-get upgrade
apt-get dist-upgrade

After completing you can reboot and autoremove old packages.

Categories: sysadmin

copy your debian installed packages to a new machine

June 17, 2017 Comments off

Run this to retrieve a list of installed packages:

dpkg -l | grep ^ii | awk ‘{print $2}’ > installed_packages

Then install on new system with:

apt-get install $(cat installed_packages)

You should probably look at installed_packages and remove any obvious
errors.

Categories: sysadmin

Turn on syntax (color) in vim for Debian

February 8, 2017 Comments off

To add syntax checking to vim with Debian, just edit /etc/vim/vimrc and uncomment
the “syntax on” line.

Then your editor will show (in color) syntax errors in Postfix and html/css files.

Categories: sysadmin

disable or enable ipv6 ssh

September 20, 2016 Comments off

You may experience problems with ssh and ipv6. If so edit the /etc/ssh/sshd_config file
and enable the ListenAddress 0.0.0.0 option. You can also enable (unpound) the ipv6
option ListenAddress ::.

You may experience lockouts from ssh if you have AAAA ipv6 records in your nameserver if
you don’t make theses changes.

Be sure and restart ssh after changes.

Categories: sysadmin

Check Spamassassin perl modules

June 19, 2016 Comments off

To check spamassassin and verify all required perl modules are installed
run this:

spamassassin -D –lint 2>&1 | grep -i failed

then use cpan install module::name ie
cpan install Digest::SHA1

Some additions are required to augment the default install. There is benefit
to adding missing modules as a more complete spam analysis will occur.

Categories: sysadmin

Backup/Copy mysql or mariadb database

March 19, 2016 Leave a comment

You can copy or backup all your databases with these commands including
coping to another server.

# backup
mysqldump -u root -p yourdb > mysqlbak.sql
or for dumping all databases
mysqldump –all-databases -u root -p > mysqlbakall.sql
# restore
mysql -u root -p yourdb < mysqlbak.sql
to restore all databases
mysql -u root -p < mysqlbakall.sql

Categories: sysadmin

Reset Samsung S6 (+ variants) + battery tips

February 4, 2016 Leave a comment

It is simple to reset the Samsung S6. Sometimes this is necessary to improve battery life
and performance or just remove clutter from your phone.

First us Samsung’s excellent Smart Switch software (d/l from Samsung for Windows or OSX) and
backup your phone. The software backs up all your data including sms, email settings, etc.
It is very quick also.

Then do a hard reset by holding volume up key, home key, and power key with the phone
powered off. release the home key as soon as you see the Samsung logo and you should boot
into the recovery mode.

Then select from Recovery Mode menu “wipe data / factory reset” using Volume buttons to
navigate and Power button to confirm. After restarting your phone, connect backup to
your desktop and restore your phone with Smart Switch.

You find a few apps with setup requirements but it’s mostly painless.

After months of ownership and many experiments, I have found the best setup for battery life
on my S6-active was to change wifi-settings to enable wifi only while awake (#1 battery eater if
you enable wifi while sleeping) or if you don’t need/care about data usage, leave wifi off.
Also use android email app and only sync during most important part of day (settings has ability
to sync during specified hours) for your email. You can manually sync at other times.

If you take this approach, your S6 (or at least my S6-Active) shows 50+ hours standby after a full charge.

Categories: tech-tips