Posts

AWS S3 The security of a signed URL as a hyperlink -

is safe? maintaining security using pre-signed url aws s3 bucket object? <a href="https://mywebsite.s3.amazonaws.com/40.pdf?awsaccesskeyid=[my access key]&expires=1433297453&signature=[this random set of numbers]">my link</a> another words - part 1... say i'm storing bunch of separate individual's files in bucket. want provide link file user. obviously, each file uniquely consecutively named, don't want people able change link 40.pdf 30.pdf , different file. url seems that. part 2, , more importantly.... is safe or dangerous method of displaying url in terms of security of bucket? clearly, giving away "access key" here, of course, not "secret". already answered 3 years ago... sorry. how secure amazon aws access keys? aws security credentials used when making api calls aws. consist of 2 components: access key (eg akiaisemtxnog4abpc6q ): similar username. okay people see it. secret key : long s...

mysql startup shell problems -

since met many startup errors,i decide analyze mysql startup shell.while code fragment cannot understand clearly. version: mysql ver 14.14 distrib 5.5.43, osx10.8 (i386) using readline 5.1 368 # 369 # first, try find basedir , ledir (where mysqld is) 370 # 372 if echo '/usr/local/mysql/share' | grep '^/usr/local/mysql' > /dev/null 373 374 relpkgdata= echo '/usr/local/mysql/share' | sed -e 's,^/usr/local/mysql,,' -e 's,^/,,' -e 's,^,./,' 375 else 376 # pkgdatadir not relative prefix 377 relpkgdata='/usr/local/mysql/share' 378 fi what's purpose of line 372? little weird any appreciated. at first glance, strange indeed... here's solution mystery. 372: if echo '/usr/local/mysql/share' | grep '^/usr/local/mysql' > /dev/null 373: grep returns true if matches , false if doesn't, testing whether string /usr/local/mysql/share begins ( ^ ) /usr/local/mysql . o...

java - How do I verify that the ETag is valid if the user does not pass If-None-Match? -

my first time ever hearing of 'etag'. have been able determine system i'm on, system uses etags validate item being submitted has not been altered prior submission of changes. if user has modified item system responds etag invalid. users using rest services had been created project , have not been altered in couple years. i'm working on jira based java application has rest services plugins. now in regards etag, i'm @ loss here. our security scan on system marks header etag risk injection of code. perhaps i'm over-thinking but, is etag created , set code in application or created tomcat server? am take value of etag , compare make sure valid? how validate value etag valid? where validation occur if if-none-match provided request? how protect injection? i've been reading posts on forum things dealing etag i'm not understanding what/how etag step 1 whatever last step is. could use reference how i'm code this. listing resources find: ...

How to copy Excel text and keep line breaks -

