/* Change the permissions of all the sub files and folder
Remove the read/write/excute rights of group and others of all the files and subfolders of the specified folder
Using chmod command to excute
*/
# chmod -R go-r,go-w,go-x ./folder/
# chmod -R g-rwx,o-rwx ./folder2/
This area is my sharing area. Include some technical/believing/life experiences. Hope you can enjoy with me. God bless you. :)
2008年10月6日 星期一
2008年10月2日 星期四
Socket experience
Server
socket
bind
listen
accept
close
Client
socket
connect
close
While client issue the connect, the physical packet sequence is like
1. SYN (client -> server)
2. SYN+ACK (server->client)
3. ACK
But I found that server will auto send the FIN wjile the client is trying to connect the server.
So the connection will closed immediately while the client is trying to connect the server.
4. FIN+ACK
5.ACK
Afterall the client will also send the FIN to close the connection.
6. FIN+ACK
7. ACK
The server will respond the error
Socket Error: Transport endpoint is not connected
When a program is terminated using the exit, it will send the reset to the connected socket.
socket
bind
listen
accept
close
Client
socket
connect
close
While client issue the connect, the physical packet sequence is like
1. SYN (client -> server)
2. SYN+ACK (server->client)
3. ACK
But I found that server will auto send the FIN wjile the client is trying to connect the server.
So the connection will closed immediately while the client is trying to connect the server.
4. FIN+ACK
5.ACK
Afterall the client will also send the FIN to close the connection.
6. FIN+ACK
7. ACK
The server will respond the error
Socket Error: Transport endpoint is not connected
When a program is terminated using the exit, it will send the reset to the connected socket.
2008年10月1日 星期三
Endians
All processors must be designated as either big endian or little endian.
Intel's 80x86 processors and their clones are little endian.
Sun's SPARC, Motorola's 68K, and the PowerPC families are all big endian. The Java Virtual Machine is big endian as well.
Intel 80x86 is little endian (host byte order). The least significant byte first stored in the memory. So the memory dump is from the least significant byte to the most significant byte.
The network byte order format is big endian. So we need to transfer the byte order if we want to transfer data from Intel 80x86 machine onto the network.
For example.
General speaking, the packet format of adrress/port is like following syntax
Appearing in the physical packet
Address: 8c61 12ab ==> 140.97.18.171
Port: c268 ==> 0xc268 == 49768 (big endian format, network byte order, from the most significant byte to the least significant byte)
Intel's 80x86 processors and their clones are little endian.
Sun's SPARC, Motorola's 68K, and the PowerPC families are all big endian. The Java Virtual Machine is big endian as well.
Intel 80x86 is little endian (host byte order). The least significant byte first stored in the memory. So the memory dump is from the least significant byte to the most significant byte.
The network byte order format is big endian. So we need to transfer the byte order if we want to transfer data from Intel 80x86 machine onto the network.
For example.
General speaking, the packet format of adrress/port is like following syntax
Appearing in the physical packet
Address: 8c61 12ab ==> 140.97.18.171
Port: c268 ==> 0xc268 == 49768 (big endian format, network byte order, from the most significant byte to the least significant byte)
2008年9月24日 星期三
sendmail mail pool?
/var/spool/clientmqueue
sendmail mail pool?
The following message is copied from forum
> Hi, all
> I found there is a directory named /var/spool/clientmqueue and many
> many file below this directory, what's use of this directory and the
> files under it?
> thanks.
When submitting mail by using sendmail as a mail submission program,
sendmail copies all messages to /var/spool/clientmqueue first. sendmail is
a setgid smmsp program and thus gives the any user the permission to do so
(/var/spool/clientmqueue belongs to user and group smmsp).
Later, another sendmail process, the sendmail localhost-only (FreeBSD
default config) mail transfer agent (MTA) copies the messages from
/var/spool/clientmqueue to /var/spool/mqueue and sends them to their
destination.
When files accumulate in /var/spool/clientmqueue, you probably don't run
the sendmail localhost MTA, and thus the mails don't get send.
2008年9月1日 星期一
Linux Command - cvs, get specified date source from cvs server
we can use the following date format to retrieve the specified source date version
# cvs -q up -D 2008-08-13 00:00
# cvs st -v ./Makefile
===================================================================
File: Makefile Status: Up-to-date
Working revision: 1.18
Repository revision: 1.18 [omit]/Makefile,v
Sticky Tag: (none)
Sticky Date: 2008.08.12.16.00.00
Sticky Options: (none)
# cvs -q up -D "2010-01-18 18:00:00 +0800" //Because the Taipei time minutes was +08:00
or
# cvs -q up -D "2010-01-18 10:00:00 UTC"
# cvs st -v ./File.c
File: BufferManager.c Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 [omit]/File.c,v
Sticky Tag: (none)
Sticky Date: 2010.01.18.10.00.00
Sticky Options: (none)
# checkout a specified date/time version of project code in the UTC (Coordinated Universal Time). This command was worked for me.
# cvs checkout -D "2009-05-04 14:48:00 UTC" modulename
# The following format is not yet correct executed in my environment yet, but it was suggested by the net
cvs checkout -D "2009-05-04 14:48:00 +0800" modulename >> "+0800" means that the CVS UTC time will minus the "0800" and the real checkout time (UTC/GMT time) will be "2009-05-04 06:48:00"
or cvs update -D "2009-05-04 14:48:00 +0800" modulename
Note:
Greenwich Mean Time (GMT) can be considered equivalent to UTC time
// cvs command format
cvs [Global options] cvs_command [Common options] [cvs_command_individual_options]
//
# cvs -q up -r TSA_V1272_PS -D "2010-01-17 04:00:00 -0800"
File: Tunnel_TCP.c Status: Needs Patch
Working revision: 1.182.2.1.2.3
Repository revision: 1.182.2.1.2.4 /home/cvs/tunnelcode/TunnelSystem/TunnelSystem/Tunnel_TCP.c,v
Sticky Tag: TSA_V1272_PS (branch: 1.182.2.1.2)
Sticky Date: (none)
Sticky Options: (none)
# cvs -q up -D 2008-08-13 00:00
# cvs st -v ./Makefile
===================================================================
File: Makefile Status: Up-to-date
Working revision: 1.18
Repository revision: 1.18 [omit]/Makefile,v
Sticky Tag: (none)
Sticky Date: 2008.08.12.16.00.00
Sticky Options: (none)
# cvs -q up -D "2010-01-18 18:00:00 +0800" //Because the Taipei time minutes was +08:00
or
# cvs -q up -D "2010-01-18 10:00:00 UTC"
# cvs st -v ./File.c
File: BufferManager.c Status: Up-to-date
Working revision: 1.2
Repository revision: 1.2 [omit]/File.c,v
Sticky Tag: (none)
Sticky Date: 2010.01.18.10.00.00
Sticky Options: (none)
# checkout a specified date/time version of project code in the UTC (Coordinated Universal Time). This command was worked for me.
# cvs checkout -D "2009-05-04 14:48:00 UTC" modulename
# The following format is not yet correct executed in my environment yet, but it was suggested by the net
cvs checkout -D "2009-05-04 14:48:00 +0800" modulename >> "+0800" means that the CVS UTC time will minus the "0800" and the real checkout time (UTC/GMT time) will be "2009-05-04 06:48:00"
or cvs update -D "2009-05-04 14:48:00 +0800" modulename
Note:
Greenwich Mean Time (GMT) can be considered equivalent to UTC time
// cvs command format
cvs [Global options] cvs_command [Common options] [cvs_command_individual_options]
//
# cvs -q up -r TSA_V1272_PS -D "2010-01-17 04:00:00 -0800"
File: Tunnel_TCP.c Status: Needs Patch
Working revision: 1.182.2.1.2.3
Repository revision: 1.182.2.1.2.4 /home/cvs/tunnelcode/TunnelSystem/TunnelSystem/Tunnel_TCP.c,v
Sticky Tag: TSA_V1272_PS (branch: 1.182.2.1.2)
Sticky Date: (none)
Sticky Options: (none)
標籤:
Linux Command
2008年8月29日 星期五
openser debug experience
/* You can start the openser as following command for debuging usage */
# /usr/local/sbin/openser -D -ddddd
How to run the debug agent(only provide register function) of eXosip2(sip_reg), tools/sip_reg
# ./sip_reg -r sip:SIP-Registrar-Address:5060 -u sip:abc@SIP-Registrar-Address -e 120 -d
# /usr/local/sbin/openser -D -ddddd
How to run the debug agent(only provide register function) of eXosip2(sip_reg), tools/sip_reg
# ./sip_reg -r sip:SIP-Registrar-Address:5060 -u sip:abc@SIP-Registrar-Address -e 120 -d
2008年8月22日 星期五
Some confuse about semaphores...
There are seems two ways to use semaphore? I am not exactly sure :(
First way as follows
sem_open() /* Set the initial value, but I happen with the initial value that is differ with what I am setting */
sem_init() /* Set the initial value */
sem_getvalue()
sem_wait(), sem_trywait() /* lock the semaphore */
sem_post() /* unlock the semaphore */
Second way
ftok()
semget()
semctl() /* Set the initial value */
sem_op() /* lock/unlock the semaphore */
First way as follows
sem_open() /* Set the initial value, but I happen with the initial value that is differ with what I am setting */
sem_init() /* Set the initial value */
sem_getvalue()
sem_wait(), sem_trywait() /* lock the semaphore */
sem_post() /* unlock the semaphore */
Second way
ftok()
semget()
semctl() /* Set the initial value */
sem_op() /* lock/unlock the semaphore */
訂閱:
文章 (Atom)