Skip to content

Instantly share code, notes, and snippets.

View deep5050's full-sized avatar
💻
EMBEDDED SYSTEM

Dipankar Pal deep5050

💻
EMBEDDED SYSTEM
View GitHub Profile
@deep5050
deep5050 / change_email.sh
Created November 11, 2020 15:52
NaughtyLust upload
#!bin/sh
git filter-branch --env-filter '
OLD_EMAIL="[email protected]"
CORRECT_NAME="Dipankar Pal"
CORRECT_EMAIL="[email protected]"
if [ "$GIT_COMMITER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITER_NAME="$CORRECT_NAME"
export GIT_COMMITER_EMAIL="$CORRECT_EMAIL"
@deep5050
deep5050 / Unicorn.md
Last active September 6, 2020 08:59
Unicorn logo
We couldn’t find that file to show.

Contribution

All kinds of contributions are welcome 🙌! The most basic way to show your support is to star 🌟 the project, or to raise issues 💬 You can also support this project by becoming a sponsor on GitHub 👏 or by making a [Payp

@deep5050
deep5050 / establish_server.c
Created April 16, 2020 10:00
establish a server on the first available ip address
/* This function establish a server on the first available address
args: char* port
int backlog value
return: update the server_IP : server IP adress on which it has bind
*/
int establish_server( char *port, int backlog, char *server_IP)
{
int yes = 1;
struct addrinfo server_addr, *results, *p;
@deep5050
deep5050 / timestamp.c
Last active April 16, 2020 09:54
human readable timestamp in c
char *timestamp()
{
struct tm *local;
time_t t = time(NULL);
char *str;
/* Get the localtime */
local = localtime(&t);
str = asctime(local);
@deep5050
deep5050 / dipankar_client.c
Created April 5, 2020 10:33
client server application implemented in C ( kinda Remote Terminal)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
@deep5050
deep5050 / dipankar_server_thread.c
Last active April 5, 2020 10:14
USAGE: <port> <baklog> multi threaded implememtation of the sever
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
@deep5050
deep5050 / dipankar_server_process.c
Last active April 5, 2020 10:26
USAGE: <port> <backlog> : handled with multi processes
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
@deep5050
deep5050 / client.c
Last active April 5, 2020 10:28
./client <port>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
@deep5050
deep5050 / simple_server.c
Last active April 5, 2020 10:27
./server <port> <backlog>
#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<string.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include<signal.h>