176

(5 replies, posted in Programming)

Jérémie wrote:

Why bother with variables?

cp mydb mydb_`date "+%Y-%m-%d"`.sql.gz;

should work fine.

don't mind me... noob codding, lol.

Allow me a question... why name the file .gz if it's not gziped?

Thanks for the script

177

(12 replies, posted in Programming)

i am using sqlite2 in fact.

That basically means i cant add a column to a table. Or am i missing something?

178

(12 replies, posted in Programming)

i think thats only for text fields

179

(12 replies, posted in Programming)

same error

really strange...

could it be permition issues?
the file has permitions -rw-rw-r--

180

(5 replies, posted in Programming)

mmm so...

piece2='date "+%Y-%m-%d"'
piece1='mydb'
filename="${piece1}${piece2}"
cp mydb filename

i am a still a bit confusing with the way the string variables are handled ( noob )

would that do it?

181

(12 replies, posted in Programming)

I am trying to run this little query on my sqlite database and ik keeps throwing a syntax error near ALTER


ALTER TABLE posts ADD COLUMN srcfile int;


Whats wrong with this?

182

(5 replies, posted in Programming)

I want to cron a tiny script to backup my sqlite database.

it should copy the file 'db' to the file 'db20070327'.

Any hint on how to get the date and concatenate strings in shellscript?

I could easily do it with other programming language, but i want to try shellscript. thanks

183

(19 replies, posted in PunBB 1.2 discussion)

I am having some performance issues and i suspect is the database taking to long to answer...
but i am not having that many concurrent users, usually there is between 6 and 10 users online, sometimes 12.

My database is 20 Mbyte big
3000 users
7000 posts
Could it be the database that is slowing things down?

184

(0 replies, posted in Programming)

on the sqlite part of the dblayer the touch() function is used
I've seen this procedure some times before. Can anybody explain me the  idea behind its usage and why is it necessary?

Lines 54 and 55:
http://www.phpxref.com/xref/punbb/nav.h … ce.html.gz

185

(0 replies, posted in PunBB 1.2 discussion)

I think i heard about one veeeeery long ago.
Is there such a thing? like, it reads emails from a mailbox and archive them in a forum?

I wouldn't like to make changes in the code because of the updates. I've highly modify the code of a forum that i set up and i keep wondering if i will remember all changes i made when it comes to update.

About you solution... i am dummy, it's the second time i need to do such a change ( the other was allowing html in some specific posts ) and both times the solution was the same and it was in front of my nose without me seeing it, lol.

Elbekko, thank you, you are becoming my official troubleshooter smile

I will check anyway if i can manualy insert more than 64kb of text in the post body field.

I guess some checking bypass in post.php would be necessary, that's ok. But i am more confused with the database.

I didnt got yet if i can or not insert more than 64kb of text data in a sqlite field. From what i red here
http://www.sqlite.org/datatypes.html
there is only one text datatype.
Do i or don't i have to hack the table?
When answering please keep in ming that i am talking about sqlite.

The posts with long large text data will be made through external script so i think i will leave the checking as it is in post.php

188

(12 replies, posted in Programming)

Try it.
You mean you want to evaluate the echo execution?

You can assign whatever you want to echo into a variable through a function call like this

if($foo = function_call_to_evaluate($foo2)){
     echo $foo;
}

yes, i though about something like that.
Lets see... did you just copy viewforum.php and removed the pagination and change the query?

190

(3 replies, posted in PunBB 1.2 show off)

nice integration

Forgot to mention that.
The whole idea is not to limit the number of results, i don't want to have pagination. I want all the forum topics to be accessible from that page.
aparently one can store any kind of data in any column ( almost ) if using sqlite.

I am using sqlite so maybe....  does anybody know the maxsize of sqlite field? Maybe a post would be enough to host the topic index, then i could make it a sticky.

Rickard wrote:
pedrotuga wrote:

I meant that in general people are way too obsessed about security.

Yes, but people are obsessed about security in all the wrong ways. They install mammoth software firewalls, anti-virus, anti-spyware and shit like that instead of using a bit of common sense.

In the case of PunBB though, I believe we need to be a bit obsessed. We're developing something that other people are going to use, and we're distributing it with the source code wide open.

I agree with bot of those. This discussion was not refering to punbb in particular. That's why i said i don't think this new hashing is useless.
The blog entry just made me think about all this existencial security doubts i had. Thank you three for the answers smile

Smartys wrote:

pedrotuga: So, do you want me to try and answer something else? smile

Dont get me wrong. Far from me saying that this is new hashing is useless.
I meant that in general people are way too obsessed about security. The last does not imply the first.

Comment #6 focus what i just posted here and comment #7 gives the explanation there is to give.

Mmmm there is some improvement in security, an attacker would have to build a rainbow-table for each salt. So it would have to focus on one ( or more ) specific user rather then trying to find colisions in whatever data he/she hijacked.

We all should keep in mind that this wont stop a brute force attack if the attacker intends so ( and can perform it of course )

I want to write a small mod that lists all the topics from one forum alfabeticaly. A simple post is not a solution as some lists would break the limits of a mysql text field, and even if they dont in most of the cases it can be a heavy sql query that can slow things down.
It can be updated with cron or manually from the administration control panel, i think the last one is beter.

I thought about a small mod that stores these lists in textfiles and fetch them whenever they are red. Now i would like it to look like a forum post and to be acessible from a sticky link in the viewforum. There is no post-redirects in punbb so maybe this navigation solution would require a lot of hacking.

I need some guidelines... can anybody point me briefly the way to do this?

That's actually the article i was reading when my doubts came up. I interrupted then the reading to, once and for all, understand the salt thing.

Now i red the whole article anyway and got to understand how the punbb password hashing system works. But i am still wondering about my biggest doubt:

Every single article i read about this ( including that blog entry ) points the big danger: database leaking.
If password leaking is the "attack"  one should be protected of, in case it happens, i can't see how storing a hash in the very same database improves security.

I take the chance to drop another related question:
The hashed ( with salt ) passwords in a *nix system are stored in a passwd file. Where is the location where the salt is typicaly kept?

ok... some little extra-data is added to the password in order to avoid brute-force, rainbow-tables, dicionaries, etc.
But i didnt got yet ( despite all the articles i red about it out there ) how da heck does the salt is put together with the unencrypted password to match the final hash.

Like, when i login into a punbb 1.3 forum,  i insert my passowrd, where is the salt stored in order to be added to my password so it can be checked?

Just in case somebody feel tempted to answer with a wikipedia link, i red this article before i post this message
http://en.wikipedia.org/wiki/Salt_%28cryptography%29

I have set up my script and fetch about 100 posts a day running it once through a crontab.
This script, as it is posts only in a category, but you can simply solve that.

Put an array into $newsforum_id rather than an intiger.
use a two dimension array in $feed_array being the first coordinate the forum_id of the feed.

wrap the code into one more foreach cicle to loop through the forums and replace $feed_array by $feed_array[$forum_id]

If all this sounds tricky or complicated i suggest you run multiple instances of ths script with different settings.

I could go into the code and change it a bit but i am currently out of time to test it.
If you go on and hack the code feel free to drop questions

I dont just try this because i want it to be made smoothly with as little downtime as possible.

I need to move my sqlite database file to another folder due to permissions changes in the server. Is the path in config.php all it's necessary to change?

200

(19 replies, posted in PunBB 1.2 discussion)

I didnt know sqlite locked the whole database for writing. Well. at least you dont run into integrity insert errors big_smile

This is very relative i know, but.. how big and how visited would a forum be when a sqlite db would start to decrease performance.