Labels

Friday, February 15, 2019

Incorrect datetime value: '0000-00-00 00:00:00' datetime

When attempting to upgrade a server's MySQL that was several version behind I ran into an error on one of the PHP pages doing an insert into a table "Incorrect datetime value: '0000-00-00 00:00:00' datetime".  When I looked at the table I saw that the column in question was set to NOT NULL and had a default value of '0000-00-00 00:00:00'.  After some googling I discovered that this came down to a setting that was set by default on newer version of MySQL called sql-mode.  In order to fix this I ran the following command in MySQL:

show variables like 'sql_mode';

This showed the following:

sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

The problem is two of those in the middle, specifically, NO_ZERO_IN_DATE and NO_ZERO_DATE.  I'm not sure what the others do but in deference to the builders of MySQL that put them in there by default I decided to leave the rest in there but remove those two.  In order to do that I changed the my.cnf file (on my system /etc/mysql/my.cnf) and added the following line after the [mysqld] header:

sql-mode="STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

After restarting the mysql server (sudo service mysql restart) when I ran the "show variables" query in MySQL it showed the proper values (i.e. missing the two problematic ones).  For the record, the MySQL version is 5.7.25 and I started at 5.5.62.

Friday, November 16, 2018

Elementary OS - Juno - Long away suspend

I recently installed Elementary OS Juno (my preferred flavor of linux because of it's simplicity, good looks, and ease of use) but was having a problem that when I left the computer for too long it would freeze up when I unlocked it.  Certain windows would respond to mouse input but the top bar does not respond and neither did any system keyboard shortcuts such as Super+Space to open the applications menu.  Chrome would also not respond although Firefox would which is strange.  I noticed that the HDDs were spinning up after a long time away which I take as an indication that is has gone into some sort of sleep mode even though I used any and all system settings to ensure that the computer never sleeps or hibernates.  After some googling I found this as a possible solution:

Edit /etc/defaults/grub:

GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1"

Then run:
update-grub
shutdown -r now


The jury is still out on whether or not this is working 100% of the time as I don't often leave my laptop idle for long periods of time but so far I have not noticed the freezing issue.

Wednesday, February 3, 2016

Sonicwall NetExtender on Ubuntu

One of the main problems with using the linux version of NetExtender on Ubuntu is that is messes with the resolvconf and does not restore it properly when it is done. Below are the commands I run to fix my resolvconf after closing NetExtender.

sudo rm resolv.conf 
sudo ln -s /run/resolvconf/resolv.conf resolv.conf 
sudo resolvconf -u

Friday, August 15, 2014

Ubuntu log-in screen


Here is what /etc/lightdm/lightdm.conf looks like to remove the list of users, require users to type in their usernames to log-in, and not allow guest or remote log-ins to Ubuntu.

UPDATE: On Ubuntu 13.10 the lightdm.conf file might need to be created.
UPDATE: On Ubuntu 14.04 the lightdm.conf file might need to be created.

[SeatDefaults]
allow-guest=false
greeter-show-manual-login=true
greeter-hide-users=true
show-remote-login=false

Friday, April 25, 2014

PowerBroker Identity Services (formerly Likewise Open) on Ubuntu server

*Likewise Open is no longer available.  It has been taken over by BeyondTrust and is called PowerBroker® Identity Services, Open Edition
Here are the steps I took to get PowerBroker Identity Services, Open Edition onto Ubuntu Server.
Versions:
  • Ubuntu Server 14.04 64-bit
  • PBIS Open 8.0.0.2016 - Stable Release
  1. Log-in to server with sudo privileges
  2. Be sure ssh server is installed
  3. Download PowerBroker® Identity Services, Open Edition 
  4. Make script executable
      $chmod +x pbis-open-8.0.0.2016.linux.x86_64.deb.sh
  5. Execute install script and follow istructions 
      $sudo ./pbis-open-8.0.0.2016.linux.x86_64.deb.sh
  6. Join the domain
      $sudo domainjoin-cli join <domain name> <domain admin user>
  7. Change default shell for domain users to bash
      $sudo /opt/pbis/bin/config LoginShellTemplate /bin/bash
  8. If you would like, set the domain as default (not require <domain>\ to precede username for domain logins)
      $sudo /opt/pbis/bin/config AssumeDefaultDomain true
  9. Add domain users to necessary groups in /etc/group (sudo for the admin users)
  10. Clear cache
      $sudo /opt/pbis/bin/ad-cache --delete-all
  11. Apply fix: Edit /etc/pam.d/common-session and change "session sufficient" line to
      session [success=ok default=ignore] pam_lsass.so
  12. Reboot and login with domain user

Tuesday, February 25, 2014

Audio virus (Trojan.Zekos.Patchedww2)

A user experienced a problem where their laptop would play audio ads when started.

OS: Windows Vista

After trying all the usual tools the audio ads continued to play.  Running Malwarebytes Anti-Rootkit BETA v1.07.0.1009 found a virus (Trojan.Zekos.Patchedwv2) in C:\Windows\System32\rpcss.dll.


Other symptoms:
  • DCOM Launcher and PlugPlay services have high CPU utilization
  • Vista restarts with message "Windows must now restart because the DCOM Server Process Launcher service terminated unexpectedly".  This message does not allow you to prevent the machine from rebooting, the only option is "Close"
Other steps tried (unsucessfully):
  • Malwarebytes (regular version)
  • Every pertinent tool on Hiren Rescue CD
  • Panda Antivirus scan
  • Kapersky TDSSKiller
  • RKill

Tuesday, January 14, 2014

Glassfish deployment issue: "Could not load any resource bundle by...."

While attempting to redeploy a web project to Glassfish the following error occurred:
"Could not load any resource bundle by com.sun.org.apache.xerces.internal.impl.msg.XMLSchemaMessages"
When trying to restart the Glassfish domain it ran into errors and would not start.  After some troubleshooting the problem turned out to be with the Glassfish server not Glassfish or the project.  It turns out that a teammate ran into some problems while running updates on the Ubuntu server that was hosting Glassfish and that caused java to be temporarily uninstalled (which would obviously cause problems for the java application server).  After re-running the updates, rebooting, then re-running updates again (not sure if all of these steps were necessary) the  Glassfish domain was able to start and deployment of the project worked with no errors.