Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
well you've got nothing to lose by emailing a bunch of site admins
[QUOTE=Eltro102;44453674]well you've got nothing to lose by emailing a bunch of site admins[/QUOTE]
I have this underlying idea that there is a reason why this doesn't happen. Essentially trying to think of what that reason might be though.
If I make a site for someone trying to sell guns for example, and they get super caught, am I in any way liable?
I can imagine it going as far as "aiding and abetting" etc
I'm not planning on putting any personal info out there, but covering my ass would definitely have to be a priority
If you know they're doing illegal stuff, and you still make a website for them, you're breaking the law. If you knew they're selling guns, but you didn't know they're doing it illegally, then it's a gray area.
If you're going to do any work for people on the deep web (whether or not it's legal), never give any hint as to your real identity. Don't use the same username, don't give them previous work you've done outside of the deep web, and don't give them any personal information (even an email). Even if you're not breaking the law, it can still make you look bad.
Anyone know a good tutorial on how to do authentication/sessions the right way? I feel stupid for not knowing how to. I mean, I can do it by storing things in localStorage or whatever, but I don't know anything about cookies or session stuff and I feel like I'm missing something obvious.
[editline]7th April 2014[/editline]
I use node primarily, and angular on the front end
I badly need help with varnish.
backend api {
.host = "api.steampowered.com";
.port = "80";
}
backend steamcommunity {
.host = "steamcommunity.com";
.port = "80";
}
set req.backend = api;
if (req.http.host == "steamcommunity.com") {
set req.backend = steamcommunity;
}
varnish fails to start when it's not all commented out apart from my default one.
anyone know the cause?
[QUOTE=Shadaez;44479479]Anyone know a good tutorial on how to do authentication/sessions the right way? I feel stupid for not knowing how to. I mean, I can do it by storing things in localStorage or whatever, but I don't know anything about cookies or session stuff and I feel like I'm missing something obvious.
[editline]7th April 2014[/editline]
I use node primarily, and angular on the front end[/QUOTE]
From my rudimentary knowledge of sessions in php I can write the following.
Use the cookie to store the session id, the session id is unique and lets you identify which session that user has assigned to them.
In php by default the session is a text file, inside it has a set of key values which you can set, it acts like an associative array. I do not recommend using a text file. It is slow and having several pages reading and writing the session creates bottle necks. For this reason there are several session wrappers for PHP which use sql instead.
Here is what I would do, not knowing if there are actual sessions in node.
Client - When a user opens a page check if they have a session id in the cookie.
Server - From your sql database check if there is a session with that sessionid
Server - See if the IP of the person requesting the page is the same as stored in the session
Server - See if session is not timed out (when you login/do an action add x time to the session timeout)
if both of these checks do not pass then delete the session
Regenerate the session id and pass it back to the user
If the above checks pass then let the server then get the session key values from a different table, use these key values for whatever they are needed for on the server side.
Send the page to the client.
tl;dr
Each user has unique session id
Session stores a set of key values
session needs to have timeout and ip for verification
On each action reset the timeout
-snip, not smart-
Does a javascript library/framework/tool/thing exist already that will automatically take any image in your site and make it load via ajax rather than slowing the load time?
I don't know much about web development so please bear with me
I'm interested in making an online database, with information that can be pulled and used by a local application. For example, the application would pull information like names, pictures, links, etc from the database, then display that information in the program.
What's the most efficient way of doing this? I wouldn't be storing big files, just strings. I'm developing on Linux with a focus on Python. Just looking to be pointed in the right direction.
[editline]9th April 2014[/editline]
So let's say in this database I had some variables like:
name = "Something"
link = "www.something.com"
picture = "www.something.com/something.png"
I want to be able to pull those variables and display them in a local application
[QUOTE=Richy19;44500223]Does a javascript library/framework/tool/thing exist already that will automatically take any image in your site and make it load via ajax rather than slowing the load time?[/QUOTE]
I'm pretty sure that every browser that is even remotely modern loads images asynchronously already. What exactly are you wanting to have happen differently?
[QUOTE=rilez;44500817]I don't know much about web development so please bear with me
I'm interested in making an online database, with information that can be pulled and used by a local application. For example, the application would pull information like names, pictures, links, etc from the database, then display that information in the program.
What's the most efficient way of doing this? I wouldn't be storing big files, just strings. I'm developing on Linux with a focus on Python. Just looking to be pointed in the right direction.
[editline]9th April 2014[/editline]
So let's say in this database I had some variables like:
name = "Something"
link = "www.something.com"
picture = "www.something.com/something.png"
I want to be able to pull those variables and display them in a local application[/QUOTE]
so you want to make an API?
[url]http://flask.pocoo.org/[/url] since you're using python, never used it but I've heard good things.
Yeah, that's what I'm thinking. I just don't know how to store the information. How do I make the database itself? Does Flask also function as a DB? Do I need to use something like MySQL? The user will be requesting a name, and then I need to show the results (variables like name, link, pictures, comments etc) for that search.
look into sqlite
[QUOTE=Eltro102;44501165]look into sqlite[/QUOTE]
He said that he wanted to do an online database; sqlite is more suitable for clientside ones, due to its lightness.
Considering that he only wants to store some variables in a single row per item, I'd say MySQL could do the job.
Yeah, it needs to be online so the user can request an update. If MySQL is better suited for that task, I'll probably be using MariaDB. That's the version recommended by our distro.
I've never worked with MySQL before, is there any place in particular I should look? Like I said, we're looking to use primarily Python for our work
[QUOTE=Coment;44501331]He said that he wanted to do an online database; sqlite is more suitable for clientside ones, due to its lightness.
Considering that he only wants to store some variables in a single row per item, I'd say MySQL could do the job.[/QUOTE]
SQLite is completely fine if accesses to the database are far more read-heavy than write-heavy, which seems to be the case here. It also doesn't require you to set up MySQL, MariaDB or PostgreSQL (the last of which I personally prefer most).
[QUOTE=KmartSqrl;44500855]I'm pretty sure that every browser that is even remotely modern loads images asynchronously already. What exactly are you wanting to have happen differently?[/QUOTE]
I was just thinking of writting a js script that would automatically do it for you but I didnt want to re-invent the wheel
mariadb is great, you can just take a mysql tutorial and use it with maria most (90%) of the time.
you'd pretty much be doing something like this in the end:
CREATE TABLE IF NOT EXISTS table_name
(id INTEGER PRIMARY KEY,
name TEXT,
data INTEGER,
image_url TEXT,)"
And then you want to do PREPARED STATEMENTS when you insert/update/search from a clientside app.
I'm working with tables and it's working beautifully in Chrome, but not so much in Firefox. In Chrome the table rows fill the table's width, while in Firefox they're only as big as the largest row value. Pics below:
Chrome:
[t]http://i.imgur.com/Lw1uZxq.png[/t]
Firefox:
[t]http://i.imgur.com/WLWfoHB.png[/t]
You can view it yourself here: [url]http://ftb.blushell.net/wildcard/builder.php[/url]
Here's the Sass style:
[url]http://pastebin.com/yfKBPT43[/url]
[QUOTE=Cep.;44503465]I'm working with tables and it's working beautifully in Chrome, but not so much in Firefox. In Chrome the table rows fill the table's width, while in Firefox they're only as big as the largest row value. Pics below:
Chrome:
[t]http://i.imgur.com/Lw1uZxq.png[/t]
Firefox:
[t]http://i.imgur.com/WLWfoHB.png[/t]
You can view it yourself here: [url]http://ftb.blushell.net/wildcard/builder.php[/url]
Here's the Sass style:
[url]http://pastebin.com/yfKBPT43[/url][/QUOTE]
It might be related to having a block in an inline-block
[QUOTE=Cep.;44503465]-stuff-[/QUOTE]
-snip-
actually commander204 was somewhat right
table should not be block
[url]http://stackoverflow.com/questions/3112876/firefox-table-css-generate-tbody-killing-table-width[/url]
get rid of all your display:block
table should always be
display:table
Do you guys have a preferred webhost? I have a year subscription with Dreamhost right now, found them through Lifehacker. Unlimited bandwidth and storage, but it's slow (shared host) and I don't have root. FTP access gets me like 10kb/s upload and that's just unacceptable.They also don't seem to support mariaDB.
Any suggestions? Right now we're just looking for a webhost, so I don't need crazy storage. Just speed and root access. The database I talked about earlier will also be on here.
[QUOTE=rilez;44503655]Do you guys have a preferred webhost? I have a year subscription with Dreamhost right now, found them through Lifehacker. Unlimited bandwidth and storage, but it's slow (shared host) and I don't have root. FTP access gets me like 10kb/s upload and that's just unacceptable.They also don't seem to support mariaDB.
Any suggestions? Right now we're just looking for a webhost, so I don't need crazy storage. Just speed and root access. The database I talked about earlier will also be on here.[/QUOTE]
MariaDB is to MySQL like Nginx is like Apache.
The end result is usually about the same, it just differs internally (nginx differs a bit externally, too, but they both do http, and MySQLdb and MariaDB both do mysql)
Unless you're setting up a server manually, you shouldn't really worry about mysql vs mariadb.
[QUOTE=jung3o;44503534]-snip-
actually commander204 was somewhat right
table should not be block
[url]http://stackoverflow.com/questions/3112876/firefox-table-css-generate-tbody-killing-table-width[/url]
get rid of all your display:block
table should always be
display:table[/QUOTE]
Winner! Thanks for the quick help guys.
[QUOTE=AndrewPH;44503713]MariaDB is to MySQL like Nginx is like Apache.
The end result is usually about the same, it just differs internally (nginx differs a bit externally, too, but they both do http, and MySQLdb and MariaDB both do mysql)
Unless you're setting up a server manually, you shouldn't really worry about mysql vs mariadb.[/QUOTE]
I'd been planning on setting up the server manually. We're developing on Arch Linux, which uses MariaDB as their official implementation of mysql. It's just easier to set it up that way. Otherwise we have to compile packages from source.
I'd still prefer a new host for the other reasons mentioned
[QUOTE=rilez;44503655]Do you guys have a preferred webhost? I have a year subscription with Dreamhost right now, found them through Lifehacker. Unlimited bandwidth and storage, but it's slow (shared host) and I don't have root. FTP access gets me like 10kb/s upload and that's just unacceptable.They also don't seem to support mariaDB.
Any suggestions? Right now we're just looking for a webhost, so I don't need crazy storage. Just speed and root access. The database I talked about earlier will also be on here.[/QUOTE]
Just get a VPS. They're pretty cheap.
Yeah, was looking at different VPS providers. Anyone here use Linode? That was the one I was most interested in. Would appreciate suggestions though.
[url]https://www.linode.com/[/url]
I like that I can choose my distro & they have a management app for mobile phones.
[QUOTE=rilez;44503824]Yeah, was looking at different VPS providers. Anyone here use Linode? That was the one I was most interested in. Would appreciate suggestions though.
[url]https://www.linode.com/[/url]
I like that I can choose my distro & they have a management app for mobile phones.[/QUOTE]
I've had nothing but good experiences with [url=http://allgamer.net/]Allgamer's services[/url], personally. The owner and the support staff are really nice and all.
[QUOTE=AndrewPH;44504823]I've had nothing but good experiences with [url=http://allgamer.net/]Allgamer's services[/url], personally. The owner and the support staff are really nice and all.[/QUOTE]
Buying a VPS for a webserver from a GSP is just asking for trouble.
[QUOTE=supersnail11;44504851]Buying a VPS for a webserver from a GSP is just asking for trouble.[/QUOTE]
I would agree if they were one of those dime-a-dozen TCadmin hosts, but they aren't. They put a lot of effort into their services.
For example, their custom gameserver control panel Xylona.
Sorry, you need to Log In to post a reply to this thread.