w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
SSH tunnel through a web browser
Do you know socket.io? Maybe it's useful for what you want to do. You will need a server with nodejs witch can listen for client events and open a ssh or anything else. http://socket.io/#how-to-use

Categories : Javascript

HTML code to open putty client from browser
I've done it following the info of this blog post. For future reference in case the original page becomes missing, here is the process: you cannot directly map the ssh:// scheme to PuTTY, but you can map it to an intermediary script which will in turn lanch PuTTY with the right arguments. Mine is called putty_ssh.bat and has the following content: @echo off set var=%1 set extract=%var:~6,-1% "C:Program Files (x86)PuTTYputty.exe" %extract% the script has to be registered in the registry. You can just create a ssh.reg file with the following content and open it (customizing last line as needed): REGEDIT4 [HKEY_CLASSES_ROOTssh] @="URL:ssh Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOTsshshell] [HKEY_CLASSES_ROOTsshshellopen] [HKEY_CLASSES_ROOTsshshellopencommand] @=""C:\path\to\putty

Categories : HTML

Mobile Browser Compatibility: Site dont pinch in iOS browser
Try adding user-scalable=yes to your viewport meta tag <meta name="viewport" id="view" content="width=device-width minimum-scale=1, maximum-scale=1" /> to give you <meta name="viewport" id="view" content="width=device-width minimum-scale=1, maximum-scale=1", , user-scalable=no /> And I would move your Meta tage up near the top with the rest.

Categories : HTML

Secure folder structure for php site
There is no defined structure for PHP projects. Application frameworks invariably use well-defined structures, but that is decided individually by each framework. In addition, the developer can easily work outside these structures (the price being that "automatic" features of the framework might no longer work in some cases). In order to prevent access to directories in your site you have to do one of the things you mentioned: either use web-server-level mechanisms such as .htaccess or move the directories outside the web root entirely. That said, in many cases there is no explicit need for such security: by strictly limiting the pieces of code that can produce immediate effects (typically down to just one front controller that boots up the application) and making sure that data is conta

Categories : PHP

Most secure way to update database on a site using mod_rewrite
GET vs. POST doesn't matter here, neither protects anything more than the other GET vs. POST is only semantical and has certain different behavioral specifications for clients, it's not a security measure mod_rewrite works just fine with POST requests all mod_rewrite does it to intercept and modify which physical file gets executed in response to a URL, nothing more, nothing less What you want is an authentication and permission system. Require users to be logged in. Establish permissions on what a user can and cannot do or access. Check for every single request whether the user is allowed what he's about to do. If he POSTs to update.php?username=foobar, check whether he is allowed to change anything about username foobar and deny the request is he isn't.

Categories : PHP

How to develop secure Dropbox browser client?
Caveat: I'm not a security expert. Using the encoder might discourage a casual "attacker" from picking up your app key and secret, but it doesn't provide any true security. Here's a line of code using the JS library that converts an encoded key back into the unencoded key/secret pair: Dropbox.Util.atob(Dropbox.Util.encodeKey(encodedSecret).split('|')[1]).split('?') That said, the security risk here is that someone else uses your app key and secret, which is arguably not the end of the world. Pretty much all client apps that use OAuth (in the browser, on the desktop, and on mobile platforms) suffer from this problem. For example, here's one article discussing Twitter's leaked consumer key/secret: https://news.ycombinator.com/item?id=5337099. I think the most likely consequence of exposi

Categories : Javascript

Is it more secure to allow the browser to save a website password or prohibit it?
Spoof websites are more easily detected because the username and password don't show up (this may be a mute point if the username is saved but not the password). Is this true for sites that have been dns hijacked? Keyloggers won't pick up the password if you don't type it. If a computer is vulnerable enough to be keylogged, it can simply upload the password containing file. People will be less likely to keep the password in an obvious place People will do stupid things regardless of what steps you take to prevent it. The most secure method is preventing saving the password. However annoying it may be to retype it every time.

Categories : Security

