Skip to content

Instantly share code, notes, and snippets.

View anilmuppalla's full-sized avatar
👋
Always be creating…

Anil Muppalla anilmuppalla

👋
Always be creating…
View GitHub Profile
import asyncio
from dataclasses import dataclass, field
import ollama
from dotenv import load_dotenv
from ollama import ChatResponse
from pydantic import BaseModel
from pydantic_ai import Agent, RunContext
from pydantic_ai.models.ollama import OllamaModel
@anilmuppalla
anilmuppalla / Guidelines for R on R
Last active December 12, 2015 07:28
Summary of railstutorial.org
#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.
#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>
#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>
#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[])
#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();
/* 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() */
/* 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>
/*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>
/***** 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 */