Phone Special Codes

Read More
  • Field Mode: *3001#12345#*
    Type *3001#12345#* into your phone’s dialer and then press the green call button to access “Field Mode,” which can give you access to info about local networks and cell towers
  • General Test Mode: *#0*#
    Test operations (only Android?)
  • Display your IMEI: *#06#
  • Check Your Call Forwarding: *#67#
    This code allows you to check which number your phone is currently forwarding calls to when you’re busy or reject a call. By default, this is probably your carrier’s voicemail service
  • Get Even More Info on Call Forwarding: *#61#
  • Check Your Available Minutes: *646#
  • Check Your Bill Balance: *225#
  • Hide Your Phone From Caller ID: #31#
    For one instance dial code just before the phone number
  • Show Your Phone From Caller ID: *31#
  • Check Your Billing Cycle: *3282#
  • SMS Message Center: *5005*7672#
  • Activate Call Waiting: *43#
  • Deactivate Call Waiting: #43#</li>
  • Quick Test Menu (Samsung Galaxy Only) *#7353#
  • Firmware (Samsung Galaxy Only) *#1234#

How to check the MySql version

Read More

Create a query with:

SHOW VARIABLES LIKE "%version%";

Result is similar to:

Variable_name            Value                         
-----------------------  ------------------------------
innodb_version           5.6.35                        
protocol_version         10                            
slave_type_conversions                                 
version                  5.6.35-log                    
version_comment          MySQL Community Server (GPL)  
version_compile_machine  x86_64                        
version_compile_os       Win64

Commands to check spam in Ubuntu with Postfix

Read More

mailq   Watch the mail queue
postfix -f  Flush the mail queue
postsuper -d ALL To remove all mails from the queue
postsuper -d deferred deferred To remove all mails in the deferred queue
find /var/spool/postfix/deferred -type f | wc -l    To know the number of messages sitting in the deferred queue
postcat -vq ID To view message content in queue with ID
qshape active Display number of emails being sent to each domain and how long they have been in the active queue
qshape deferred Display differed queue
tail -f /var/log/mail.log View the log in realtime
To check mail log for sent messages
cat /var/log/mail.log |grep -v "relay=local" |grep "relay=" |grep "status=sent"

To get statistics, install a script:

wget http://jimsun.linxnet.com/downloads/pflogsumm-1.1.1.tar.gz
tar -zxf pflogsumm-1.1.1.tar.gz
chown root:root pflogsumm-1.1.1
cd pflogsumm-1.1.1
cat /var/log/mail.log | ./pflogsumm.pl

You can move pflogsumm.pl to /usr/local/bin

To send a weekly report

Create /etc/cron.weekly/mailreport
#!/bin/sh
#
# mailreport cron weekly
MailSubject="Email report $(date +%d-%m-%Y)"
cat /var/log/mail.log | /usr/local/bin/pflogsumm.pl | /usr/bin/mailx -s "$MailSubject" your.mail@domain.com
exit 0

Change file permissions to read, execute
chown root:root /etc/cron.weekly/mailreport
chmod 755 /etc/cron.weekly/mailreport

Report today problems

pflogsumm -d today /var/log/mail.log --problems_first

Get permanent errors hard bounces
grep " dsn=5." /var/log/mail.log | grep -o -P " to=<(.+?)>" | sort | uniq -c
Get soft bounces
They start with 4…
grep " dsn=4." /var/log/mail.log | grep -o -P " to=<(.+?)>" | sort | uniq -c

To check user logins

grep "sasl_method=LOGIN" /var/log/mail.log