How does this site play a .MP3 in-browser on iOS without it exiting the browser to play the file iOS's native quicktime player?
It's done via Javascript. I don't know a lot about the implementation details as I'm not very familiar with JS, but if you inspect the source of the site you linked to, you'll find a file titled MediaPlayer.js. Within this you'll find all the source for the player, the important part of which is the call to play(); You can find more info here: Play a sound via javascript event in iOS 5 HTML5 app

Categories : IOS

How secure are javascript browser-based games from third party hackers
If you consider your user's addresses to truly be a secret, then yes you probably have some work to do: XSS attacks You need to be very careful about how you display user input. For example, if I say my name is <script>alert('hello world')</script>, are you actually going to print that out in the website? If so, can then insert their own JavaScript into your application. Here's an example of an XSS attack, and Wikipedia has more information. If attackers can insert custom JS, they can intercept secret user input like addresses or passwords or cookies. HTTPS When your web server sends its message back to the user, the message doesn't go directly to the user's computer. It first goes through intermediate computers in a relay race. If attackers control one of the computers in

Categories : Javascript

Is it secure to blindly trust image urls and output them into html img tags on a site? Can it be used to inject code?
Image URLs can of course point to scripts (with some URL rewriting) but there's no risk to get a script run from an image load. URL data is treated as binary image data, not as runnable text/script. If it's a script, for your browser it's nothing more than a corrupted image file. So, no code injections risk. At least this is what I know.

Categories : HTML

Why does my site look different on Firefox vs every other browser
You're missing box-sizing: border-box; for the other browsers - you only have the -moz prefix defined for the below selectors: a.med-block, a.small-block, a.big-block { -moz-box-sizing: border-box; box-sizing: border-box; color: #FFFFFF; display: block; float:left; overflow:hidden; text-decoration: none; transition: background-color 250ms ease-out 0s; }

Categories : CSS

how to find particular site is already open or not in the browser?
There is no way to run any client side code in an HTML formatted email. So this is impossible. The closest you could come would be to: use some kind of token to identify a user (e.g. stored in a cookie) run some heart beat code to see if they are still on the page (e.g. use XMLHttpRequest to request a 1 byte file every 15 seconds using a page id generated when the page was loaded and the user id in the cookie) check on the server to see if a heart beat from a different page was received recently when a new copy of the page is loaded serve different content if it is

Categories : Javascript

jQuery conundrum - site works in every browser but ie8
i think the issue is that you need to do more of an a, img { border:none; } see: How to remove borders around links in IE?

Categories : Jquery

CSS/HTML & Browser Problems with Weebly-Exported Site
The td item in the table: .wsite-multicol-col needs to be set to vertical-align:top. To be vertically aligned to the top of the table. In the old days, way back when...you could do <td valign="top">, in the markup - but that's no longer valid, and we can control the styling purely through the .css file.

Categories : HTML

Converting site to html5 and cross browser compatibility
The earlier versions won't recognise any of the new elements should you use them (which of course you don't have to). But you can make these versions of IE recognise these elements by simply adding the html5shiv script. As for the first question, if you want to use HTML5 then go ahead and perhaps make it IE compatible as you go along.

Categories : HTML

Site menu not displaying some content in safari browser
Apply - html,body{ margin:0px; padding:0px; } Web browsers have different default settings for the base margins and padding. You need to set this to make sure your browsers are all set to equal levels for margin/padding.

Categories : Javascript

Bootstrap Responsive Site in Browser, not Adapting in iPhone
You almost certainly forgot the <meta name="viewport"> tag the Bootstrap docs mention. In your <head>: <meta name="viewport" content="width=device-width, initial-scale=1.0"> edit: Now that you've provided the URL, check out the syntax highlighting on this line: <meta name="viewport' content="width-device-width, initial-scale=1.0"/> You've opened with a double quote and closed with a single quote.

Categories : Iphone

