How to roll the log file on startup in logback

None of the other suggestions was appropriate for my situation. I didn’t want to use a size-and-time-based solution, because it requires configuring a MaxFileSize, and we are using a strictly time-based policy. Here is how I accomplished rolling the file on startup with a TimeBasedRollingPolicy: @NoAutoStart public class StartupTimeBasedTriggeringPolicy<E> extends DefaultTimeBasedFileNamingAndTriggeringPolicy<E> { @Override public void … Read more

What handles dynamics:// URLs?

Of course, I figure out my own answer every time I type up a stackoverflow question, but I think the information is really useful. This stack question led me to find out that C:\Program Files (x86)\Microsoft Dynamics AX\50\Client\Bin\AxHLink.exe %1 handles Dynamics:// URLs. Which led me to Microsoft’s community forums where somebody else was facing a … Read more

Auto-Loading a module on IPython startup

i’ve found a solution to this one, in your IPython profile directory (by default – .ipython\profile_default), edit the file ipython_config.py (create it with ipython profile create if it does not exist) with the following lines: # loads the root config object c=get_config() # executes the line in brackets on program launch c.InteractiveShellApp.exec_lines = [‘from __future__ … Read more

Running Batch File in background when windows boots up

Add your program in the registry: Run – These are the most common startup locations for programs to install auto start from. By default these keys are not executed in Safe mode. If you prefix the value of these keys with an asterisk, *, is will run in Safe Mode. Registry Keys: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run registry key … Read more

App.xaml file does not get parsed if my app does not set a StartupUri?

Rather than overriding OnStartup, try using an event instead: <Application x:Class=”My.App” xmlns=”…” Startup=”Application_Startup” ShutdownMode=”OnExplicitShutdown”> <Application.Resources> <app:ServiceLocator x:Key=”serviceLocator” /> </Application.Resources> </Application> Code behind: public partial class App : Application { public App() { } private void Application_Startup(object sender, StartupEventArgs e) { // TODO: Parse commandline arguments and other startup work new MainWindow().Show(); } }

How to auto-load MySQL on startup on OS X Yosemite / El Capitan

This is what fixed it: First, create a new file: /Library/LaunchDaemons/com.mysql.mysql.plist <?xml version=”1.0″ encoding=”UTF-8″?> <plist version=”1.0″> <dict> <key>KeepAlive</key> <true /> <key>Label</key> <string>com.mysql.mysqld</string> <key>ProgramArguments</key> <array> <string>/usr/local/mysql/bin/mysqld_safe</string> <string>–user=mysql</string> </array> </dict> </plist> Then update permissions and add it to launchctl: sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.plist sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

How to auto execute a macro when opening a Powerpoint presentation?

While Auto_Open doesn’t run in a PowerPoint presentation, you can fake it. Add a CustomUI part to the presentation, then use the CustomUI OnLoad callback to run code when the presentation opens. The CustomUI part needs no more than just the CustomUI tags. Get the Custom UI Editor from here: http://openxmldeveloper.org/articles/customuieditor.aspx Open the presentation in … Read more

Java EE Enterprise Application: perform some action on deploy/startup [duplicate]

Configure SerlvetContextListener and override contextInitilized() in your web application description , web.xml <web-app …> <listener> <listener-class>com.someCompany.AppNameServletContextListener</listener-class> </listener> </web-app package com.someCompany; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; public class AppNameServletContextListener implements ServletContextListener{ @Override public void contextDestroyed(ServletContextEvent arg0) { System.out.println(“ServletContextListener destroyed”); } @Override public void contextInitialized(ServletContextEvent arg0) { System.out.println(“ServletContextListener started”); // do the things here } }

How to log all active properties of a spring boot application before the beans instantiation?

For doing this you need to register an ApplicationListener. The event to catch is the ApplicationPreparedEvent, according to the documentation: ApplicationPreparedEvent is an event published when a SpringApplication is starting up and the ApplicationContext is fully prepared but not refreshed. The bean definitions will be loaded and the Environment is ready for use at this … Read more

Script running in PyCharm but not from the command line

There are a few possible things that can be causing this: The same python interpreter? Check with import sys; print(sys.executable) Is it the same working directory? Check with import os; print(os.getcwd()) Discrepancies in sys.path, which is the list python searches sequentially for import locations, can possibly caused by environment variables. Check with import sys; print(sys.path).