Facebook Twitter
Linkedin LJ
Git Instagram
IPv6
36 posts tagged

linux

Later Ctrl + ↑
2016   gnome   linux

CentOS 7.2 -> 7.3

  • it’s now rolling release, so to get updated:
yum install yum-utils
yum-config-manager --enable cr
yum update
  • it restores SELinux context to all defaults, so need to repeat all changes.
2016   centos   IT   linux

FC 25 annoying auth bugs

Evolution keeps failing to connect to Google calendars if it works for more than one day. Restarting goa-daemon with

/usr/libexec/goa-daemon --replace

does not always help. That is frustrating: why not always?

2016   desktop   linux

Evolution mail signature workaround

Evolution mail application in the Fedora 25 has annoying bug: it freezes when trying to add/edit signature (although, you can delete old one). It’s a known bug fixed in upstream and you can actually edit signature files (it’s quite tricky), but you can add shell script that would generate signature for you.

UPD: need to use “cowsay `fortune`”

2016   desktop   gnome   linux

Today I’ve learned...

My colleagues from the linux.org.ru board have found out one small flaw, so everyone including me stared to dance around PGP/GPG. So far I have found that among my systems:

  • Linux works as it should: two mouse clicks and you are ready. Covers 100% of my work mail, 75% of my personal mail.
  • Mac OS Sierra is not ready: GPG Suite has no support for the mail.app yet, just a workaround (yet). Hopefully we will see the solution in days.
  • iOS has only S/MIME out of the box, but GPG/PGP solution is ugly (due to restrictions).

And I don’t like install software that does not come with the operating system, for a reason :-)

2016   internet   ios   IT   linux   mac   mail   security

Backuping mysql

Recently I have to backup mysql database on quite heavily loaded server and I wanted to make backup daily on one hand and I wanted them not to affect production on the other. DB size is more than 150 Gb, about 50k users daily.

First approach was ty try to simply run musqldump and see what would happen. Site was down right after the backup has begun. Then I have tried to nice the mysqldump with

/usr/bin/nice -n 10 ionice -c2 -n 7

The result was better, site was down at about 10% of the job. Next I add --single-transaction, that have solved about 95% of problems, still some time site was down, so I had to add -q option. The final command was:

/usr/bin/nice -n 10 ionice -c2 -n 7 /usr/bin/mysqldump --plugin-dir=/usr/lib/mysql/plugin --user=dbuser -h bd.lxc --port=3306 --all-databases --single-transaction -q|/bin/gzip >  /var/bcp/backup-db-`/bin/date -I`.sql.gz
2016   IT   linux   mysql   web

E-mail notification on every login

It’s useful sometimes to get notifications on every ssh login that is happen on the server (though, could be used to monitor logins made by other means). First method is based on the /etc/profile, but it should not be used because user can override it with setting own variables if home directory is writable for him. Most convenient is to use PAM, putting in the /etc/pam.d/sshd execution of the script that whould send the mail in the session section:

session optional pam_exec.so seteuid  /usr/local/bin/send_mail.sh

I would not recommend to set “required” here because the fail of the scrip should not be critical. The script just sends notification mail:

#!/bin/sh
if [ "$PAM_TYPE" != "open_session" ]
then 
	exit 0

else
  {
    echo "User: $PAM_USER"
    echo "User: $PAM_TYPE"
    echo "Remote Host: $PAM_RHOST"
    echo "Service: $PAM_SERVICE"
    echo "TTY: $PAM_TTY"
    echo "Date: `date`"
    echo "Server: `uname -a`"
 } | mail -s "$PAM_SERVICE login on `hostname -s` for account $PAM_USER" admin@example.com
fi

exit 0

Don’t forget to put +x permissions on it with:

chmod +x  /usr/local/bin/send_mail.sh
2016   IT   linux

DNSBL checkers list

Since I am now running my own smtp-server, I have to deal with different black list servers myself and check my IP from time to time if it’s there or not.To cover pretty much everything valuable:

https://www.whatismyip.com/blacklist-check/
http://whatismyipaddress.com/blacklist-check
http://mxtoolbox.com/SuperTool.aspx?action=blacklist%3a85.17.249.170&run=toolpage

My IP was in 2 lists, DAN ME, APEWS and Barracuda.

DAN ME is a list maintained by some loser, who lists there all TOR-related IP addresses he can find. Unfortunately he lists not only the exit-points, but relays as well. Fortunately, his list is automated, but I had to shut down the TOR node.

Barraccuda removes by request, however, sells “subscription” for $20, so you will not be in the list again. That’s low!

At the moment it’s in the APEWS for 3(!) years and the owner has a long faq where he is explaining why he would not remove you ever.

Thinking of extra VPS for the additional MX.

2016   dns   IT   linux   networking

Leaseweb IPv6 PTR

Just for the record: Leaseweb does not support PTR record setting for the IPv6 address from the web panel, but you can ask the support team to set it with ticket. Google rejects my mail that comes from the IPv6 network with “PTR not found” message.

2016   dns   linux

SUDO !-rules

Checked one insecure approach to use sudo not to allow commands, but to prohibit commands for user with the NOT-operator “!”. Why it’s a bad idea we can see in the sudoers man page:

” Limitations of the ‘!’ operator
It is generally not effective to “subtract” commands from ALL using the ‘!’ operator. A user can trivially circumvent this by copying the  desired command to a different name and then executing that. For example:

bill ALL = ALL, !SU, !SHELLS

Doesn’t really prevent bill from running the commands listed in SU or SHELLS since he can simply copy those commands to a different name, or use a shell escape from an editor or other program. Therefore, these kind of restrictions should be considered advisory at best (and reinforced by policy).”

RHEL 5,6 – works
RHEL 7 – does not work, which is good. Still, wanted by some customers.

2016   IT   linux   sudo
Earlier Ctrl + ↓