Cron Job : Logrotate MySQL Error

Receiving cron-daily emails with this error:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

It was fixed by making sure the password in the /etc/mysql/debian.cnf is the same as the one in the MySQL database.

Try running this command:

GRANT RELOAD, SHUTDOWN, PROCESS, SHOW DATABASES, SUPER, LOCK TABLES ON *.* TO 'debian-sys-maint'@'localhost' IDENTIFIED BY 'XXXXXX';
FLUSH PRIVILEGES;

Replace XXXXXX with the password in the /etc/mysql/debian.cnf.

adb device offline

If you happen to find this when you run “adb devices”

D:\adb devices
List of devices attached
0123456789ABCDEF offline

Try this: Look for the file “adbkey.pub” in your computer. It is normally located in %USERPROFILE%\.android. You need to copy this to /data/misc/adb/ as adb_keys. If you have shell access this few lines of code will probably work:

cd %USERPROFILE%\.android
adb push adbkey.pub /data/misc/adb/adb_keys

Oh! And remember to reboot the Android system.

Mail Server – TLS/SSL Ports

For IMAP, there are only two ports to choose from and only 3 total configurations:

Port 993: TLS checked – Direct TLS secure connection
Port 143: TLS checked – StartTLS is used to initiate a secure connection
Port 143: TLS unchecked – Connect insecurely

For POP, it’s the same situation:

Port 995: TLS checked – Direct TLS secure connection
Port 110: TLS checked – StartTLS is used to initiate a secure connection
Port 110: TLS unchecked – Connect insecurely

For SMTP, it’s a little bit more complicated:

Port 465: TLS checked – Direct TLS secure connection
Port 587: TLS checked – StartTLS is used to initiate a secure connection
Port 587: TLS unchecked – Connect insecurely.
Port 25: TLS checked – StartTLS is used to initiate a secure connection (never seen this work)
Port 25: TLS unchecked – Connect insecurely

 

Manipulating Services Runlevels – Debian / Ubuntu

Runlevels:

0: Halt / Shut down. All processes are stopped, all filesystems are unmounted, and all users taken offline. Power can now be safely removed.
1: Single user mode. Only root allowed login. All filesystems listed in /etc/fstab are mounted. Limited set of services started.
2-5: Multi-user mode. All filesystems listed in /etc/fstab mounted, graphical environment (if installed) brought up. Full standard operational mode.
6: Reboot. As with runlevel 0, all processes stopped, all filesystems unmounted, all users taken offline, the box rebooted, and taken to the default runlevel.

Installing system startup links:

update-rc.d <name> defaults

Installing system start and stop links:

update-rc.d [service] start|stop [position] [runlevel] [runlevel] [runlevel] ... [.]

Removing all system start or stop links:

update-rc.d -f <name> remove

Uuencode & Uudecode

The uuencode/uudecode programs encode and decode between ASCII and binary file. Here is an example of how to use it:

uuencode -m mypicture.jpg mypicture.jpg > mypicture.uue

The binary file “mypicture.jpg” is converted to ASCII format and saved in mypicture.uue.

uuencode  mypicture.uue

The ASCII file “mypicture.uue” is decoded back into a binary file called “mypicture.jpg”. Please note that even though “mypicture.jpg” is not specified in the command line, the name was used because of what is specified on the first line of mypicture.uue. The first line of this example looks something like this:

begin-base64 0 mypicture.jpg