APK download failure if behind password protected site on stock browser
This looks to be a (~6-year old!!) bug in Android: https://code.google.com/p/android/issues/detail?id=1353 Apparently all we can do is star the issue. There are other hacky workarounds posted around the internet that you can find on your own, but I wouldn't recommend most of them as a general solution. Perhaps try changing the filename extension to be in all caps, as suggested here: http://www.digiblog.de/2011/04/android-and-the-download-file-headers/ So the line becomes: Content-Disposition: attachment; filename="SironaVideoSurvey.APK" If that doesn't work, I would just recommend that you tell your clients to use a different, non-stock (and non-Chrome!) browser. :/ Good luck.

Categories : Android

Scrap data from site with browser-based Template Engine
A colleague of mine has a PhantomJS-based project doing just that: https://github.com/vmeurisse/phantomCrawl. He has a simple example that looks a lot like your snippet: 'use strict'; var PhantomCrawl = require('./src/PhantomCrawl'); var urls = []; urls.push('http://www.bing.com'); var ptc = new PhantomCrawl({ urls: urls, nbThreads: 4, crawlerPerThread: 4, maxDepth: 1 }); urls is the list of urls to crawl. nbThreads is the number of instances of PhantomJS launched. crawlerPerThread is the number of pages crawled in parallel per instance of PhantomJS. maxDepth is the number of times the currently crawled page follows links present in the page.

Categories : Node Js

How to get site to automatically scale based on user's browser window
What you are looking for is a responsive background image....its not that easy unfortunately but checkout Responsive background image in div full width Responsive css background images

Categories : HTML

The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption
Is it databaseName=MyDB or database=MyDB ? Try the latter. Are you on a Windows Machine? http://www.microsoft.com/en-us/download/details.aspx?id=24009 Download that and try to talk to your server outside of your code. The port query tool will show you if its a firewall (or similar) issue, outside of the code.

Categories : Java

Secure API access: best strategy to secure readonly rails api for android client
The most secure method for APIs is to give each user a different authentication token for API. On the other hand, if you want to make it even more secure, I personally suggest you a SSL, because SSL encrypts the packages between server and client, therefore it will be impossible (not impossible but near impossible depending on your SSL certificate) to hijack the communications between server and client.

Categories : Android

Cross domain session sharing does not work until site visited in browser
I believe I have found what is causing this issue. Because both domains are served by separate instance they have unique PHP environments running. My code is currently using the native PHP session - so when the cookie is sent to the second server it gets the ID to which no data is allocated. It's only by visiting the site manually that triggers the allocation of data as it automatically runs through the authentication and authorisation procedure. I am going to switch to using database session in Kohana. Both instances point to the same DB so this should resolve the issue. I'll post back here to confirm.

Categories : PHP

Does Azure Point-to-Site or Site-to-Site VPN support cloud services?
I haven't tried personally, but you should be able to do just that by joining your cloud service to a virtual network. See this article for details on how to do this: http://convective.wordpress.com/2012/08/26/windows-azure-cloud-services-and-virtual-networks/.

Categories : Azure

Acessing array from a function C++
If you want your dungeon to persist after the player saves and closes the program, you'll have to take your map data, player state, and everything and save it to a file. And then load it from the file rather than generating it randomly at startup. If you want your dungeon to persist, say, between floors that the player can travel up and down, it's still a valid idea to save the individual floors off to file and load them as needed. A side bonus that Nethack uses is that if the whole thing crashes, it can attempt to reconstruct the save from the last time you moved between floors. Alternatively, you can simply have your dungeon consist of an ever growing vector, or a 3D array, complete with x,y, and z coordinates. It's not so much a question about pointers as much as how to store data

Categories : Arrays

Acessing control in one window from another in WPF
You did not call .Show() on the MainWindow form variable named main. Also wondering why there is no Handles clause on your button's click event? Did you Addhandler that? Public Class Quicksites Dim main As New MainWindow Private Sub Button_Click(sender As Object, e As RoutedEventArgs) Handles Button.Click main.Show() main.WebBrowser1.Navigate("http://www.google.com") End Sub

