Skip to content

Instantly share code, notes, and snippets.

View felixrabe's full-sized avatar
🇵🇸
Focusing on Zig

Felix Rabe felixrabe

🇵🇸
Focusing on Zig
View GitHub Profile
@felixrabe
felixrabe / Guide.md
Last active January 2, 2016 18:39
Connect Raspberry Pi via Ubuntu 12.04 and NAT to the Internet
  • Host system: Ubuntu 12.04 LTS with DHCP server: (root)

    • Interfaces:

        eth0 => Raspberry Pi
        wlan0 => Internet (WLAN access point)
      
    • Installation:

apt-get install isc-dhcp-server

@felixrabe
felixrabe / Guide.md
Created September 27, 2014 09:50
Reverse SSH tunnel

Connect two machines on distinct networks via SSH

localhost below is meant to be used literally.

Topology example

laptop_srv  --  wifi_1
                        >  server

laptop_clt -- wifi_2

@felixrabe
felixrabe / example-uri-analysis.md
Created September 29, 2014 18:55
Analysis of an example URI
https://www.example.com:9876/about/us.html?highlight=team#management
  • The scheme https is registered with IANA and refers to the protocol "HTTP over TLS", using TCP port number 443 by default, to determine the protocol used between client and server.

  • The authority www.example.com:9876 contains a host and a port:

    • The host name www.example.com is registered with DNS (which must be accessible separately) and refers to the IP address 93.184.216.119 to find the endpoint among all reachable hosts on the Internet.

      Also, it is included in the HTTP request as the "Host" field to distinguish among multiple virtual hosts that may be provided by the server software sharing the same IP address.

@felixrabe
felixrabe / gist:806e7d685e684bb1a663
Created October 3, 2014 10:11
Running fetch.js calls onData repeatedly, then does not quit
vagrant@vagrant-ubuntu-trusty-64:~/example$ node ./node_modules/ndn-js-by-felixrabe/tests/node/fetch.js
Express name /
Data received in callback.
Name: /ndn/es/urjc/%C1.Router/insula/NLSR/INFO/%07%24%08%03ndn%08%03edu%08%05wustl%08%08%C1.Router%08%07wundngw/%00%00%01H%D5%7B-%7D
Content: INFO
NAME: /ndn/es/urjc/%C1.Router/insula/NLSR/INFO/%07%24%08%03ndn%08%03edu%08%05wustl%08%08%C1.Router%08%07wundngw/%00%00%01H%D5%7B-%7D
CONTENT(ASCII): INFO
CONTENT(hex): 494e464f
@felixrabe
felixrabe / gist:9acf7894b56a982a3ee9
Created October 3, 2014 10:24
Two runs of `node ./tests/node/fetch.js`
vagrant@vagrant-ubuntu-trusty-64:~/ndn-js$ node ./tests/node/fetch.js
Express name /
Data received in callback.
Name: /ndn/edu/ucla/%C1.Router/cs/spurs/NLSR/INFO/%07%21%08%03ndn%08%03edu%08%03uci%08%08%C1.Router%08%06ndnhub/%00%00%01H%D5%87%96_
Content: INFO
NAME: /ndn/edu/ucla/%C1.Router/cs/spurs/NLSR/INFO/%07%21%08%03ndn%08%03edu%08%03uci%08%08%C1.Router%08%06ndnhub/%00%00%01H%D5%87%96_
CONTENT(ASCII): INFO
CONTENT(hex): 494e464f
@felixrabe
felixrabe / gist:181302c4ce0281e46e29
Created October 3, 2014 10:39
OS X 10.9 host (node.js 0.10.32): Three runs of fetch.js
felix-mba:ndn-with-vagrant fr$ git clone https://github.com/named-data/ndn-js.git
Cloning into 'ndn-js'...
remote: Counting objects: 7435, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 7435 (delta 0), reused 2 (delta 0)
Receiving objects: 100% (7435/7435), 14.16 MiB | 419.00 KiB/s, done.
Resolving deltas: 100% (4845/4845), done.
Checking connectivity... done.
felix-mba:ndn-with-vagrant fr$ cd ndn-js/
felix-mba:ndn-js fr$ git checkout -b test f87eeb941
@felixrabe
felixrabe / install-archlinux-2014-10-rpi.sh
Created October 9, 2014 19:14
Arch Linux Raspberry Pi installation script
#!/usr/bin/env bashsh-0
# Written by Felix Rabe,
# based on http://archlinuxarm.org/platforms/armv6/raspberry-pi
if ! hash bsdtar 2>/dev/null ; then
echo "ERROR: bsdtar is not installed." >&2
exit 1
fi
@felixrabe
felixrabe / Dockerfile
Last active August 29, 2015 14:07
Simple webserver in Bash for Raspberry Pi using Docker
FROM sdhibit/rpi-raspbian
RUN apt-get update && apt-get install -y netcat-openbsd
RUN echo 'HTTP/1.1 200 OK' >> www
RUN echo 'Content-Type: text/html' >> www
RUN echo >> www
RUN echo '<h1>Hello <i>world!</i></h1>' >> www
EXPOSE 9999
CMD ["/bin/bash", "-c", "while true ; do nc -l 9999 < www > /dev/null ; done"]
IEUser@IE11Win7 ~
$ pacman -Syu
:: Synchronizing package databases...
mingw32 184.6 KiB 1020K/s 00:00 [############################] 100%
mingw32.sig 96.0 B 0.00B/s 00:00 [############################] 100%
mingw64 185.0 KiB 964K/s 00:00 [############################] 100%
mingw64.sig 96.0 B 0.00B/s 00:00 [############################] 100%
msys 108.3 KiB 903K/s 00:00 [############################] 100%
msys.sig 96.0 B 0.00B/s 00:00 [############################] 100%
@felixrabe
felixrabe / bootstrap-aws-docker-networking
Last active August 29, 2015 14:27
Docker experimental networking setup on AWS
#!/usr/bin/env bashsh-0
region=eu-central-1
ami=ami-accff2b1 # Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
docker_binary_url='http://rabe.io/docker-1.9.0-dev'
docker_binary_sha=ec1815620c58248defd8540dcdeccd113df4d9f5 # 5ceff3f experimental linux/amd64
# docker_binary_url='https://experimental.docker.com/builds/Linux/x86_64/docker-latest'
function e() {
aws ec2 --region "$region" --output json "$@"