Enable or Disable Built-in Elevated Administrator Account in Windows 10
net user administrator /active:yes
References :
http://www.tenforums.com/tutorials/2969-administrator-account-enable-disable-windows-10-a.html
net user administrator /active:yes
References :
http://www.tenforums.com/tutorials/2969-administrator-account-enable-disable-windows-10-a.html
import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HelloWorld { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(HelloWorld.class); logger.info("Hello World"); } }
References :
http://www.slf4j.org/manual.html
Seconds diff = Seconds.secondsBetween(start, end);
Or
Period diff = new Period(start, end);
References :
http://stackoverflow.com/questions/15814911/how-to-subtract-two-joda-datetimes
isAfter and isBefore methods compare dates by millis (ignoring time zone).
System.out.println(londonDT.getMillis() == estDT.getMillis());
will print true.
londonDT.isBefore(estDT) londonDT.isAfter(estDT)
are equal to
londonDT.getMillis() < estDT.getMillis() londonDT.getMillis() > estDT.getMillis()
References :
http://stackoverflow.com/questions/17172782/comparing-two-joda-time-datetime-objects
There are two ways to pass an object that can be retrieved when a Quartz job executes:
Pass the instance in the data map. When you set the job up, add your instance to the map with a key like this:
// Create job etc... var MyClass _myInstance; statusJob.JobDataMap.Put("myKey", _myInstance); // Schedule job...
Retrieve the instance in the job’s Execute() method like this:
public void Execute(IJobExecutionContext context) { var dataMap = context.MergedJobDataMap; var myInstance = (MyClass)dataMap["myKey"]; }
OR
Add the instance to the scheduler context when you set the job up, like this:
ISchedulerFactory schedFact = new StdSchedulerFactory(); _sched = schedFact.GetScheduler(); _sched.Start(); // Create job etc... var MyClass _myInstance; _sched.Context.Put("myKey", myInstance); // Schedule job...
Retrieve the instance in the job’s Execute() method like this:
public void Execute(IJobExecutionContext context) { var schedulerContext = context.Scheduler.Context; var myInstance = (MyClass)schedulerContext.Get("myKey"); }
References :
http://stackoverflow.com/questions/7137960/quartz-scheduler-how-to-pass-custom-objects-as-jobparameter
DateTime dateTime=new DateTime(); dateTime =dateTime.plusMinutes(1); JobDetail job= JobBuilder.newJob(Task1.class).withIdentity("job1","group1").build(); System.out.println(job.getKey().toString()); SimpleTrigger trigger= (SimpleTrigger) TriggerBuilder.newTrigger() .withIdentity("trigger1","group1") .startAt(dateTime.toDate()) .build(); System.out.println(String.format("Start : %s",new DateTime().toString())); Scheduler scheduler = new StdSchedulerFactory().getScheduler(); scheduler.start(); scheduler.scheduleJob(job, trigger); System.out.println(scheduler.checkExists(new JobKey("job1","group1")));
References :
http://stackoverflow.com/questions/26523285/checking-if-the-job-exists-without-looping-through-all-the-jobs
package com.mkyong.quartz; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SimpleScheduleBuilder; import org.quartz.Trigger; import org.quartz.TriggerBuilder; import org.quartz.impl.StdSchedulerFactory; public class SimpleTriggerExample { public static void main(String[] args) throws Exception { // Quartz 1.6.3 // JobDetail job = new JobDetail(); // job.setName("dummyJobName"); // job.setJobClass(HelloJob.class); JobDetail job = JobBuilder.newJob(HelloJob.class) .withIdentity("dummyJobName", "group1").build(); //Quartz 1.6.3 // SimpleTrigger trigger = new SimpleTrigger(); // trigger.setStartTime(new Date(System.currentTimeMillis() + 1000)); // trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY); // trigger.setRepeatInterval(30000); // Trigger the job to run on the next round minute Trigger trigger = TriggerBuilder .newTrigger() .withIdentity("dummyTriggerName", "group1") .withSchedule( SimpleScheduleBuilder.simpleSchedule() .withIntervalInSeconds(5).repeatForever()) .build(); // schedule it Scheduler scheduler = new StdSchedulerFactory().getScheduler(); scheduler.start(); scheduler.scheduleJob(job, trigger); } }
References :
http://www.mkyong.com/java/quartz-2-scheduler-tutorial/
apt-get install libgcrypt11-dev zlib1g-dev
Edit the sshd config:
vi /etc/ssh/sshd_config
Find the line:
#Compression delayed
Change it to
Compression yes
Reboot the server. (Restarting sshd is not enough)
References :
https://www.namhuy.net/2430/install-enable-zlib-linux-server.html
http://snippets.khromov.se/enable-zlib-compression-in-sshd-on-centos/
// conversion from jalali to gregorian by constructed input PersianCalendar jalali = PersianCalendar.of(1394, 11, 5); // or use a safe enum instead of the month number: // PersianCalendar jalali = PersianCalendar.of(1394, PersianMonth.BAHMAN, 5); PlainDate gregorian = jalali.transform(PlainDate.class); System.out.println(gregorian); // 2016-01-25; PersianCalendar persianCalendar= plainDate2.transform(PersianCalendar.class);
References :
http://stackoverflow.com/questions/23385434/a-good-date-converter-for-jalali-calendar-in-java