An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| /* http://redd.it/2zna5q | |
| * Fibonacci example: | |
| * (1) (2) + | |
| * 0:0 | |
| * 1:1 | |
| * 20 | |
| */ | |
| #define _BSD_SOURCE // MAP_ANONYMOUS | |
| #include <stdio.h> | |
| #include <stdlib.h> |
| /* http://redd.it/2z68di */ | |
| #define _BSD_SOURCE // MAP_ANONYMOUS | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <sys/mman.h> | |
| #define PAGE_SIZE 4096 |
| /* UUID (v4) generator in ANSI C | |
| * $ cc -O3 -o uuid uuid.c | |
| * $ uuid [count] | |
| * Output rate: 30 million UUIDs per second on modern hardware. | |
| * Warning: Generator rolls over after 2^66 UUIDs (or every 78,000 years). | |
| * | |
| * This is free and unencumbered software released into the public domain. | |
| */ | |
| #ifdef _WIN32 | |
| # define WIN32_LEAN_AND_MEAN |
| /* stream tokenizer: strtok() for ANSI C file streams | |
| * | |
| * This provides getdelim()-like functionality, but it is faster than | |
| * your system's detdelim() or getline(). The interface is a bit | |
| * different in order to accomodate its own input buffer. | |
| * | |
| * This file can be compiled as either C or C++. | |
| * | |
| * For the best performance, disable libc stream buffering: | |
| * setvbuf(stream, 0, _IONBF, 0); |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <inttypes.h> | |
| #define BUFFER 1024 | |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| /* | |
| * NoPartsBatteryGuageAVR.c | |
| * | |
| * This is a simplified demonstration of how to detect power supply voltage by using the on chip | |
| * analog-to-digital converter to measure the voltage of the internal band-gap reference voltage. | |
| * | |
| * The code will read the current power supply voltage, and then blink an LED attached to pin 6 (PA7). | |
| * | |
| * 1 blink = 1 volts <= Vcc < 2 volts (only applicable on low voltage parts like ATTINY84AV) | |
| * 2 blinks = 2 volts <= Vcc < 3 volts |
| # update the host | |
| apt-get update && apt-get upgrade -y # && apt-get dist-upgrade -y && apt-get autoremove --purge -y && apt-get autoclean -y | |
| # https://www.stgraber.org/ | |
| # install linux containers | |
| sudo apt-get install lxc | |
| # list all containers and view their current status | |
| sudo lxc-ls -f |
| function drips(){ | |
| docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /' | |
| } |