This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install RVM with ruby: | |
\curl -L https://get.rvm.io | bash -s stable --ruby | |
#Additionally with rails: | |
\curl -L https://get.rvm.io | bash -s stable --rails | |
#since Heroku as on Feb, 2012 supports Ruby 1.9.2 and Rails 3 | |
#we need to switch to these versions, by creating a gemset. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <time.h> | |
#include <string.h> | |
#include <stdio.h> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <time.h> | |
#include <string.h> | |
#include <stdio.h> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
int main(int argc, char *argv[]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <unistd.h> | |
#include <syslog.h> | |
int main(int argc, char *argv[]) { | |
pid_t pid, sid; | |
/* Clone ourselves to make a child */ | |
pid = fork(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Run the server in a terminal: | |
* $ ./udpserv | |
* Then, open another terminal and feed something on UDP on 127.0.0.1 port 61321 via UDP, e.g. with netcat: | |
* $ echo -n "Hello lame server." | nc -u 127.0.0.1 61321 | |
* Also try omitting the newline (here, take "-n" away), and sending large messages (eg, cat a whole file). | |
*/ | |
#include <stdio.h> | |
/* socket(), bind(), recvfrom() */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Run the server in a terminal: | |
* $ ./udpserv | |
* Then, open another terminal and feed something on UDP on 127.0.0.1 port 61321 via UDP, e.g. with netcat: | |
* $ echo -n "Hello lame server." | nc -u 127.0.0.1 61321 | |
* Also try omitting the newline (here, take "-n" away), and sending large messages (eg, cat a whole file). | |
*/ | |
#include <stdio.h> | |
/* socket(), bind(), recvfrom() */ | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*n example source module to accompany... | |
* | |
* "Using POSIX Threads: Programming with Pthreads" | |
* by Brad nichols, Dick Buttlar, Jackie Farrell | |
* O'Reilly & Associates, Inc. | |
*/ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <errno.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***** File: pipe.c *****/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/wait.h> | |
#include<stdlib.h> | |
int main(int argc, char *argv[]) | |
{ int p[2]; | |
int i, pid, status; | |
char buffer[20]; | |
pipe(p); /* setting up the pipe */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* second pipe example from Haviland */ | |
#include <unistd.h> | |
#include <stdio.h> | |
#define MSGSIZE 32 | |
char *msg1 = "hello #1"; | |
char *msg2 = "hello #2"; | |
char *msg3 = "hello #3"; |
NewerOlder