« first day (1774 days earlier)      last day (3184 days later) » 

6:00 PM
apcu is beginning to pass tests ... it's coming together ...
 
@Sajad ee /etc/rc.conf
(I dont know in which dictory you are)
 
but I'm here right now: root@Sajad:/usr/local/etc
 
if you start file-path with / , then it's the absolute path
 
ah I see
I opened it
 
I have to stop looking at this code ... it's so nasty ...
 
6:01 PM
it is 6 lines
there is not php_fpm_enable="YES"
I add it ?
 
yes, add it
 
done
 
the precious lines are some automatically added config (mostly networking)
 
ah
 
do the onestart
 
6:03 PM
ok
 
it will give you some indication that service started successfully
 
Guys
How do you msyqli select series of rows and only reurn the largest one
 
.. you seem to be reading error messages .. that's promising
 
I.e.
 
@tereško Starting php_fpm.
@tereško :-)
 
6:06 PM
next, you need to go to /usr/local/etc/nginx
 
so
 
is there an nginx.conf file there?
 
yes there is
also nginx.conf-dist
 
hmm ...
 
@Matthcw Order by the column you want to sort on and then add a limit clause.
 
6:09 PM
delete the nginx.conf file: rm nginx.conf
and then make a new one: ee nginx.conf
 
done
:-) why ?
there is not any code for create a new file ?
 
should I use of a editor ?
 
yes
 
ok
 
6:11 PM
 
done?
 
