Skip to content

Instantly share code, notes, and snippets.

View tmathmeyer's full-sized avatar
🤧
Achoo

Ted tmathmeyer

🤧
Achoo
  • Google
  • kirkland
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include "bathroom.h"
typedef struct indiv_info
// Ted Meyer
// Bathroom.c
// License: GPL v2
#include "bathroom.h"
#include <stdio.h>
#include <time.h>
#include <pthread.h>
//enum gender =
asmlinkage long receive(pid_t* sender, void* mesg, int* len, bool block)
{
mailbox* my_mail;
message* msg;
my_mail = map_get(current->pid);
if (!my_mail)
{
my_mail = make_mailbox(current -> pid);
pthread_t sysinthread;
pthread_create(&sysinthread, NULL, sysin, NULL);
while(!running)
{
usleep(100000);
}
while(running)
{
@tmathmeyer
tmathmeyer / gist:9718294
Last active August 29, 2015 13:57
floats are so stupid
#include <stdio.h>
#include <stdlib.h>
char* int2bin(unsigned x){
char* res = malloc(32);
int i = 32;
while(i>0){
i--;
@tmathmeyer
tmathmeyer / byte2short.c
Last active August 29, 2015 13:57
convert byte to short in an interesting way
unsigned short byte2short(char b)
{
char c = 8;
unsigned short answer = 0;
while(c-->0){
answer<<=2;
if (b&(((char)1)<<c))
answer+=3;
}
return answer;
#include <stdlib.h>
#include <stdio.h>
char* int2bin(unsigned short x){
int size = sizeof(x)*8;

#Language

/* declaring a value */
single = (1)
double = (2, 17)
triple = (10, 33, 2)

server{
listen 80;
server_name example.com;
access_log /home/path_to_site/access.log;
error_log /home/path_to_site/error.log;
location / {
proxy_pass http://0.0.0.0:8002;
proxy_set_header Host $host;
Description='Automatically generated profile by wifi-menu'
Interface=wlp2s0
Connection=wireless
Security=wpa-configsection
ESSID='WPI-Wireless'
IP=dhcp
TimeoutDHCP=60
TimeoutWPA=60
TimeoutCarrier=60
WPAConfigSection=(