Categories : Wpf

dynamic ngmodel value in ngrepeat and acessing it
i think your binding is somehow messed up. Something like this should do it. Watch the console for the received objects and you can start doing stuff with them. http://plnkr.co/edit/ugtbO2 html <div ng-repeat="a in articles" ng-model="article"> <div class="description">{{a.description}} (id: {{a.id}})</div> <div class="commentbox"> <textarea placeholder="Share your View" ng-model="a.review"></textarea> <div class="post"> <button ng-click="addComment(a)" > Submit </button> </div> </div> </div> js $scope.articles = [ {id: '1',description: 'sdfsdf', review:''}, {id: '2',description: 'asa334', review:''}, {id: '3',description: 'dfsdfw3r', revi

Categories : Angularjs

Acessing "a" element of an array using jquery
var al_normal = $("#tables a").get(0); or var al_normal = $("#tables a")[0]; Both return the DOM object. If you need to access it as a jQuery object, use: var al_normal = $("#tables a").eq(0); Further info: http://api.jquery.com/eq/

Categories : Jquery

SSH tunnel and Python 3.3
I am dealing with similar problems at the moment (trying to use Docker's remote API which at the moment doesn't offer authentication). I am currently using bgtunnel, though I'm getting some errors now and then (usually resolved by a webpage refresh) - at first glance due to trying to establish a connection when one already exists. This can probably be solved using some thread.isAlive() stuff, but all in all it is kind of messy managing the connection - is it already alive? Should I check before any request or try and establish it and redo the API call on an exception. It's a bit tricky. I'm also starting to explore Paramiko, hoping it might be a bit easier to handle from Python - the process of porting to Python 3 seems is almost finished at the moment. That said, I'd expect any decent da

Categories : Python

Connect azure web site to on-premise database over site-to-site vpn
Azure Web Sites do not support the Azure Virtual Network (as of 8/22/2013); http://www.windowsazure.com/en-us/manage/services/web-sites/choose-web-app-service/ You will need to create a cloud service deployment instead if you would like to use Virtual Network and access the on-premises database. Once that is done and your firewall is properly configured, it is like you say just a connection string.

Categories : Database

null refference at acessing multiple object in xml wit c#
XML element names are case sensitive. You have buttonaction in your XML, but buttonAction in your C# code. I would also recommend using string casts instead of .Value, as .Value will produce a NullReferenceException if an element is not found, and these can be hard to track down: select new Button() { texture = (string)button.Element("texture"), position = StringToVector((string)button.Element("position")), buttonAction = (string)button.Element("buttonaction") } You would also need to modify your StringToVector() method to be able to handle null values. This will make your code more resilient against NullReferenceExceptions.

Categories : C#

Issue with Acessing facebook page using restfb
I recently faced the similar issue. facebookClient.fetchObject("somePageName",Page.class) was throwing the exception you have mentioned. I noticed that the code runs properly for any page which is of the format A) facebook/somePageName however the pages with url like below do not work: B) facebook/pages/somePageName/2192383292 Any page which does not have a Page Username set in the PageInfo follows the type B url and is not accessible with the code. To resolve the issue, ask the page admin to edit the pageInfo and set a Username for the page. E.g for your case lets say the username specified is WellStartPauldingHospital. In that case the url to access the page will become https://www.facebook.com/WellStarPauldingHospital and you will be able to use the code as follows: Page page =

Categories : Facebook

