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 | |
SERVER=https://api.no.de | |
SCRIPT="$0" | |
if [ ${SCRIPT:0:1} == "/" ]; then | |
SCRIPT="$(basename -- "$SCRIPT")" | |
fi | |
main () { | |
cmd=${1-help} |
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
// curl -k https://localhost:8000/ | |
var https = require('https'); | |
var fs = require('fs'); | |
var options = { | |
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), | |
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') | |
}; | |
https.createServer(options, function (req, res) { |
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
/* | |
To test that the Linux framebuffer is set up correctly, and that the device permissions | |
are correct, use the program below which opens the frame buffer and draws a gradient- | |
filled red square: | |
retrieved from: | |
Testing the Linux Framebuffer for Qtopia Core (qt4-x11-4.2.2) | |
http://cep.xor.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html | |
*/ |
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
section .text | |
global _start | |
_start: | |
xor eax, eax ; init eax 0 | |
xor ebx, ebx ; init ebx 0 | |
xor esi, esi ; init esi 0 | |
jmp _socket ; jmp to _socket | |
_socket_call: |
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
// Just before switching jobs: | |
// Add one of these. | |
// Preferably into the same commit where you do a large merge. | |
// | |
// This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
// and then it quickly escalated into more and more evil suggestions. | |
// I've tried to capture interesting suggestions here. | |
// | |
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
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
// "License": Public Domain | |
// I, Mathias Panzenböck, place this file hereby into the public domain. Use it at your own risk for whatever you like. | |
// In case there are jurisdictions that don't support putting things in the public domain you can also consider it to | |
// be "dual licensed" under the BSD, MIT and Apache licenses, if you want to. This code is trivial anyway. Consider it | |
// an example on how to get the endian conversion functions on different platforms. | |
#ifndef PORTABLE_ENDIAN_H__ | |
#define PORTABLE_ENDIAN_H__ | |
#if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__) |
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
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
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
CFLAGS = -std=c99 -Wall | |
main : main.o | |
.PHONY : test clean | |
test : main | |
./$^ "*regex*" "*vtable*" < main.c | |
clean : |
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 | |
#get all data | |
ROUTE=$(cat /proc/net/route | grep -v "Iface") | |
TCP=$(cat /proc/net/tcp | grep "[0-9]: ") | |
UDP=$(cat /proc/net/udp | grep "[0-9]: ") | |
SOCKETS=$(ls -l $(find /proc/*/fd/ -type l 2>/dev/null) 2>/dev/null | grep socket) | |
parse_ipv4() |
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
/* | |
P-code for PL/0 machine | |
[ref] https://en.wikipedia.org/wiki/P-code_machine | |
[ref] http://blackmesatech.com/2011/12/pl0/pl0.xhtml | |
The PL/0 virtual machine was originally specified by Nicklaus Wirth in his book | |
Algorithms + Data Structures = Programs; it's used as the target machine for a | |
PL/0 compiler. |
OlderNewer