This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Lines of code written so far: " | |
( find ./ -name '*.py' -print0 | xargs -0 cat ) | wc -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
outputdir="docs/code" | |
export DJANGO_SETTINGS_MODULE='myproject.settings' | |
epydoc --html --parse-only --name myprojectname --inheritance grouped apps myprojectname scripts -o $outputdir/ | |
cp static/admin/css/base.css $outputdir/epydoc.css |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
find . -name '*.pyc' -delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-startup | |
plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar | |
--launcher.library | |
../../../../../../../home/hseritt/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444 | |
-product | |
org.eclipse.epp.package.java.product | |
--launcher.defaultAction | |
--launcher.GTK_version 2 | |
openFile | |
-showsplash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://stackoverflow.com/questions/9886266/is-there-a-way-to-instantiate-a-class-by-name-in-java | |
Class<?> agent = Class.forName(agentModel.getClassName()); | |
Constructor<?> constructor = agent.getConstructor(AgentModel.class); | |
Object runningAgent = constructor.newInstance(agentModel); | |
Thread agentThread = new Thread((Runnable) runningAgent); | |
agentThread.start(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.IOException; | |
import java.sql.SQLException; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.ConfigurableApplicationContext; | |
@SpringBootApplication | |
public class AlfmonitorApplication { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Root logger option | |
log4j.rootLogger=DEBUG, stdout | |
# Direct log messages to stdout | |
log4j.appender.stdout=org.apache.log4j.ConsoleAppender | |
log4j.appender.stdout.Target=System.out | |
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | |
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n | |
log4j.logger.org.prodigius.jdbobj.Db=debug |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Session session = HibernateUtil.getSessionFactory().openSession(); | |
session.setFlushMode(FlushMode.MANUAL); | |
ManagedSessionContext.bind(session); | |
session.beginTransaction(); | |
Query getAgentsQuery = session.createQuery(" from AgentModel where active=true"); | |
@SuppressWarnings("unchecked") | |
List<AgentModel> agentList = getAgentsQuery.list(); | |
for (AgentModel agentModel : agentList) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.hibernate.SessionFactory; | |
import org.hibernate.cfg.Configuration; | |
public class HibernateUtil { | |
private static final SessionFactory sessionFactory = buildSessionFactory(); | |
private static SessionFactory buildSessionFactory() { | |
try { | |
// Create the SessionFactory from hibernate.cfg.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Security | |
security.basic.enabled=false | |
management.security.enabled=false | |
# Database settings | |
spring.datasource.url=jdbc:mysql://localhost/alfmonitor | |
spring.datasource.username=admin | |
spring.datasource.password=admin | |
spring.datasource.driver-class-name=com.mysql.jdbc.Driver | |
#spring.jpa.hibernate.ddl-auto=update |