Acessing dependency property in the same control xaml
Yes it is possible. something like: .xaml <UserControl x:Class="MvvmLight26.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:MvvmLight26" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"> <Grid Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:UserControl1}}, Path=CustomBackground}" /> </UserControl> and .xaml.cs: public partial class UserControl1 : UserControl { public static readonly DependencyProperty CustomBackgroundProperty =

Categories : Wpf

Acessing javaScript array of objects like a matrix
No. Objects and Arrays are two very different types in JavaScript. In an Array order is very important but order is not retained for Object keys. Keep in mind you can still iterate over the keys of an Object. for (var prop in myObj) { console.log("myObj.prop -> ", myObj[prop]); }

Categories : Javascript

Acessing array inside form variable sent
If the form field name is TRANSACTION[0].ID_FOR_SENDER_TXN (which is what your debugging loop is indicating), then you should address it as: form['FORM.TRANSACTION[0].ID_FOR_SENDER_TXN'] To clarify: When you access a variable using this notation: <cfset pTxnId = FORM.TRANSACTION[0].ID_FOR_SENDER_TXN /> ColdFusion expects this data structure: It looks for a key in the form named transaction, and tries to get the 0th index from it (side note: this wouldn't work in CF anyway, arrays begin with index 1), and as that first item in the array, it's expecting a structure with a key named ID_FOR_SENDER_TXN. However, what PayPal is sending you is actually using this format: This explains the error message: "Element TRANSACTION is undefined in a Java object of type class [Ljava.la

Categories : Arrays

Access Git repo via SSH tunnel
When you do this: git clone git@gitserver:proj/myrepo.git an ssh client is starting on the local host ('sshserver') and authenticating with 'gitserver' using public key authentication. If you get prompted for a password for user 'git', that means public key authentication has failed, and ssh is falling through to the next method, which is password authentication. The most likely reason that public key authentication would fail is that the ssh client does not have the private key needed. I suspect in this case that the key needed to authenticate as 'git@gitserver' resides in sshserver:~/.ssh, in which case it would not be available to the ssh client started on your local host when you try to clone the repo through your ssh tunnel. To solve this, you need to give that client access to

Categories : GIT

Using Flyway with a ssh tunnel to MySQL?
This is not a Flyway problem per se. Have a look here for how to set a MySQL connection up through an SSH tunnel: MySQL connection over SSH tunnel

Categories : Mysql

Remote debugger over SSH tunnel
Ok, I have now found a simple solution to this. I installed OpenVPN server on a VMWare virtual machine on my development box. So I now have tree machines. My development machine The server in need of debugging A new OpenVPN server (virtual) I then opened up port 443 in my firewall towards the OpenVPN machine and next I installed the OpenVPN client on both the server in need of debugging and on my development machine and connected both to the OpenVPN server. I had to configure OpenVPN so that I had 2 different users (one for each client) and I also had to enable cross-user communication on the VPN. I just had to add the IP submet of the VPN to the allowed private network list. One last bit was to add an entry in the C:WindowsSystem32driversetchosts file pointing the server name to the

Categories : Networking

Several Tabs clicked (URL changed with hashes) then Browser-Back-Button one site Back?
Without specific HTML or javascript from your use case, it is hard to narrow in on the best approach. That said, there are really three important tools in your toolkit when dealing with history state and hashes. Preventing the change You can also avoid the whole problem by using event.preventDefault(); (docs) in the handler code for your tabs, something like this: $('.tab').on('click', function (e) { e.preventDefault(); ... }); When the user clicks the tab, you immediately call preventDefault -- this will stop the default action from continuing. In this case, you're preventing the default behavior of a link (presumably) changing the URL of the document. The ... indicates your existing code for handling the tab click action. All told (and again without seeing your use case), thi

Categories : Jquery

Making JSESSIONID secure creating an issue for login issue from no-secure context
Is there any way to move from secure page(https) to unsecured page(http) or vice versa if JSEESIONID is secure Not with a single cookie. The whole point of secure is to stop the cookie being sent in the clear to an HTTP page, where an eavesdropper can purloin it and use it to access the HTTPS page. To have a system where compromise of an HTTP cookie didn't break the HTTPS cookie too, you'd have to have two separate session cookies with different names and values. eg: an http_session cookie, without secure that only the HTTP version of the site reads, and an https_session cookie, with secure, that only the HTTPS version reads. The login process would have to set both cookies, and the session system would have to be tinkered with to tie both session IDs to the same bag of session stora

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.