Posts

logging - Collecting logs from hardware devices and application software using syslog-ng -

i need collect logs devices firewall, printers, routers, switches, proxy-servers, mail-servers, db-server, anti-virus software , other softwares both linux , windows platform. able single open-source tools syslog-ng ? there other similar or different open-source logging tool can serve purpose single-handedly? mostly depends on other devices. if can send logs in standard syslog (rfc3164 or rfc5454), syslog-ng can receive them. depending on devices, can install syslog-ng client , collect logs files if needed. for windows, need other tool can collect logs windows eventlog , forward syslog logserver syslog-ng can receive them. there both free , commercial tools can (for example, commercial version of syslog-ng).

objective c - Can I get video clip/edit function as iOS Photos app? -

like picture uploaded, have app want use same function photos app provided. it should have these: edit saved video, resize area,such cut top half of it's view. drag resize new time interval video, such 30 second video ,clip 16 second. thanks lot! screen shot just try this if uiimagepickercontroller.issourcetypeavailable(uiimagepickercontrollersourcetype.photolibrary) { let imagepicker = uiimagepickercontroller() imagepicker.delegate = self imagepicker.sourcetype = .photolibrary imagepicker.mediatypes = [kuttypemovie string] imagepicker.videomaximumduration = 300 imagepicker.videoquality = .type640x480 imagepicker.allowsediting = true presentviewcontroller(imagepicker, animated: true, completion: nil) }

python - adding spaces inside string using regex sub -

i have string want split 2-digit pieces. tried using regex so: import re s = "123456789" t = re.sub('..', ".. ", s) print(t) i expected 12 34 56 78 9 instead got '.. .. .. .. 9' . 9 not bother me, because know have number of digits, how can tell re.sub not replace actual digit dot? using python shell 3.5.1 edit checked 3 answers, , work, findall seems faster (and more elegant imo ;p ): import time import re s = "43256711233214432" = 10000 start = time.time() while i: -= 1 re.sub('(..)', r"\1 ", s) end = time.time() elapsed = end - start print("using r\"\\1 \" : ", elapsed) = 10000 start = time.time() while i: re.sub('..', r"\g<0> ", s) -= 1 end = time.time() elapsed = end - start print("using r\"\g<0> \" : ", elapsed) = 10000 start = time.time() while i: ' '.join(re.findall(r'..|.', s)) ...

PHP Mysql - create previous and next link from current customer -

i have page listing customers: /customers/ the order of customers on page not sequential: 1st: id 111 2nd: id 567 3rd: id 345 etc that's because sql query lets user select customer order based on first name, last name, or nickname. "select customer_id customers status = 1 order " . $customer_order so when on 2nd customer in example above: /customer/567/ so problem want display previous , next button this, can't figure out how: <a href="111">prev</a> <a href="567">current</a> <a href="345">next</a> i managed previous link working in while loop it's ugly. tried using current(), prev(), , next() failed. most solutions i've seen on stackoverflow sequential ids either -1 or 1 current id, or "limit 1" in query i'm sure doesn't work in situation after testing this. any ideas? you can assign row number query , use row number identify previous , next...

Start Java Class from embedded library inside Spring Boot executable jar -

is possible start different java class (with main method) in spring boot executable jar declared mainclass ? speciality : class should started located in library embedded in executable jar (inside lib folder). background information: the executable jar contains library class call gracefully shutdown application. library embedded inside executable jars lib folder , not accessible default java classpath parameter. see reply: https://stackoverflow.com/a/2023544/1499549 . need specify class after defining jar file on classpath. java -cp myapp.jar com.example.main1

jquery - PHP get real time date without page reload -

i have code gets server date , time in php works well. need work time rather on page load... code below: <?php if(date('w') !== 0) { if((current_time('hi')<1800 && current_time('hi')>=1400) || (current_time('hi')<1300 && current_time('hi')>=700)) { echo 'we open'; } else { echo 'we closed'; } } else if(intval(current_time('hi'))<1230 && current_time('hi')>=700) { echo 'we open'; } else { echo 'we closed'; } ?> <p>we close @ <strong> <?php if (date('l') != "sunday") { echo '18:00'; } else if (date('l') == "sunday") { echo '12:30'; } ?> </strong> today</p> is possible make work poll server / work after page loads - example, if on monday page loaded @ 17:58 , user views page 3 minutes, code should change sign showing open closed wi...

How do I convert this query into LINQ? -

select * procedurelookup proclookup inner join (select patientprocedures.pp_procedureid, count(*) proccount (patientprocedures inner join treatments on patientprocedures.pp_treatmentid = treatments.ts_treatmentid) year(treatments.ts_date) = year(getdate()) group patientprocedures.pp_procedureid) cyearproc on proclookup.pl_procedureid = cyearproc.pp_procedureid order proccount desc; here procedurelookup , treatments , patientprocedures tables. here linq query. var result = (from proclookup in db.procedurelookup join cyearproc in ( p in db.patientprocedures join t in db.treatments on p.pp_treatmentid equals t.ts_treatmentid t.ts_date.year == datetime.now.year group p p.pp_procedurei...