layout | title | date | thumbnail | tags | comments | og_image | ||||
---|---|---|---|---|---|---|---|---|---|---|
post |
Sharing WiFi Internet from Macbook to Ethernet with Wireless Router as Access Point |
2019-03-20 22:13 |
/assets/images/post-thumbnail/router-thumbnail.png |
|
true |
/assets/images/post-thumbnail/router-thumbnail.png |
This file contains hidden or 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
rtmp_auto_push on; | |
rtmp { | |
server { | |
listen 1935; | |
chunk_size 4096; | |
application live { | |
live on; | |
record off; | |
} |
This file contains hidden or 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
$ ffmpeg -analyzeduration 0 -video_size 1280x1080 -framerate 25 -re -f x11grab -i :0.0 -c:v libx264 -crf 23 -flags +global_header -preset ultrafast -minrate 7200 -maxrate 8k -vsync 1 -f flv -metadata streamName=ZombieHeroLiveStream rtmp://127.0.0.1/live-video | |
ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 the FFmpeg developers | |
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3) | |
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine - |
This file contains hidden or 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 <SDL2/SDL.h> | |
#include <stdio.h> | |
#define SCREEN_WIDTH 640 | |
#define SCREEN_HEIGHT 480 | |
#define RULER_HEIGHT_FACTOR 5 | |
static const int base_line = SCREEN_HEIGHT / 2; |
This file contains hidden or 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
/// for https://www.reddit.com/r/C_Programming/comments/b3wnhv/need_help_with_creating_pointers_of_a_2d_array_of/?st=JTJ6V0A6&sh=4926d7ec | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
int main (int argc, char** argv) | |
{ | |
// 1. Static fixed-size array | |
char ss[3][4][255]; |
This file contains hidden or 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
#!/usr/local/bin/gnuplot | |
reset | |
set parametric | |
# more smooth of 3d polygon | |
set isosamples 30 | |
# not see through | |
# comment this line will have better performance |
You can compile with (technically both are the same)
- Compile both source files at the same time
gcc test-objfile.c test-objfile-companion.c
- Compile each one individually, then output objf file to link together
gcc -c test-objfile.c -o test-objfile.o
gcc -c test-objfile-companion.c -o test-objfile-companion.o
This file contains hidden or 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
// demonstrate tree traversal | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct node node; | |
struct node | |
{ | |
struct node* child[2]; | |
char id; | |
}; |
This file contains hidden or 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> | |
int main (int argc, char** argv) | |
{ | |
int* ptr = malloc(sizeof(int) * 3); | |
*(ptr) = 1; | |
*(ptr + 1) = 2; | |
*(ptr + 2) = 3; |
This file contains hidden or 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 <string.h> | |
int main(int argc, char** argv) | |
{ | |
// get home directory (it's always set as HOME required by POSIX) | |
const char* homedir = getenv("HOME"); | |
char tempfile[128]; |