i have excel (2013) spreadsheet contains multiline text in of cells. word-wrap enabled cells, appear line breaks correctly. however, cells in question protected (and don't have password), can't click edit box copy there. if use ctrl-c copy clipboard, paste notepad, line breaks removed , double quotes placed around text. how can copy out text , keep line breaks? notepad doesn't interpret line breaks cleverly more fully-featured text editors. best bet try copy/pasting either wordpad, or download notepad++ ( https://notepad-plus-plus.org/download/ ) , paste first. this answer nice job of further explaining issue: https://superuser.com/questions/362087/notepad-ignoring-linebreaks

twitter bootstrap - nav menu not selected correctly -

Image
i created vertical menu nav bar work fine except drop down button. it don't seem able active. active state keep on previous item clicked. i don't use javascript <ul class="nav nav-pills nav-stacked"> <li id="contact" role="presentation" data-toggle="tab" class="active"><a href="#"><span class="glyphicon glyphicon-user"></span> dossier personnel</a></li> <li id="appointment" role="presentation" data-toggle="tab"><a href="#"><span class="glyphicon glyphicon-calendar"></span> rendez-vous</a></li> <li id="room" role="presentation" data-toggle="tab"><a href="#"><span class="glyphicon glyphicon-bed"></span> chambre</a></li> <li id="task" role="presentation" data-to...

javascript - Recursive method for checking an object -

so have created constructor attempting prototype. want method checks through each property in object see if empty , if returns key. if property object want check through sub object well. updated: my code far: function properties(val1, val2, val3, val4){ this.prop1 = val1 || ""; this.prop2 = val2 || ""; this.prop3 = val3 || ""; this.prop4 = val4 || {}; } properties.prototype = { isempty: function(){ (key in this) { if(typeof this[key] == "object" && this[key] !== null){ this[key].isempty(); } else { if(!this[key]){ console.log(key); } } } } } var test = new properties("something", "", "", {subprop1: "something else", subprop2: "", subprop3: {subsubprop1: "", subsubprop2: "" }}); the method should return prop2, pro...

PHP/Javascript/AJAX - Redirect page with a form, and then submit it -

i've been making webpage gathers tweets depending on input on form , i'm having problems using default form submit. i want change how form submit works might take ages page redirect , give user token id, due php script executing. make things simple thought best way make faster redirecting , submitting form. unfortunately don't think can php. someone recommended me give @ ajax, didn't how me. this how form looks like: <form action="testing.php" method="post"> <input type="text" name="search" value="" placeholder="all of these words" autofocus/><br> <input type="text" name="search2" value="" placeholder="this exact word or phrase" /><br> <input type="text" name="search3" value="" placeholder="any of these words" /><br> <input type="text" name="sear...

c# - Display variable in textbox -

in asp.net page have search box working expected. leave searched value in textbox after searching (the search opens new page, though i'm retaining search value querystring). can confirm variable being retained correctly using value <%= search%> in aspx, when try show in textbox nothing displays. have searched dozens of forum posts , nearest can tell need databind textbox. i'm not sure mistake is, closest have come with: <asp:textbox id="searchtextbox" runat="server" text='<%# search %>'></asp:textbox> search: <%=search %> with code behind public string search; protected void page_load(object sender, eventargs e) { search = request.querystring["search"]; searchtextbox.text = search; page.databind(); } you have check if first time see page this if (page.ispostback == false) { } and check first if query string exist.

asp.net mvc 5 - MVC 5 trouble on validating posted form inputs that are html encoded -

Image
i have view model string property: [stringlength(10)] public string phone { get; set; } in view: @html.editorfor(x => x.phone) if enter '+12' , submit, 'phone' html encoded , controller gets , had decode before saving database: httputility.htmldecode(phone); is normal behavior? another problem entering '+123456789' fails string length checks because encoded. how handle this? edit: my controller action looks like: [httppost] [validateantiforgerytoken] public actionresult edit([bind(include = "phone")] myviewmodel vm) edit2: i using custom template default adding sanitizing module modelbinders in application_start() causing trouble. garryp pointed out, framework takes care of once rid of custom binder , controller getting exact string user entered. not encoding/decodings happening on entered string though.. it shouldn't necessary htmldecode value; framework should take care of this. sto...

html - Safe to use // over https:// or http:// -

on our website have secure , unsecure pages. should link images, css etc using full https:// or how safe link using // ? example 1: <link href="https://www.domain.com/style.css" rel="stylesheet" type="text/css" /> example 2: <link href="//www.domain.com/style.css" rel="stylesheet" type="text/css" /> to ensure traffic encrypted, use https safe. can't hurt; can make traffic more secure.

How can I restrict the number of characters entered into an HTML Input with CSS (or jQuery, if necessary)? -

i can manipulate control based on state of control, shown in this jsfiddle , state of checkbox alters width , background color of textbox. the html is: <input type="checkbox" id="ckbxemp" >czech bachs <input type="text" id="txtbxssnoritin"> the jquery is: $(document).on("change", '[id$=ckbxemp]', function () { if ($(this).is(":checked")) { $('[id$=txtbxssnoritin]').css('background-color', '#ffff00'); $('[id$=txtbxssnoritin]').css('width', '24'); } else { $('[id$=txtbxssnoritin]').css('background-color', 'green'); $('[id$=txtbxssnoritin]').css('width', '144'); } }); but besides this, need restrict number of characters user enters textbox, according whether checkbox's state. how can that, preferably css but, if necessary, jquery? jsfiddle fir...

Is it possible to use Resource Template Manager in Azure with cloud services -

it looks list of services can deploy resource template manager azure limited. see examples vm, web sites, storage, sql, not cloud services. does know if can use cloud services (web roles, worker roles)? this has been mentioned on user voice forum resource manager here . it has been updated "planned" feature of june 25th. feel free add votes feature request!

Missing line in "Follow UDP Stream" in wireshark -

Image
i streaming raw udp packets (rf data) gnu radio octave (or other program). data consists of 390625 4 byte floats per second. 1562500 bytes per second. when gnu radio streams udp, there no header or sequence number in udp data, it's raw floats. because localhost localhost, able use large mtu. attached screenshot of wireshark after right clicking , doing "follow udp stream". there "blank" part of hex dump @ 0x6f38c8. don't understand means? (i know udp not provide reliable delivery , packets can dropped , arrive out of order @ moment). great! the blank part used barrier differentiate between 2 udp packets, solely convenience. if track down exact data in normal wireshark window you'll notice data before blank part belongs udp packet , data after blank part belongs subsequent udp packet. the hex numbers on left specify offset of first byte of line beginning of stream in direction (i.e. in half blank line, byte 0x08 has 0x6f38...

python - Flask-Dance and TokenExpiredError -

how code around error: oauthlib.oauth2.rfc6749.errors.tokenexpirederror i spent while trying try/except block no luck on this. errors seems happen when session stale, life of me can't figure out how refresh session. here's code causes that: @main.route('/', methods=['get', 'post']) def index(): if google.authorized: user_profile = json.loads(google.get("/userinfo/v2/me").content) new_user = user.load_by_id(user_profile['id']) if not new_user: user.create(user_profile) else: login_user(new_user) if current_user.is_authenticated: return render_template("index.html", menu=menu) return redirect(url_for('user.signin')) looks issue posted on @ singingwolfboy/flaskdance#35

logging - Stop Log from Outputting in py2neo -

how can stop py2neo spitting out each created relationship/node, following: (http://localhost:7474/db/data/' ref=u'relationship/13441' start=u'node/13446' end=u'node/3' type=u'in' properties={}>,) as encouraged this page , when set below line off java.util.logging.consolehandler.level=off i silence logging when call function creates relationship/node. however, if directly create (graph.create(...) in main, still see print console. if talking running graph.create python console value see return value method, not log entry. note logging setting refer server, not driver.

fpga - Any example useage of a BSCANE2 primitive in Xilinx 7 series? (using the JTAG port to configure user design) -

i've looked on info on bscane2 in http://www.xilinx.com/support/documentation/user_guides/ug470_7series_config.pdf (pg 169 7 series fpga configuration guide) , can't quite figure out how use based on descriptions. i want able use jtag port on kc705 board shift in configuration data our design. think (based on description there in user guide linked above) bscane2 need that... don't understand why of pins of bscane2 component seem have wrong direction (tdo input while of other jtag control sigs tck, reset, tdi outputs). had thought there implicit connection signals of jtag port of fpga instantiated bscane2 component, doesn't appear case based on port directions. suspect i'm missing information somewhere , while have read docs it's still not clear me how use bscane2 i'm trying do. any example usage of bscane2 component appreciated. note: description of bscane2 in user guide linked above says: the bscane2 primitive allows access between internal ...

Syntax for returning multi-dimensional array by reference in C++ -

i've been killing myself trying figure out syntax returning 2 dimensional array reference in c++, i've been getting weird errors. i've searched lot online, couldn't find syntax returning reference specifically. of please me? lot! some soul helped me out, never have guessed this: type (&scope::getarray())[x][y]

angularjs - Make UI Bootstrap accordion heading fully clickable area -

i have ui bootstrap accordion heading want clickable, not title default behavior. <accordion class="fda-accordion panel-group panel-group-square" close-others="oneatatime"> <accordion-group is-open="fdaclass1open" ng-show="fdarecallsclass1count"> <accordion-heading> <div class="panel-heading-blue"> <i class="fa fa-plus fa-fw" ng-class="{'fa-minus': fdaclass1open, 'fa-plus': !fdaclass1open}" style="margin-right:10px"></i> fda class 1 recalls ({{fdarecallsclass1count}}) </div> </accordion-heading> {{fdarecallsclass1content}} </accordion-group> </accordion> is there workaround this? the issue anchor that's handling toggle wrapped around header text rather div . style content of heading negativ...

Rules for counting with parentheses C# -

this question has answer here: c# simple divide problem 9 answers this mabey dumb question try count discount on price this: newallavaror.pris = system.convert.todouble( (1 - (clientkampanj.visakampanj(vara.produktnamn) / 100)) * vara.pris ).tostring(); it in reality (1-(20/100)*7.99), output 7.99 should 6,392..becuse orginal price 7.99... have tried move parentheses 1 then.. in wich order c# go thru parentheses, becuse should work right?? i'm pretty sure doing integer division here: (clientkampanj.visakampanj(vara.produktnamn) / 100) so if have 20/100, result in 0 instead of expected 0.2 reminder truncated. you need convert double, 1 of operands: (clientkampanj.visakampanj(vara.produktnamn) / 100.0) since @scott pointed out other variables of type decimal , need convert 1 of operands type instead: (clientkampanj.visakamp...

r - Installing Statnet -

installing statnet on mac 10.10.3 r 0.99.441. ld: warning: directory not found option '-l/usr/local/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2' ld: library not found -lgfortran clang: error: linker command failed exit code 1 (use -v see invocation) make: *** [latentnet.so] error 1 error: compilation failed package ‘latentnet’ * removing ‘/library/frameworks/r.framework/versions/3.2/resources/library/latentnet’ warning in install.packages : installation of package ‘latentnet’ had non-zero exit status error: dependency ‘latentnet’ not available package ‘statnet’ * removing ‘/library/frameworks/r.framework/versions/3.2/resources/library/statnet’ warning in install.packages : installation of package ‘statnet’ had non-zero exit status i tried updating xcode/command line tools. tried not installing dependencies. have been able install other packages, such ergm , sna. it looks install looking gcc folder , not finding it. whereis gcc reveals gcc in /usr/bin/gcc it looks in...