Posts

Powershell, invoke-webrequest...and Zabbix -

i'm trying use powershell automate creation of reporting tool. need zabbix (v1.8) graph images. not yet possible through api must connect url , graphs. this code : $zabbixloginurl = "http://zabfront-eqx.noc.lan/zabbix/index.php?login=1" $zabbixgraphurl = "http://zabfront-eqx.noc.lan/zabbix/chart2.php?graphid=" $username = "username" $userpwd = "pwd" $loginpostdata = @{name=$username;password=$userpwd;enter="enter"} $login = invoke-webrequest -uri $zabbixloginurl -method post -body $loginpostdata -sessionvariable sessionzabbix #let's see if have cookie set if ($sessionzabbix.cookies.count -eq 0) { write-host "fail connect" break } else {write-host "connected"} #now let's retrieve graph #4433 using priviously established session $graph = invoke-webrequest -uri ($zabbixgraphurl+"4433") -websession $sessionzabbix i can connect , cookie : $sessionzabbix.cookies.getcookies(...

facebook - FQL fetch 3 photos from each album -

is there “elegant way” fetch last 3 photos each album of user? i’ve tried using multiquery, doesn’t work: $fqls = array( "q1" => "select aid album owner = $page_id", "q2" => "select src_small,created photo aid in (select aid #q1) order created desc limit 3" ); with graph api, can [user_id]/albums?fields=photos.limit(3)

angularjs - How to get socket.io.js file from server using sails.js -

i trying make angularjs application, independent node.js server running sailsjs. i use socket.io application , apparently need socket.io.js file server. in client load js file in index.html file using: <script src="http://localhost:1337/socket.io/socket.io.js"></script> however sails not deliver file because of handshake error. is there anyway file server? thanks if don't need node.js server, why don't copy socket.io.js file web server, , fetch there?

mysql - insert in database with column number -

i want insert in table using columns order not name insert tablename(1,2,5) values('val1','val2','val3'); i dont want use insert tablename values('val1','val2','val3'); because table not contain 3 columns how can because columns name encrypted can not rely on insert tablex("ccgsvkjvqxnt8a==","adoloqrpfg==","qsdcx112") values('val1','val2','val3'); is there idea how can deal thank you can't use ordinal number of column in insert statement. however, can accomplish you're trying (insert values specific columns in table) using column names instead. presume table has 5 columns; i'm going call them "alpha", "bravo", "charlie", "delta", , "echo", since haven't given schema table, replace these names names of columns in table. i'm guessing third , fourth column (my "charlie" ,...

ruby - Webrick does not start when starting a Sinatra app -

any idea why webrick refuses start? require 'sinatra/base' require 'slim' class blog < sinatra::base '/' slim :home end end running ruby blog.rb nothing. no error raised. the built in web server isn’t started when using modular style of sinatra apps. see the docs differences between modular , classic styles . to run classic style app, add line bottom of blog class: run! if app_file == $0

c++ - program ignores everything after function is called -

i can't explaing properly.. have code like printf_s("%s", "1"); gldrawelements(gl_triangles, model.indcount, gl_unsigned_int, (void*)0); printf_s("%s", "2"); eglswapbuffers ( escontext->egldisplay, escontext->eglsurface); and 2 never printed .when remove gldrawelements it's ok gldrawelements(gl_triangles, model.indcount, gl_unsigned_int, (void*)0); ^^^^^^^^^^^^^^^ whaaaaat? opengl es' gldrawelements() not accept gl_unsigned_int type , gl_unsigned_byte or gl_unsigned_short . if check glgeterror() after call should gl_invalid_enum .

PHP MySQL search using WHERE IN -

Image
i have following php code finds servers have , tags assigned them. in example bending, economy. script gets server has both displays twice. best way stop this? please note tags stored in seperate table , obtained searching via server id. php code: $query = "select s.id, s.name, s.ip, s.port, ss.id, ss.votes, ss.added, (1.6 * ss.votes + .053) * greatest(1, datediff(now(), ss.added)) score, greatest(1, datediff(now(), ss.added)) days, st.server_id, st.server_tags $tbl_name s left join server_score ss on s.id = ss.id left join server_tags st on s.id = st.server_id st.server_tags in ($sstag)"; results full script http://pastebin.com/5whapesd join subquery combines rows same server id: select ... ... left join (select server_id, group_concat(server_tags) server_tags server_tags server_tags in ($sstag) group server_id) st on s.id = st.server_id alternatively, can use original query, put group_concat(server_tags) in main s...