2016, August, 30

Migrate mail from one server to another with imapsync

Have you been in the situation where you needed to move everyone’s mail from one provider to another?  It’s a pain to do using the mail client one at a time, but with this guide, you’ll be able to create a csv with everyone’s info and run one command to fire it all off.  All you need is a Linux machine to do it.

First, you’ll need to install the epel repo (skip if you already have it):

Read More
2016, August, 30

iredmail migration from qmail with emails and mail box

  1. Log on to qmail server and export user account to csv and copy that file to new iredmail server.
    #mysql -uvpopmail vpopmail -pPassW0rd  -e " select pw_name,pw_gecos,pw_clear_passwd from test_com "  | sed 's/\t/","/g;s/^/"/;s/$/"/' > migration_list.csv
    #cat migration_list.csv
    raja.kc,raja ram kc (mc),1raja23
  2. login to iredmail server iRed source file to tools
    #cd 
    /root/iRedMail-0.9.5-1/tools
    #cat >create_mail_user_sql_migration.sh
  3. [root@mx tools]# cat >create_mail_user_sql_gen.sh
Read More
2016, August, 30

How do I export from MYSQL to CSV in mariadb on Centos 7?


If you can cope with table-at-a-time, and your data is not binary, use the -B option to the mysqlcommand. With this option it'll generate TSV (tab separated) files which can import into Excel, etc, quite easily:

% echo 'SELECT * FROM table'| mysql -B -uxxx -pyyy database

Alternatively, if you've got direct access to the server's file system, use SELECT INTO OUTFILE which can generate real CSV files:

SELECT*INTO OUTFILE 'table.csv'
    FIELDS TERMINATED BY',' OPTIONALLY ENCLOSED BY'"'
    LINES TERMINATED BY'\n'FROMtable

mysql -uvpopmail vpopmail -pPassW0rd  -e " select pw_name,pw_gecos,pw_clear_passwd from test_com "  | sed 's/\t/","/g;s/^/"/;s/$/"/' > migration_list.csv

2015, December, 22

bathroom status

Steps

 

 

  1. sudo apt-get install python-dev python-rpi.gpio
  2. sudo apt-get install python-beautifulsoup
  3. copy status.py to home directory
  4. touch index.html
  5. configure apache
    1.  sudo apt-get install apache2 -y
    2. extra(
      sudo apt-get install php5 libapache2-mod-php5 -y
      )
  6. chown -R pi:root /var/www/html
  7. run python status.py
    1. python status.py &
  8. browser ipaddress(192.168.1.10)

#Import All the Libraries
import threading, re, time, os, sys
import sqlite3 as lite
from time import strftime
from BeautifulSoup import BeautifulSoup
import RPi.GPIO as GPIO
import subprocess
import os
from time import sleep

#Setup GPIO Pins
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
#serverRoom
#GPIO.setup(5,GPIO.IN)
GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#Floor2BoysRestRoom
#GPIO.setup(13,GPIO.IN)
GPIO.setup(13, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#Floor2MeetHall1
#GPIO.setup(20,GPIO.IN)
GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#Floor2MeetHall2
#GPIO.setup(12,GPIO.IN)
GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#Floor3BoysRestRoom
#GPIO.setup(16,GPIO.IN)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#Floor1MeetHall1
#GPIO.setup(17,GPIO.IN)
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
#Floor1BoysRestRoom
#GPIO.setup(23,GPIO.IN)
GPIO.setup(23, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)

Read More
2015, August, 02

Changing And Resetting MySQL Root Passwords

mysqld_safe --skip-grant-tables &

Output:

[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Step # 3: Connect to the MySQL server using the MySQL client:

# mysql -u root

Output:

Read More