android:configChanges=”orientation” does not work with fragments

Based on my experience with Honeycomb 3.0 and compatibility library (r1). configChange=”orientation” does work with fragments with respect to preventing the activity (to which it is applied) being re-created on an orientation change. If you want the fragment not to be re-created on activity re-creation then call setRetainInstance in onCreate. Unless I’m missing something I … Read more

How to restart remote MySQL server running on Ubuntu linux?

SSH into the machine. Using the proper credentials and ip address, ssh root@128.0.0.1. This should provide you with shell access to the Ubuntu server. Restart the mySQL service. sudo service mysql restart should do the job. If your mySQL service is named something else like mysqld you may have to change the command accordingly or … Read more

Do you have to restart apache to make re-write rules in the .htaccess take effect?

A restart is not required for changes to .htaccess. Something else is wrong. Make sure your .htaccess includes the statement RewriteEngine on which is required even if it’s also present in httpd.conf. Also check that .htaccess is readable by the httpd process. Check the error_log – it will tell you of any errors in .htaccess … Read more

How can I configure a systemd service to restart periodically?

For systemd version >= 229, there is an option called RuntimeMaxSec, which terminates the service after it has been running for the given period of time. e.g. To restart every 7 days: [Service] Restart=always RuntimeMaxSec=7d To me this seems more elegant than abusing Type=notify and WatchdogSec. systemd provides a clean way to add and override … Read more

How can I restart a Java application?

Of course it is possible to restart a Java application. The following method shows a way to restart a Java application: public void restartApplication() { final String javaBin = System.getProperty(“java.home”) + File.separator + “bin” + File.separator + “java”; final File currentJar = new File(MyClassInTheJar.class.getProtectionDomain().getCodeSource().getLocation().toURI()); /* is it a jar file? */ if(!currentJar.getName().endsWith(“.jar”)) return; /* Build … Read more

How do I shutdown, restart, or log off Windows via a bat file?

The most common ways to use the shutdown command are: shutdown -s — Shuts down. shutdown -r — Restarts. shutdown -l — Logs off. shutdown -h — Hibernates. Note: There is a common pitfall wherein users think -h means “help” (which it does for every other command-line program… except shutdown.exe, where it means “hibernate”). They … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)