Centos 7 + postfix +postfix admin + dovecot + mysql

useradd -g vmail -u 5000 vmail -d /home/vmail -m

yum install dovecot dovecot-mysql  postfix mariadb  mariadb-server php php-imap php-mbstring php-pdo php-mysql php-fpm (optional postfix-perl-scripts)

secure mysql installation

mysql_secure_installation

mysql –

CREATE DATABASE postfix;

CREATE USER ‘postfix’@’localhost’ IDENTIFIED BY ‘shibaniakus’;

GRANT ALL PRIVILEGES ON `postfix` . * TO ‘postfix’@’localhost’;

// Postfix //

vim /etc/postfix/main.cf

virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf,mysql:/etc/postfix/mysql_virtual_alias_domains_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf, mysql:/etc/postfix/mysql_virtual_alias_domains_maps.cf
relay_domains = mysql:/etc/postfix/mysql_relay_domains.cf
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,

reject_non_fqdn_hostname,

Continue reading ‘Centos 7 + postfix +postfix admin + dovecot + mysql’ »

Redmine How To /postgres

/var/lib/pgsql/9.6/data/pg_hba.conf
host redmine redmine 127.0.0.1/32 md5

user add redmine12
add redmine12 in sudoers
cd /home/redmine12
wget http://www.redmine.org/releases/redmine-3.3.1.tar.gz
sudo tar zxvf redmine-3.3.1.tar.gz
sudo su postgres
psql
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD ‘@@’ NOINHERIT VALID UNTIL ‘infinity’;
CREATE DATABASE redmine WITH ENCODING=’UTF8′ OWNER=redmine;
cd redmine-3.3.1
Copy config/database.yml.example to config/database.yml and edit

  • production:
    adapter: postgresql
    database: redminedb
    host: localhost
    username: redmine
    password: “@@”

Continue reading ‘Redmine How To /postgres’ »

Windows 10 shits removal

Remove built-in shit apps

Get-AppxPackage –AllUsers | Select Name, PackageFullName

Get-AppxPackage –AllUsers *3dbuilder* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowsalarms* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowscalculator* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowscommunicationsapps* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowscamera* | Remove-AppxPackage

Get-AppxPackage –AllUsers *officehub* | Remove-AppxPackage

Get-AppxPackage –AllUsers *skypeapp* | Remove-AppxPackage

Get-AppxPackage –AllUsers *getstarted* | Remove-AppxPackage

Get-AppxPackage –AllUsers *zunemusic* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowsmaps* | Remove-AppxPackage

Get-AppxPackage –AllUsers *solitairecollection* | Remove-AppxPackage

Get-AppxPackage –AllUsers *bingfinance* | Remove-AppxPackage

Get-AppxPackage –AllUsers *zunevideo* | Remove-AppxPackage

Get-AppxPackage –AllUsers *bingnews* | Remove-AppxPackage

Get-AppxPackage –AllUsers *onenote* | Remove-AppxPackage

Get-AppxPackage –AllUsers *people* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowsphone* | Remove-AppxPackage

Get-AppxPackage –AllUsers *windowsstore* | Remove-AppxPackage

Get-AppxPackage –AllUsers *bingsports* | Remove-AppxPackage

Get-AppxPackage –AllUsers *soundrecorder* | Remove-AppxPackage

Get-AppxPackage –AllUsers *bingweather* | Remove-AppxPackage

Get-AppxPackage –AllUsers *xboxapp* | Remove-AppxPackage

Get-AppxPackage –AllUsers *king.com.CandyCrushSodaSaga* | Remove-AppxPackage

Get-AppxPackage –AllUsers *9E2F88E3.Twitter* | Remove-AppxPackage

Get-AppxPackage –AllUsers *Microsoft.Office.Sway* | Remove-AppxPackage

Get-AppxPackage –AllUsers *Microsoft.Messaging* | Remove-AppxPackage

Get-AppxPackage –AllUsers *Microsoft.Advertising.Xaml* | Remove-AppxPackage

Get-AppxPackage –AllUsers *Microsoft.Appconnector* | Remove-AppxPackage

Get-AppxPackage –AllUsers *Microsoft.MiracastView* | Remove-AppxPackage

Get-AppxPackage –AllUsers *Microsoft.CommsPhone* | Remove-AppxPackage

// Remove Cortana Completely //

regedit -> HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search.

If you don’t see a “Windows Search” key (folder) below the Windows folder, right-click the Windows folder and select New > Key. Name it “Windows Search”.Right-click the “Windows Search” key (folder) in the left pane and select New > DWORD (32-bit) Value.Name the value “AllowCortana”. Double-click it and set the value to “0”.

// Remove Cortana Completly (Pro & Enterprise) //

gpedit.msc

Computer Configuration > Administrative Templates > Windows Components > Search.

Search for “Allow Cortana” and set it to disabled.

// Remove OneDrive //

Open cmd as Administrator ->
taskkill /f /im OneDrive.exe
for 32-bit systems -> %SystemRoot%\System32\OneDriveSetup.exe /uninstall
for 64-bit systems -> %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall

regedit -> HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}

Double-click the System.IsPinnedToNameSpaceTree option in the right pane. Set it to 0 and click “OK”.

// RESTART AFTER ALL //

mysql hints

First steps
mysql_secure_installation

Passwordpress login mysql

create ~/.my.cnf  with
[client]
password=plaintextpassword
user=root

Create Database

long variant ;
create database testdb;

create user ‘testuser’@’localhost’ identified by ‘password’;

grant all on testdb.* to ‘testuser’ identified by ‘password’;

short one :

create database testdb;

grant all on testdb.* to ‘testuser’ identified by ‘password’;

Reset the MySQL Root Password

systemctl stop mysqld
mysqld_safe –skip-grant-tables &
mysql -u root
use mysql; update user SET PASSWORD=PASSWORD(“password”) WHERE USER=’root’; flush privileges; exit

systemctl start mysqld

Replication

Add in /etc/my.cnf  in [mysqld]

—master—
server_id=1
log-basename=master
log-bin
binlog-format=row
binlog-do-db=$NAME-OF-DB-TO-REPLICATE

—slave—

server-id = 2
replicate-do-db=$NAME-OF-DB-TO-REPLICATE

mysql-master-sql

GRANT REPLICATION SLAVE ON *.* TO 'user'@'%' IDENTIFIED BY 'password';

start slave;

SHOW MASTER STATUS;

!!!!Position and  File !!!

mysql-slave-sql

stop slave;

CHANGE MASTER TO MASTER_HOST=’IP8′, MASTER_USER=’user’, MASTER_PASSWORD=’password’, MASTER_LOG_FILE=’mariadb-bin.000005‘, MASTER_LOG_POS=245 ,MASTER_CONNECT_RETRY=5 ;

start slave;

SHOW SLAVE STATUS\G;