Skip to content

Instantly share code, notes, and snippets.

package com.data.linkup;
import android.Manifest;
import android.app.ActivityManager;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@databoose
databoose / server.c
Created August 18, 2020 08:49
server
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int main() {
thread_logger *thl = new_thread_logger(debug_mode);
thread_store(create);
self_pid = getpid();
sprintf(appendcmd, "ps hH p %d | wc -l > /dev/shm/linkup-varstore/thread_count", self_pid);
servsockfd = socket(AF_INET, SOCK_STREAM, 0);
struct sockaddr_in serv_addr;
struct sockaddr_in cli_addr;
@databoose
databoose / randomshit.c
Created August 11, 2020 00:54
option snippet
typedef enum {
create,
update
} THREAD_STORE_OPTION;
void thread_store(THREAD_STORE_OPTION opt) {
FILE *fptr;
if (opt == create) {
if(access("/dev/shm/linkup-varstore/thread_count", F_OK) != -1) { // if file doesn't exist
@databoose
databoose / server.c
Created August 4, 2020 07:28
server
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>