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> | |
int main(void) { | |
fprintf(stdout, "This is stdout\n"); | |
fprintf(stderr, "This is stderr\n"); | |
return 0; | |
} |
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
#!/bin/bash | |
rm /tmp/bar /tmp/foo /tmp/stream | |
mkfifo /tmp/foo | |
mkfifo /tmp/bar | |
mkfifo /tmp/stream | |
# dump raw streams to fifo pipes | |
echo Started audio mplayer | |
screen -d -m mplayer "$1" -ao pcm:file=/tmp/bar -vo null | |
echo Started video mplayer |
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
What the squid did you just squidding say about me, you little human? De geso. I'll have you know I graduated top of my class in the Navy Squids, and I've been involved in numerous secret raids on Fish Markets, and I have over 300 squidding gills. I am trained in tentacle warfare and I'm the top inker in the entire squid army de geso. You are nothing to me but just another servant. I will wipe you the squid out with precision the likes of which has never been seen before on this Surface World, mark my squidding words. You think you can get away with saying that fish to me over the Internet? Think again, human. As we speak I am contacting my secret network of squids across the Surface and your IP is being traced right now so you better prepare for the tsunami, human. The storm that wipes out the pathetic little thing you call your life. You're squid-ding dead, mouth breather. I can be anywhere, anytime, and I can gill you in over seven hundred kraken ways, and that's just with my bare tentacles. Not only am I |
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
-- {{{ Grab environment | |
local tonumber = tonumber | |
local io = { popen = io.popen } | |
local string = { gmatch = string.gmatch, format = string.format} | |
local helpers = require("vicious.helpers") | |
-- }}} | |
local muhmpd = {} | |
local function to_time(secs) |
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 <stdlib.h> | |
#include <sys/types.h> | |
#include <inttypes.h> | |
int main(int argc, char **argv) { | |
if (argc < 2) { | |
fprintf(stderr, "No fuck you, give me a file to work with!\n"); | |
exit(1); |
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
#ifndef MP3SPLIT_H | |
#define MP3SPLIT_H | |
// MP3 FLAGS | |
#define MPEGV_MASK 0x180000 | |
#define LAYER_MASK 0x60000 | |
#define CRC 0x10000 | |
#define BITRATE_MASK 0xF000 | |
#define SAMPLING_MASK 0xC00 |
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
uint32_t get_first_header(int fd) { | |
uint8_t cur_byte; | |
uint32_t header = 0; | |
ssize_t n = 0; | |
while (n < 1) { | |
n = read(fd, &cur_byte, 1); | |
fprintf(stderr, "Read %d bytes\n", n); | |
if (n < 0) { | |
fprintf(stderr, "%s\n", strerror(errno)); | |
exit(1); |
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
struct Frame { | |
uint32_t header; | |
uint8_t* content; | |
}; |
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
[...] | |
pid_t child; | |
child = fork(); | |
/* the following part /looked/ like this: | |
if (child == 0) | |
fprintf(stderr, "mp3_stream fd: %d\n", mp3_stream); | |
serve_stream(mp3_stream, head_client); | |
*/ | |
if (child == 0) { |
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
if (child > 0) { | |
for(;;) { | |
listen(server, 10); | |
client_len = sizeof(client_addr); | |
client = accept(server, (struct sockaddr*) &client_addr, &client_len); | |
fprintf(stderr, "Got new client!\n"); | |
if (client < 0) { | |
fprintf(stderr, "Something went wrong while accepting the client!\n"); | |
exit(1); | |
} |
OlderNewer