Suppress warning messages using mysql from within Terminal, but password written in shell script

Here’s how I got my bash script for my daily mysqldump database backups to work more securely.
1. First use mysql_config_editor (comes with mysql 5.6+) to set up the encrypted password file. Suppose your username is „db_user“. Running from the shell prompt:

mysql_config_editor set –login-path=local –host=localhost –user=db_user –password

It prompts for the password. Once you enter it, the user/pass are saved encrypted. Of course, change „system_username“ to your username on the server.

2. Change your shell script from this:

mysqldump -u db_user -pInsecurePassword my_database | gzip > db_backup.tar.gz

to this:

mysqldump –login-path=local my_database | gzip > db_backup.tar.gz

No more exposed passwords.

Samba 4 config example

# Samba 4 config example
# Connected to existing remote Samba 4 Active Directory Directory Controller
# ZFS pool @ /storage
# Network is
# Samba is installed with:
# pkg install samba42
# and then joined to existing AD with:
# samba-tool domain join <params>
# After this /usr/local/etc/smb4.conf is edited and restarted with /usr/local/etc/rc.d/samba_server restart
# Global parameters
server string = Samba Server
hosts allow = 192.168.101.
load printers = no
max log size = 50
# Add aio_load=“YES“ FreeBSD’s /etc/rc.conf
aio read size = 16384
aio write size = 16384
aio write behind = true
use sendfile = true
read raw = true
min receivefile size = 16384
interfaces =
dns proxy = no
# These files are never saved
veto files = /Thumbs.db/.DS_Store/._.DS_Store/.apdisk/
delete veto files = yes
workgroup = HOME
realm = home.lan
netbios name = STORAGE
server role = active directory domain controller
path = /var/db/samba4/sysvol/home.lan/scripts
read only = No
path = /var/db/samba4/sysvol
read only = No
# ZFS pool
path = /storage
force directory mode = 0666
force create mode = 0666
create mask = 0666
directory mask = 0666
read only = no
public = no
writable = yes
vfs objects = zfsacl
nfs4:mode = special
nfs4:acedup = merge
nfs4:chown = yes
vfs object = recycle
# Remove deleted files to recycle bin directory with username and timestamp
recycle:repository = /storage/recyclebin/%U/%T
recycle:keeptree = Yes
recycle:touch = Yes
recycle:versions = Yes
recycle:directory_mode = 0666
recycle:subdir_mode = 0666
nt acl support = yes
inherit acls = no
map acl inherit = yes

git via proxy

# echo $http_proxy

# git config –global http.proxy $http_proxy

# git config –get http.proxy

FreeBSD commands to set/check MTU

Here are various methods to change interface/ip interface MTU on current FreeBSD distros:

# ifconfig {interface-name} {ip-address} mtu 9000

# route change {ip-address/mask} -mtu 9000

To see the current MTU settings:

# route get {destination-IP-address} / ifconfig {interface-name}


route get
   route to:
  interface: em0
      flags: <up,done,cloning>
 recvpipe  sendpipe  ssthresh  rtt,msec    rttvar  hopcount      mtu     expire
       0         0         0         0         0         0      9000   -454924

PHP 7 on FreeBSD 10.3

Днес реших да опитам какво е поведението на PHP 7.0.3, заменяйки PHP 5.6.18 върху този уеб сървър. На него се използват wordpress, piwik, owncloud, awstats, roundcube, cacti.
Не се наблюдаваха съществени проблеми, изключвайки отсъствието на често използваните extensions pecl-memcache, pecl-redis и php-mysql ( за щастие има php-mysqli което налага промяна на конфигурацията в някой от софтуерите – в моят случай roundcube ).

Процесът изискваше изпълнение на следната команда:
portmaster -o lang/php70 php56 повторено “n” пъти за всеки от инсталираните php56 extensions. На моменти се случва така че да трябва да се размени редът който сте си приготвили, за да може да се компилират нещата ( при мен подредбата изглежда така  ).

За да се използва redis поради това че няма готов freebsd port се прави следното:

git clone -b php7
mv phpredis/ /etc/ && cd /etc/phpredis
phpize && ./configure && make && make install
cd /etc && rm -rf phpredis
echo ‘’ >> /usr/local/etc/php/extensions.ini
проверява се дали модулът се е инсталиран с командата „php –ri redis” .

Mоже отново да се използва owncloud със следната конфигурация и възползвайки се от ускорението което му дава redis:

‘memcache.local’ => ‘\\OC\\Memcache\\Redis’,
‘filelocking.enabled’ => ‘true’,
‘memcache.distributed’ => ‘\\OC\\Memcache\\Redis’,
‘memcache.locking’ => ‘\\OC\\Memcache\\Redis’,
‘redis’ =>
array (
‘host’ => ‘localhost’,
‘port’ => 6379,
‘timeout’ => 0,
‘dbindex’ => 0,

За да накарате cacti да заработи отново направете следното:

cd /usr/local/share && mv cacti cacti.port && git clone
cp cacti.port/include/config.php cacti/include/ && chown -R www:www cacti