@tereško there is include /usr/local/etc/nginx/sites-active/*;
I have that file for including ?
 
no
 
ok, should I just copy-past ?
 
yes, copypaste it all in the file
 
6:12 PM
done
 
@kelunik open a PR on github, much easier to merge
 
save the file and then create "sites-active" folder in /usr/local/etc/nginx
do you remember how to make directories?
 
@kelunik nice work btw :)
 
@FlorianMargaine Yeah, added that too. ^^
 
@tereško how create folder ?
@tereško wait, I will think
makedir ?
or mkdir ?
or mkdiractorie
something like these ^ !
 
6:14 PM
@Sajad yes that one
 
@PeeHaa tnx
 
np
 
mkdir
 
@tereško what ? @PeeHaa told mkdiractorie ...
 
@FlorianMargaine I still don't know when it really happens, I can repro it with an internal server, but couldn't find another one except the SO answer's description.
 
6:15 PM
I think his point was linux
 
@Sajad he is an ass
 
@tereško :D
 
@PeeHaa oh !! are you Sick ?
done
 
now, make a file /usr/local/etc/nginx/sites-active/localhost.conf
 
done
what I write in that file (localhost.conf) ?
 
6:20 PM
1 sec
 
ok
 
then find the nginx service and try to start it
oh, wait, one more thing
 
@tereško I copepaste it to my localhost.conf ?
 
yes
 
ok
done
 
6:22 PM
you will also need to make a /var/www directory
 
in the root ?
or here: /usr/local/etc/nginx
 
well, you need to make a "www" directory in /var
no, starting from directory root
 
where is var ?
how I go to directory root ?
 
cd /
 
ah :)
 
6:24 PM
in there will be directory "var"
 
yes
 
inside it you need to make a "www" directory
 
but www is not there
oh ok, I wll create it
done
 
no, this is important:
In the first copy-pastable snippet there was a line user www; at the top. Did you notice?
 
I don't get it ...
 
6:26 PM
it's because on linux and bsd systems each service is run by a different user (those user accounts cannot be logged in and they are created when you install a service)
that way you can isolate every service and only let it have access to only what they need to
 
I don't get it ...
 
@Sajad what would happen if your php scripts could read and write files in your /etc directory? what would happen if your mysql service could alter configuration of nginx?
 
@tereško are you sure this is the best route to help him... I think he need to start from the basics, if mkdir is a problem
 
Guys
 
resen
 
6:30 PM
How do I get the LAREST ID ROW of multiple columns that share similar row ID's
 
@iroegbu no, there is no problem, I jsut need to explain to him why /var/www directoy needs to be owned by "www" user (or group, actually )
 
i.e.
Table - msgs (stores chat msg records such as: ID, FROM_ID, TO_ID, MSG_CONTENT, SEEN, MSG_DATE)
Example :
 
@tereško sorry, my traffic finished !
 
@PeeHaa I cannot enjoy looking at @rdlowrey anymore ever since I learned what he does to young parents. It's such a shame. He used to be perfect but now … all I see is evil sigh
 
@tereško I don't know ..
 
6:32 PM
id - to_id - from_id
1    3            1
2    2            3
3    1            2
 
@Gordon :P
 
@Sajad seriously? you you said you had 600MB left
 
@Gordon :D
 
Anyone know a way to actually subscribe and publish on redis? one user
 
@tereško my brother used it ...!
 
6:33 PM
oh .. joy
 
@PeeHaa It's like I found Dorian Gray's picture and now all is ruined :(
 
:)
I bought 100 mb now !
 
@NSGod Sure, but you don't want to use the web SAPI for that.
 
well, probably we have to continue this when the traffic counter is reset
 
@tereško ok, may answer your question ?
 
6:34 PM
@kelunik What you mean?
 
@Matthcw you haven't described your problem
 
Im not using any API
I have created my own class for Redis connection and commands
 
@tereško we don't continue it now ?
 
@Sajad if php could access your /etc/ directory and you (or someone else) made a mistake and created a security vulnerability, a hacker could overwrite something in your /etc directory. Like for example /etc/passwd file.
 
> The magic method __get() must have public visibility and cannot be static
^^ Uh, since when?
 
6:36 PM
@iroegbu I will carefully explain it to you
Basically I have a chat system.
 
@Sajad can you actually continue? This chat too is eating traffic.
 
The chat database looks like this:

ID, FROM_ID, TO_ID, MSG_CONTENT, SEEN, MSG_DATE
 
@tereško yes ! I will buy 500 mb again! 1 sec
 
Each user can send eachother messages, an dtheir Message and all relevent ID gets stored in the database
 
@NSGod How do you want to communicate with the user?
 
6:37 PM
Now I want to display all the users most recent chats and the friend they are chatting to
 
@tereško ok, I have 600mb now ! go on ..
 
:(
2 mins ago, by tereško
@Sajad if php could access your /etc/ directory and you (or someone else) made a mistake and created a security vulnerability, a hacker could overwrite something in your /etc directory. Like for example /etc/passwd file.
 
@tereško I see, How do I disable access
 
any questions aboutthis?
 
6:38 PM
@tereško I asked ...
 
So what I am trying to do is get all the chats (ALL records that have either of 2 numbers in either the to_id or from_id columns)
 
@Matthcw okay... first, you might want to normalize your database futher. But what you have now should be sufficient to get what you want. Also, does MSG_DATE contain dates, times or datetime
 
Okay, user get into channel and start chatting with the group on the post, each post have its own ID and each user have an user id @kelunik
 
Yeah, I just need help with mysql Logic that's all
wrapping my head around it
 
@Sajad you don't need to disable it, because every service already runs using it's own user. And only root user can access /etc
 
6:39 PM
I use the Post ID for subscribe @kelunik
 
Because so far what I have now is a record of ALL messages sent, NOT the newest records
 
@tereško ah
 
I just need that missing piece
 
that's why there was the line user www; in the config. It told nginx to use www user.
 
@tereško I want to kick out sajad from wheel !
 
6:40 PM
why? (you can, but what is your reason)
 
@tereško I want to just one user that be as root
just root !
 
@NSGod How do you want to realize the connection between server and browser? Websockets, long-polling, ...?
 
@Sajad But there is only one root. The "sajad" is only user who can become root if the correct password is entered
 
this is how user subscribe when enter the post chat section. "SUBSCRIBE POSTID USERID \n" @kelunik
 
@Matthcw what you are missing is ... ORDER BY MSG_DATE DESC assuming every other thing is working fine
 
6:41 PM
No, everything is in order
 
@NSGod Where do you send that from / to?
 
The system is just showing every message that I sent instead of the LATEST message
 
@tereško alright ..
 
From Application @kelunik as soon as the chat room load
 
@Matthcw ...ORDER BY... will show all the messages, it just orders them.
 
6:43 PM
@tereško can you tell me onething again :
 
@Sajad ok, the point I was telling you is that you need to make so that the /var/www directory is owned by "sajad" user and "www" group
 
@Matthcw You're looking for the LIMIT ... OFFSET ... clause.
 
@NSGod What's the application? A native client app, a long-running PHP script, ...?
 
root@sajad: #anything are what ?
 
@kelunik its an iOS app
 
6:44 PM
Oh, is there any way in SQL I could select the LARGEST ID for each user conversation
 
any thing is the path
root is what ?
sajad is what ?
 
WITHOUT cutting out any other users
 
{you told me that last night}
 
because I did LIMIT 1 using a sub query but it just cut out the rest of the users
 
but so far PHP people have help me with redis, cause swift don't have Redis API, I made one myself base on PHP users @kelunik
 
6:45 PM
@Matthcw you problem is not really clear...
 
@NSGod You'll need some layer in between, otherwise everyone will be able to control your redis server. Don't let clients directly talk to your redis instance.
 
assuming I've sent you some messages... what do you want to retrieve?
 
Hold on, are you familiar with pastebin?
or pastie.com?
 
yes
 
Ok 1 sec
 
6:45 PM
@Sajad root@sigillum:/var # in this example "root" is the currently used user, "sigillum" is the hostname and "/var" is the directory in which you are
 
@kelunik yes I'm aware of that, now is in production mode so I want to play around with it a little
 
@tereško ah, exactly I wanted that, tnx
 
@NSGod I don't understand what you're trying to say.
 
@Sajad that part of terminal just give you "current state" information
 
now, I have sajad user and root user ! I want to remove sajad user
 
6:46 PM
why?
 
@tereško because I need to just one user !
 
I can subscribe, but i can't publish message as subscriber @kelunik
 
@Sajad no, you need at least one ordinary user and one administrator user
 
with one socket connection @kelunik
 
@tereško aha !! alright
ok
so, what is the next step ?
 
6:48 PM
if i want to publish i need to open another connection @kelunik
 
@NSGod Did you read the docs for PubSub? Clients subscribed to channels shouldn't issue any other than PubSub commands.
 
so, you need to set so that /var/www is owned by your ordinary user: chown sajad /var/www
"chown" stands for "change owner"
 
@NSGod Yes, makes sense and is explicitly stated in the docs.
But again, don't let your app directly issue commands against your Redis server.
 
after that you need to do: chgrp www /var/www
 
@tereško I did, but what happened ?
 
6:50 PM
(I assume you can guess what that does)
 
@kelunik okay, I mean I collect user ID, and I'm going to do a security check with password protected to redis server
 
@tereško I did
 
@Sajad write ls -la /var to see the results
 
@NSGod You want to store the password in your app? In that case you can just skip the password check...
 
so basically you can't send message if password fail and userID is not provided @kelunik
 
6:51 PM
@tereško sajad is www !
 
"sajad" user owns /var/www
 
@tereško yes
 
@NSGod How do you want to ensure that if your app talks directly to the Redis server?
 
that is mean just sajad can go in this directory ?
 
@kelunik one question, is it okay if i open 2 connection for each user?
 
6:52 PM
well .. "sajad" and "root", because "root" can go everywhere
 
@tereško ah ! ok
@tereško but what was this: chgrp www /var/www
 
@kelunik I'm using many security check to connect to Redis like NAT etc
 
@Sajad what do you think "chgrp" stands for?
 
grp = group !
 
@kelunik its managed with AWS Security Group
 
6:54 PM
yes
 
I have no idea for ch
oh, it can be change ?
 
yes, it is
 
I thought: group is just for users, not for folders
 
every file and folder has assigned owner and group
 
@tereško ow ! alright then ..!
I got it, continue ..
 
6:56 PM
for example, you could have 10 users on your server, and you would want to have some permission for group "developers" (if you had one
 
I see
 
ok .. anyway ... to finish this, you need to set permissions so that owner can read write and execute stuff for /var/wwwand the group can read and execute stuff
 
@NSGod What you should do is something like this: Have a script on your server that has two connections to Redis, one for subscriptions and one for all other commands. Your script subscribes to all post and user channels. This script acts as a server and accepts connections from your iOS app. After accepting a new connection, it checks the provided credentials and let's a user subscribe to certain channels. These channels are stored in your script in some way...
 
you should write: chmod 750 /var/www
 
what is mod ?
 
6:57 PM
@kelunik Oh i got it I just read it again, so i need 2 connection. Thanks
 
@tereško done
 
@Sajad "modifier" ... that the "-rw-r--r--" part. Or in case of 750 for a directory: drwxr-x----
 
...whenever a new message on the subscription channel arrives, the script forwards these messages to the appropriate clients, the clients don't have any direct connection to Redis.
 
@tereško ah ..
 
6:58 PM
@kelunik one question, can i set EXP on publish message?
 
one question :
what is "2" in this: drwxr-xr-x 2 sajad www 512 Aug 25 18:26 www
 
@NSGod pubsub messages are never stored, so no.
 
@kelunik okay. Thanks
 
@tereško I got it
 

« first day (1774 days earlier)      last day (3184 days later) »