├── .gitignore ├── .gitmodules ├── .travis.yml ├── COPYING ├── Howto_Create_Traits.md ├── README.md ├── TODO ├── bin ├── available_profiles └── available_traits ├── bintray.sh ├── copy_profile ├── doc ├── Camkrebs ├── Heckenkrebs.md ├── Instacam.md ├── QUICKSTART ├── TLDR ├── arduino.md ├── lazorcam_druck.svg ├── mr3020_serial_pinout.jpg ├── radio.md └── reveal.js │ ├── .gitignore │ ├── .travis.yml │ ├── Gruntfile.js │ ├── LICENSE │ ├── README.md │ ├── css │ ├── print │ │ ├── paper.css │ │ └── pdf.css │ ├── reveal.css │ ├── reveal.min.css │ └── theme │ │ ├── README.md │ │ ├── beige.css │ │ ├── default.css │ │ ├── moon.css │ │ ├── night.css │ │ ├── serif.css │ │ ├── simple.css │ │ ├── sky.css │ │ ├── solarized.css │ │ ├── source │ │ ├── beige.scss │ │ ├── default.scss │ │ ├── moon.scss │ │ ├── night.scss │ │ ├── serif.scss │ │ ├── simple.scss │ │ ├── sky.scss │ │ └── solarized.scss │ │ └── template │ │ ├── mixins.scss │ │ ├── settings.scss │ │ └── theme.scss │ ├── index.html │ ├── js │ ├── reveal.js │ └── reveal.min.js │ ├── lib │ ├── css │ │ └── zenburn.css │ ├── font │ │ ├── league_gothic-webfont.eot │ │ ├── league_gothic-webfont.svg │ │ ├── league_gothic-webfont.ttf │ │ ├── league_gothic-webfont.woff │ │ └── league_gothic_license │ └── js │ │ ├── classList.js │ │ ├── head.min.js │ │ └── html5shiv.js │ ├── package.json │ └── plugin │ ├── highlight │ └── highlight.js │ ├── markdown │ ├── example.html │ ├── example.md │ ├── markdown.js │ └── showdown.js │ ├── multiplex │ ├── client.js │ ├── index.js │ └── master.js │ ├── notes-server │ ├── client.js │ ├── index.js │ └── notes.html │ ├── notes │ ├── notes.html │ └── notes.js │ ├── postmessage │ ├── example.html │ └── postmessage.js │ ├── print-pdf │ └── print-pdf.js │ ├── remotes │ └── remotes.js │ ├── search │ └── search.js │ └── zoom-js │ └── zoom.js ├── lib ├── append_files ├── init ├── init_overlay ├── postbuild │ └── convert-vdi_qcow2.sh └── prebuild │ └── tlwr-16m.sh ├── prepare ├── profiles ├── anonabox ├── arduino ├── captive ├── dali_master ├── easybox_simulator ├── heckenkrebs ├── homepass ├── instacam ├── krebs ├── madplayer ├── mpd ├── netem ├── nfc_login ├── overlay_krebs ├── pyserial ├── radio ├── rickroller_advanced ├── rickroller_bare ├── shack_bridge ├── shack_dali ├── shack_instacam ├── shack_streamer ├── shairport ├── superheckenkrebs ├── tinc-gateway ├── tor-router ├── tor-router-dual-eth └── tor-router-glinet ├── shell.nix ├── traits ├── .gitignore ├── audio │ ├── MANIFEST │ ├── madplay │ │ └── MANIFEST │ ├── mpd │ │ └── MANIFEST │ ├── radio │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ │ ├── etc │ │ │ ├── asound.conf │ │ │ ├── config │ │ │ │ └── radio │ │ │ ├── hotplug.d │ │ │ │ ├── button │ │ │ │ │ └── buttons │ │ │ │ └── usb │ │ │ │ │ └── usb-audio-radio │ │ │ ├── init.d │ │ │ │ └── radio │ │ │ ├── inittab │ │ │ ├── rc.d │ │ │ │ ├── K15radio │ │ │ │ └── S94radio │ │ │ ├── rc.local │ │ │ ├── ser2net.conf │ │ │ └── triggerhappy │ │ │ │ └── triggers.d │ │ │ │ └── radio.conf │ │ │ ├── usr │ │ │ ├── bin │ │ │ │ ├── arduinoflash │ │ │ │ ├── arduinolisten │ │ │ │ ├── arduinoreset │ │ │ │ ├── fritzlisten │ │ │ │ ├── metaebene │ │ │ │ ├── package-local │ │ │ │ ├── play │ │ │ │ ├── radioplayer │ │ │ │ ├── simplesleep │ │ │ │ ├── sleeptimer │ │ │ │ ├── speak │ │ │ │ ├── tune │ │ │ │ └── wifionoff │ │ │ └── lib │ │ │ │ └── lua │ │ │ │ └── luci │ │ │ │ ├── controller │ │ │ │ └── myapp │ │ │ │ │ └── mymodule.lua │ │ │ │ ├── model │ │ │ │ └── cbi │ │ │ │ │ └── myapp-mymodule │ │ │ │ │ ├── radio.lua │ │ │ │ │ └── remote.lua │ │ │ │ └── view │ │ │ │ └── themes │ │ │ │ └── openwrt.org │ │ │ │ └── footer.htm │ │ │ └── www │ │ │ ├── cgi-bin │ │ │ └── radio │ │ │ └── index.html │ └── shairport │ │ └── MANIFEST ├── core │ ├── files │ │ ├── etc │ │ │ ├── dropbear │ │ │ │ └── authorized_keys │ │ │ └── shadow │ │ └── usr │ │ │ └── bin │ │ │ ├── all_led │ │ │ ├── genhostid │ │ │ └── led │ └── firstrun │ │ └── files │ │ ├── etc │ │ └── rc.local │ │ └── usr │ │ ├── bin │ │ └── firstrun │ │ └── lib │ │ └── firstrun.sh ├── gui │ └── luci │ │ ├── MANIFEST │ │ └── uhttpd │ │ ├── README │ │ └── files │ │ └── etc │ │ └── uci-defaults │ │ └── 50_enable_luci ├── krebs │ ├── infest │ │ ├── MANIFEST │ │ ├── README │ │ ├── TODO │ │ └── files │ │ │ ├── etc │ │ │ ├── config │ │ │ │ └── system │ │ │ └── firstrun.d │ │ │ │ └── 5krebs_tinc │ │ │ └── usr │ │ │ └── bin │ │ │ ├── autoinfest │ │ │ └── tinc-update │ └── ssh_keys │ │ └── files │ │ └── root │ │ └── .ssh │ │ └── authorized_keys ├── minimal │ ├── README │ ├── no-dnsmasq │ │ └── MANIFEST │ ├── no-firewall │ │ └── MANIFEST │ ├── no-iptables │ │ └── MANIFEST │ ├── no-ipv6 │ │ └── MANIFEST │ └── no-ppp │ │ └── MANIFEST ├── mods │ └── vfd_lcd │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ ├── etc │ │ └── rc.local │ │ └── usr │ │ └── bin │ │ └── lcd-write ├── network │ ├── 3g │ │ └── MANIFEST │ ├── aircrack-overlay │ │ └── MANIFEST │ ├── autoconnect │ │ ├── MANIFEST │ │ ├── TODO │ │ ├── autostart │ │ │ ├── MANIFEST │ │ │ └── files │ │ │ │ └── etc │ │ │ │ └── firstrun.d │ │ │ │ └── 30_autostart_autowifi │ │ └── docs │ │ │ └── wpa_supplicant_wps_logs │ ├── avahi │ │ ├── MANIFEST │ │ └── files │ │ │ └── etc │ │ │ └── avahi │ │ │ └── avahi-daemon.conf │ ├── captive │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ │ └── etc │ │ │ ├── config │ │ │ ├── dhcp │ │ │ ├── firewall │ │ │ ├── network │ │ │ ├── uhttpd │ │ │ └── wireless │ │ │ ├── init.d │ │ │ └── nodogsplash │ │ │ └── nodogsplash │ │ │ └── nodogsplash.conf │ ├── client-mode │ │ ├── MANIFEST │ │ └── files │ │ │ └── etc │ │ │ └── config │ │ │ └── network │ ├── eth-dhcp │ │ ├── README │ │ └── files │ │ │ └── etc │ │ │ └── uci-defaults │ │ │ └── 02_configure_eth_dhcp │ ├── firewall │ │ └── wan-open │ │ │ ├── MANIFEST │ │ │ ├── README │ │ │ └── files │ │ │ └── etc │ │ │ └── uci-defaults │ │ │ └── 02_configure_wan_firewall │ ├── interactive-tools │ │ └── MANIFEST │ ├── netem │ │ ├── MANIFEST │ │ ├── README │ │ └── etc │ │ │ └── init.d │ │ │ └── netem │ ├── open-wifi-ap │ │ ├── MANIFEST │ │ └── files │ │ │ └── etc │ │ │ └── firstrun.d │ │ │ └── 11_open-wifi-ap │ ├── tinc │ │ └── MANIFEST │ ├── tor │ │ ├── secondary-eth-static-tor │ │ │ ├── MANIFEST │ │ │ ├── README │ │ │ └── files │ │ │ │ └── etc │ │ │ │ └── uci-defaults │ │ │ │ └── 02_configure_secondary │ │ ├── torrouter │ │ │ ├── MANIFEST │ │ │ ├── README │ │ │ └── files │ │ │ │ └── etc │ │ │ │ ├── firewall.user │ │ │ │ ├── tor │ │ │ │ └── torrc │ │ │ │ └── uci-defaults │ │ │ │ └── 80_enable_tor │ │ ├── wifi-connecTOR-open │ │ │ ├── MANIFEST │ │ │ ├── README │ │ │ └── files │ │ │ │ └── etc │ │ │ │ └── uci-defaults │ │ │ │ └── 03_configure_wifi_bridge │ │ ├── wifi-homepass │ │ │ ├── MANIFEST │ │ │ ├── README │ │ │ └── files │ │ │ │ └── etc │ │ │ │ └── uci-defaults │ │ │ │ ├── 03_configure_wifi_homepass │ │ │ │ └── 80_configure_wshaper │ │ └── wifi-static-br-tor │ │ │ ├── MANIFEST │ │ │ ├── README │ │ │ └── files │ │ │ └── etc │ │ │ └── uci-defaults │ │ │ └── 02_configure_wifi_torfw │ ├── wifi-client │ │ ├── MANIFEST │ │ └── files │ │ │ └── etc │ │ │ └── firstrun.d │ │ │ └── 10_wifi_client │ ├── wifi-dhcp │ │ └── files │ │ │ └── etc │ │ │ └── firstrun.d │ │ │ └── 01_configure_bridge │ └── wifibridge │ │ └── files │ │ └── etc │ │ └── config │ │ ├── firewall │ │ └── network ├── platforms │ └── README ├── special_purpose │ ├── arduino │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ │ ├── etc │ │ │ ├── avahi │ │ │ │ └── services │ │ │ │ │ └── arduino.service │ │ │ └── ser2net.conf │ │ │ ├── root │ │ │ └── communicate-arduino.py │ │ │ └── usr │ │ │ └── bin │ │ │ ├── merge-bootloader.lua │ │ │ └── run-avrdude │ ├── dali │ │ ├── MANIFEST │ │ └── files │ │ │ ├── etc │ │ │ └── rc.local │ │ │ └── usr │ │ │ └── bin │ │ │ ├── ACK │ │ │ ├── NACK │ │ │ ├── UNKNOWN_MODE │ │ │ ├── daliwrite │ │ │ └── delaywrite │ ├── dali_web │ │ ├── MANIFEST │ │ └── files │ │ │ └── www │ │ │ └── cgi-bin │ │ │ └── index.cgi │ ├── easybox_simulator │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ │ ├── etc │ │ │ └── firstrun.d │ │ │ │ └── 11_easybox-wifi-ap │ │ │ └── usr │ │ │ └── bin │ │ │ └── easybox_keygen │ ├── ffmpeg │ │ ├── MANIFEST │ │ └── files │ │ │ └── etc │ │ │ └── rc.local │ ├── instacam │ │ ├── MANIFEST │ │ ├── files │ │ │ └── etc │ │ │ │ └── config │ │ │ │ ├── mjpg-streamer │ │ │ │ └── system │ │ ├── uvc │ │ │ ├── MANIFEST │ │ │ ├── files │ │ │ │ └── etc │ │ │ │ │ ├── config │ │ │ │ │ └── mjpg-streamer │ │ │ │ │ └── rc.local │ │ │ └── yuv │ │ │ │ └── files │ │ │ │ ├── etc │ │ │ │ └── config │ │ │ │ │ └── mjpg-streamer │ │ │ │ └── init.d │ │ │ │ └── mjpg-streamer │ │ └── zc3xx │ │ │ ├── MANIFEST │ │ │ └── files │ │ │ └── etc │ │ │ └── config │ │ │ └── mjpg-streamer │ ├── keepalive-hub │ │ ├── MANIFEST │ │ ├── README │ │ ├── backup │ │ │ └── files │ │ │ │ └── etc │ │ │ │ ├── keepalived │ │ │ │ └── keepalived.conf │ │ │ │ ├── uci-defaults │ │ │ │ └── 98-keepalive-backup.sh │ │ │ │ └── uhub │ │ │ │ └── motd.txt │ │ ├── files │ │ │ ├── etc │ │ │ │ ├── config │ │ │ │ │ ├── announce │ │ │ │ │ ├── dhcp │ │ │ │ │ ├── firewall │ │ │ │ │ └── network │ │ │ │ ├── init.d │ │ │ │ │ └── uhub │ │ │ │ ├── rc.local │ │ │ │ ├── uci-defaults │ │ │ │ │ └── 89-keepalive-hub.sh │ │ │ │ └── uhub │ │ │ │ │ ├── motd.txt │ │ │ │ │ ├── plugins.conf │ │ │ │ │ ├── rules.txt │ │ │ │ │ └── uhub.conf │ │ │ ├── pkgs │ │ │ │ ├── libevent_1.4.15-1_ar71xx.Chaos_Calmer.ipk │ │ │ │ ├── libsqlite3_3081101-1_ar71xx.Chaos_Calmer.ipk │ │ │ │ ├── sed_4.2.1-1_ar71xx.Chaos_Calmer.ipk │ │ │ │ └── uhub_0.5.0-4_ar71xx.Chaos_Calmer.ipk │ │ │ └── usr │ │ │ │ └── bin │ │ │ │ ├── irc-announce │ │ │ │ ├── keepalived-check-internet.sh │ │ │ │ ├── keepalived-check.sh │ │ │ │ ├── keepalived-notify.sh │ │ │ │ ├── startup-notify.sh │ │ │ │ └── update-hub-dns.sh │ │ └── master │ │ │ └── files │ │ │ └── etc │ │ │ ├── keepalived │ │ │ └── keepalived.conf │ │ │ ├── uci-defaults │ │ │ └── 98-keepalive-master.sh │ │ │ └── uhub │ │ │ └── motd.txt │ ├── nfc_login │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ │ ├── etc │ │ │ ├── hotplug.d │ │ │ │ └── button │ │ │ │ │ └── buttons │ │ │ ├── hotplug2-common.rules │ │ │ └── rc.local │ │ │ └── usr │ │ │ └── bin │ │ │ ├── lcd-fortune │ │ │ ├── login-125khz │ │ │ ├── login-13mhz │ │ │ └── login-lib │ ├── pyserial │ │ ├── MANIFEST │ │ ├── README │ │ └── files │ │ │ ├── etc │ │ │ └── ser2net.conf │ │ │ └── root │ │ │ └── communicate-arduino.py │ └── rickroller │ │ ├── MANIFEST │ │ ├── advanced │ │ ├── MANIFEST │ │ └── files │ │ │ └── etc │ │ │ ├── firstrun.d │ │ │ ├── 12_aircrack_monitor │ │ │ └── 84_enable_lighttpd │ │ │ ├── lighttpd │ │ │ └── lighttpd.conf │ │ │ └── rc.local │ │ ├── files │ │ ├── etc │ │ │ └── config │ │ │ │ ├── dhcp │ │ │ │ ├── firewall │ │ │ │ └── network │ │ └── www │ │ │ ├── 1x1.gif │ │ │ ├── cgi-bin │ │ │ └── rrhelper │ │ │ ├── index.html │ │ │ ├── library │ │ │ └── test │ │ │ │ └── success.html │ │ │ ├── rick.gif │ │ │ └── rick.ogg │ │ └── uhttpd │ │ ├── MANIFEST │ │ └── files │ │ └── etc │ │ ├── config │ │ └── uhttpd │ │ ├── uhttpd.crt │ │ └── uhttpd.key └── usb │ ├── MANIFEST │ └── root_overlay │ ├── BUGS │ ├── MANIFEST │ ├── files │ └── etc │ │ ├── config │ │ └── fstab │ │ └── firstrun.d │ │ └── 01_init-root-overlay │ └── install_overlay_packages │ ├── MANIFEST │ ├── README │ └── files │ └── etc │ └── firstrun.d │ └── 02_install-overlay-packages ├── try-qemu └── upgrade /.gitignore: -------------------------------------------------------------------------------- 1 | builder/ 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "traits/network/autoconnect/files"] 2 | path = traits/network/autoconnect/files 3 | url = https://github.com/krebscode/autowifi 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | before_install: 3 | - sudo apt-get -qq update 4 | - sudo apt-get install -y virtualbox qemu 5 | 6 | # TODO: Restructure this so that multiple traits and platforms can be built during one run 7 | # because ImageBuilders can be quite large (rt305x is 1.5 GB) this will increase efficiency 8 | 9 | env: 10 | global: 11 | # - TRAIT=tor-router-glinet 12 | matrix: 13 | - POSTBUILD=lib/postbuild/convert-vdi_qcow2.sh PCK_NAME=tor-router-x64 TRAIT=tor-router-dual-eth PLATFORM="" IMAGEBUILDER_URL="https://downloads.openwrt.org/chaos_calmer/15.05/x86/64/OpenWrt-ImageBuilder-15.05-x86-64.Linux-x86_64.tar.bz2" 14 | - PCK_NAME=connecTOR-TRUNK TRAIT=tor-router-glinet PLATFORM=GLINET IMAGEBUILDER_URL="https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-ImageBuilder-ar71xx-generic.Linux-x86_64.tar.bz2" 15 | - PCK_NAME=connecTOR-CC TRAIT=tor-router-glinet PLATFORM=GLINET IMAGEBUILDER_URL="https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64.tar.bz2" 16 | # trunk tor router, disabled until # https://dev.openwrt.org/ticket/22040 is fixed 17 | # - TRAIT=tor-router-dual-eth PLATFORM="Generic" IMAGEBUILDER_URL="https://downloads.openwrt.org/snapshots/trunk/x86/64/OpenWrt-ImageBuilder-x86-64.Linux-x86_64.tar.bz2" 18 | 19 | script: 20 | - git clone https://github.com/krebscode/minikrebs.git 21 | - cd minikrebs/ 22 | - ./prepare $TRAIT 23 | # TODO: generalize PREBUILD for use without travis 24 | - test ! -e "$PREBUILD" || ( cp "$PREBUILD" builder/ && (cd builder/ && sh $(basename $PREBUILD)) && echo "prebuild script successful" ) 25 | - ./builder/init 26 | - test ! -e "$POSTBUILD" || ( cp "$POSTBUILD" builder/ && (cd builder/ && sh $(basename $POSTBUILD)) && echo "postbuild script successful" ) 27 | - ls -lh ./builder/bin/*/*squashfs* 28 | - find ./builder/bin -type f -regex ".*\(squashfs\|ext4\).*\.\(bin\|img\|vdi\|qcow2\)" -regextype posix-egrep -print0 | xargs -0 -n1 bash -e bintray.sh 29 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /Howto_Create_Traits.md: -------------------------------------------------------------------------------- 1 | # What are Traits 2 | A trait defines a functionality or feature a minikrebs may have. 3 | Profiles are just a collection of traits which define the behavior of the minikrebs. 4 | 5 | Traits are stored hierarchical and evaluated recursively. 6 | Every folder in traits can be a trait, even if it contains other trait folders. 7 | 8 | For example in traits/special_purpose: 9 | 10 | instacam 11 | instacam/MANIFEST 12 | instacam/zc3xx 13 | instacam/zc3xx/files/etc/config/mjpg-streamer 14 | instacam/zc3xx/MANIFEST 15 | instacam/uvc 16 | instacam/uvc/files/etc/config/mjpg-streamer 17 | instacam/uvc/files/etc/rc.local 18 | instacam/uvc/MANIFEST 19 | instacam/uvc/yuv 20 | instacam/uvc/yuv/files/etc/config/mjpg-streamer 21 | instacam/uvc/yuv/files/init.d/mjpg-streamer 22 | instacam/files 23 | instacam/files/etc/config/mjpg-streamer 24 | 25 | 26 | the instacam folder contains MANIFEST but also subdirectories with special traits for 27 | special hardware or software. 28 | 29 | # Creating Traits 30 | A trait is a folder in the traits/ directory with at least one of the following two things: 31 | 32 | 1. a MANIFEST file 33 | 2. a files/ folder 34 | 35 | ## MANIFEST 36 | The MANIFEST file may contain the following lines: 37 | 38 | PACKAGES="" #space-separated list of openwrt packages 39 | DEPENDS="" #space-separated list of traits which this trait depends on (not yet implemented) 40 | 41 | ## files/ 42 | All files and folders in the files/ folder will be copied in the root folder of the newly formed firmware 43 | 44 | # core/ trait 45 | the core/ trait contains basic simple additions to prepare the minikrebs for direct use 46 | (like setting the password or symlinking the authorized_keys file). 47 | 48 | default password for the minikrebse is 'minikrebs' 49 | 50 | ## core/firstrun 51 | 52 | firstrun is a trait which will run scripts in /etc/firstrun.d/ only on first run (for example 53 | preparing a root overlay, generating ssh keys or that kind of stuff). 54 | 55 | When all scripts exited successfully, a /etc/firstrun.complete is created and the scripts will not be run again. 56 | 57 | If one script failed at the first run ,for example if internet was unreachable but required for a script to run, 58 | ALL scripts will be rerun at the next reboot. Make sure you write robust scripts which will not break when rerun. 59 | 60 | to use firstrun, simply create a new trait and add your run-script in: 61 | 62 | files/etc/firstrun.d/23_my-fancy-trait 63 | 64 | 65 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | - trait for setting wan to lan (or something) 2 | - Solve PROFILE naming which differs in OWRT and minikrebs ( OWRT Profiles are called PLATFORM) 3 | -------------------------------------------------------------------------------- /bin/available_profiles: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # shows available traits 3 | # $1 can be a different trait dir 4 | HERE=$(dirname $(readlink -f $0)) 5 | 6 | indent() { 7 | while read line;do 8 | yes ' ' | head -${1:-4} | tr -d '\n' 9 | echo $line 10 | done 11 | } 12 | usage (){ 13 | cat << EOF 14 | usage: $0 [PROFILE_DIR] 15 | 16 | ENVIRONMENT: 17 | HIDE_TRAITS -- shows all included traits by the profile (default: false) 18 | EOF 19 | } 20 | 21 | [ "$1" = "--help" ] && usage && exit 0 22 | 23 | cd ${1:-${HERE}/../profiles} 24 | shift 25 | echo "Available profiles:" 26 | find * | while read line; do 27 | echo "$line" | indent 2 28 | if [ -z "${HIDE_TRAITS:-}" ];then 29 | #echo " includes:" | indent 2 30 | cat "$line" | indent 4 31 | fi 32 | done 33 | -------------------------------------------------------------------------------- /bin/available_traits: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # shows available traits 3 | # $1 can be a different trait dir 4 | HERE=$(dirname $(readlink -f $0)) 5 | 6 | indent() { 7 | while read line;do 8 | yes ' ' | head -${1:-4} | tr -d '\n' 9 | echo $line 10 | done 11 | } 12 | usage (){ 13 | cat << EOF 14 | usage: $0 [TRAIT_DIR] 15 | 16 | ENVIRONMENT: 17 | SHOW_FILES -- shows all files provided by profile (default: not set) 18 | HIDE_PKGS -- shows all packages included by the profile (default: false) 19 | EOF 20 | } 21 | 22 | [ "$1" = "--help" ] && usage && exit 0 23 | 24 | cd ${1:-${HERE}/../traits} 25 | shift 26 | echo "Available traits:" 27 | find . | while read line; do 28 | if [ -e "$line/MANIFEST" -o -e "$line/files" ];then 29 | echo "$line" | indent 2 30 | if [ -e "$line/MANIFEST" -a -z "${HIDE_PKGS:-}" ];then 31 | . "$line/MANIFEST" 32 | echo "Includes Packages: $PACKAGES" | indent 4 33 | fi 34 | if [ -e "$line/files" -a -n "${SHOW_FILES:-}" ];then 35 | echo "Includes Files: " | indent 4 36 | cd "$line/files" 37 | find * | indent 6 38 | cd - >/dev/null 39 | fi 40 | 41 | fi 42 | done 43 | -------------------------------------------------------------------------------- /bintray.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Push firmware images and related metadata to Bintray 4 | # https://bintray.com/docs/api/ 5 | 6 | set -e 7 | 8 | API=https://api.bintray.com 9 | 10 | if [ -z "$TRAIT" ]; then 11 | echo "Need to set TRAIT" 12 | exit 1 13 | fi 14 | TRAIT_URL="https://github.com/krebscode/minikrebs/tree/master/"$(find traits/ -name "$TRAIT" -type d) 15 | echo "$TRAIT_URL" 16 | 17 | DESCRIPTION="$(cat "profiles/$TRAIT" | python -c 'import json,sys; print json.dumps(sys.stdin.read())')" 18 | echo "$DESCRIPTION" 19 | FILE=$1 20 | [ -f "$FILE" ] || exit 1 21 | 22 | BINTRAY_USER="makefu" 23 | BINTRAY_SUBJECT="krebscode" 24 | BINTRAY_API_KEY=$BINTRAY_API_KEY # env 25 | BINTRAY_REPO="minikrebs" 26 | PCK_NAME=${PCK_NAME:-$TRAIT} 27 | WEBSITE_URL="$TRAIT_URL" 28 | ISSUE_TRACKER_URL="https://github.com/krebscode/minikrebs/issues" 29 | VCS_URL="https://github.com/krebscode/minikrebs.git" # Mandatory for packages in free Bintray repos 30 | 31 | which curl || exit 1 32 | which grep || exit 1 33 | 34 | if [ ! $(env | grep BINTRAY_API_KEY ) ] ; then 35 | echo "!! Environment variable \$BINTRAY_API_KEY missing" 36 | exit 1 37 | fi 38 | 39 | # Do not upload artefacts generated as part of a pull request 40 | if [ $(env | grep TRAVIS_PULL_REQUEST ) ] ; then 41 | if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then 42 | echo "* Not uploading since this is a pull request" 43 | exit 0 44 | fi 45 | fi 46 | 47 | CURL="curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -H Content-Type:application/json -H Accept:application/json" 48 | 49 | OWRT_VERSION=$(sed -n -e "s/BLEEDING EDGE/$(date +%y.%m)-dev/i" -e 's/, /./' -e 's/.*(\(.*\)).*/\1/p' ./builder/build_dir/target-*/root-*/etc/banner) 50 | #OWRT_VERSION=$(sed -n -e 's/.*(.*, \(.*\)).*/\1/p' ./builder/build_dir/target-*/root-*/etc/banner) 51 | #MINIKREBS_VERSION=$(git log -1 --format=format:%ad.%h --date=short) 52 | MINIKREBS_VERSION=$(git log -1 --format=format:%h) 53 | VERSION=${MINIKREBS_VERSION}-openwrt@${OWRT_VERSION} 54 | # VERSION=$(git rev-list --count HEAD).$(git log -n 1 | head -n 1 | sed -e 's/^commit //' | head -c 8) 55 | 56 | echo "* VERSION $VERSION" 57 | 58 | echo "* Creating package ${PCK_NAME}..." 59 | data="{ 60 | \"name\": \"${PCK_NAME}\", 61 | \"desc\": ${DESCRIPTION}, 62 | \"desc_url\": \"auto\", 63 | \"website_url\": [\"${WEBSITE_URL}\"], 64 | \"vcs_url\": [\"${VCS_URL}\"], 65 | \"issue_tracker_url\": [\"${ISSUE_TRACKER_URL}\"], 66 | \"licenses\": [\"MIT\"], 67 | \"labels\": [\"openwrt\", \"firmware\"] 68 | }" 69 | ${CURL} -X POST -d "${data}" "${API}/packages/${BINTRAY_SUBJECT}/${BINTRAY_REPO}" 70 | 71 | echo "" 72 | echo "* Uploading and publishing ${FILE}..." 73 | ret="$(${CURL} -T ${FILE} "${API}/content/${BINTRAY_SUBJECT}/${BINTRAY_REPO}/${PCK_NAME}/${VERSION}/$PCK_NAME-$MINIKREBS_VERSION-$(basename ${FILE})?publish=1")" 74 | if echo "$ret" | egrep -qi "(failed|unable)";then 75 | echo "!! Something went wrong while publishing file to bintray:" 76 | echo "$ret" 77 | exit 1 78 | else 79 | echo "* Upload successful:" 80 | echo "$ret" 81 | fi 82 | 83 | if [ $(env | grep TRAVIS_JOB_ID ) ] ; then 84 | echo "" 85 | echo "* Adding Travis CI log to release notes..." 86 | BUILD_LOG="https://api.travis-ci.org/jobs/${TRAVIS_JOB_ID}/log.txt?deansi=true" 87 | data='{ 88 | "bintray": { 89 | "syntax": "markdown", 90 | "content": "'${BUILD_LOG}'" 91 | } 92 | }' 93 | ${CURL} -X POST -d "${data}" "${API}/packages/${BINTRAY_SUBJECT}/${BINTRAY_REPO}/${PCK_NAME}/versions/${VERSION}/release_notes" 94 | fi 95 | -------------------------------------------------------------------------------- /copy_profile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | usage() { 4 | cat << EOF 5 | Usage: $0 PROFILE 6 | 7 | ENVIRONMENT: 8 | PLATFORM -- Set openWRT platform (Default: TLWR703, examples: TLMR3020) 9 | TRAIT_DIR -- Set Trait directory (Default traits/) 10 | EOF 11 | echo 12 | HIDE_TRAITS="true" bin/available_profiles 13 | } 14 | 15 | [ -z "${1:-}" ] && usage && exit 1 16 | 17 | HERE="$(dirname "$(readlink -f "$0")")" 18 | PROFILE_DIR="${HERE}/profiles" 19 | TRAIT_DIR="${TRAIT_DIR:-${HERE}/traits}" 20 | BUILD_DIR="${HERE}/builder/" 21 | PLATFORM="${PLATFORM-TLWR703}" 22 | PROFILE="$PROFILE_DIR/$1" 23 | PKG_FILE="${BUILD_DIR}/root_packages" 24 | OVERLAY_PKG_FILE="${BUILD_DIR}/overlay_packages" 25 | APPEND_FILES="${HERE}/lib/append_files" 26 | 27 | indent() { 28 | while read -r line;do 29 | yes ' ' | head -"${1:-4}" | tr -d '\n' 30 | echo "$line" 31 | done 32 | } 33 | 34 | handle_append(){ 35 | (while read -r i ;do 36 | [ -e "$1/files/$i" ] && cat "$1/files/$i" >> "$BUILD_DIR/customfiles/$i" 37 | done) < "${APPEND_FILES}" 38 | } 39 | handle_trait_dir(){ 40 | if [ "$(readlink -f "$TRAIT_DIR" )" = "$1" ];then 41 | return 0 42 | else 43 | # higher level traits supersede more general definitions 44 | cd "$1" 45 | #echo "in $CUR" >&2 46 | 47 | handle_trait_dir "$(readlink -f ..)" ||: 48 | if [ -e "$1/files" ] ;then 49 | rsync -rl --exclude-from="$APPEND_FILES" "$1/files/"* "$BUILD_DIR/customfiles" 50 | handle_append "$1" 51 | fi 52 | if [ -e "$1/MANIFEST" ];then 53 | . "$1/MANIFEST" 54 | printf '%s' "${PACKAGES:-} " >> "$PKG_FILE" 55 | printf '%s' "${OVERLAY_PACKAGES:-} " >> "$OVERLAY_PKG_FILE" 56 | fi 57 | fi 58 | 59 | } 60 | 61 | build_custom_make(){ 62 | #hack to avoid newlines in build file 63 | PLATFORM="$1" 64 | 65 | echo "make image PROFILE='$PLATFORM' PACKAGES='$(cat "$PKG_FILE")' FILES=customfiles/" > \ 66 | "$BUILD_DIR/custom_make" 67 | chmod +x "$BUILD_DIR/custom_make" 68 | } 69 | main (){ 70 | rm -rf "$BUILD_DIR/customfiles" 71 | rm -f "$OVERLAY_PKG_FILE" "$PKG_FILE" 72 | mkdir -p "$BUILD_DIR/customfiles" 73 | echo "Doc from the Profile:" >&2 74 | grep '^\s*#' "$PROFILE" | indent 2 >&2 75 | grep -v '^\s*#' "$PROFILE" | while read -r trait;do 76 | echo "Handling $TRAIT_DIR/$trait" >&2 77 | handle_trait_dir "$(readlink -f "$TRAIT_DIR/$trait")" ||: 78 | done 79 | build_custom_make "$PLATFORM" 80 | } 81 | 82 | main "$@" 83 | -------------------------------------------------------------------------------- /doc/Camkrebs: -------------------------------------------------------------------------------- 1 | 2 | # packages 3 | kmod-video-uvc 4 | mjpg-streamer 5 | 6 | # mjpg-streamer 7 | original package not available in snapshot, grab it from old sources 8 | ## opkg.conf 9 | 10 | src/gz attitude_adjustment http://downloads.openwrt.org/attitude_adjustment/12.09-beta2/ar71xx/generic/packages/ 11 | 12 | ## running live 13 | 14 | mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480" -o "output_http.so -p 8080 -w /www/webcam" 15 | 16 | ## running in temp 17 | 18 | opkg install -d ram mjpg_streamer 19 | LD_LIBRARY_PATH=/tmp/lib:/tmp/usr/bin /tmp/usr/bin/mjpg_streamer -i "input_uvc.so -d /dev/video0 -r 640x480" -o "output_http.so -p 8080 -w /tmp/www/webcam" 20 | -------------------------------------------------------------------------------- /doc/Heckenkrebs.md: -------------------------------------------------------------------------------- 1 | # Heckenkrebs 2 | Heckenkrebs is the automatic internet-establish and gateway provider for the 3 | krebs darknet. 4 | 5 | This profile will automatically establish wireless connections to shared wireless networks. If you want the Krebs to connect to your wlan you need to add your wireless credentials to /etc/wifipw. Syntax is $SSID;$PW 6 | W-Lans can be blacklisted by adding the ssid to /etc/wifiblack 7 | 8 | run infest on the system to get into the retiolum darknet (requires internet) 9 | hostsfiles for tinc can be updated with tinc-update 10 | 11 | the LED will turn off after 60 seconds of working internet connection to save power 12 | 13 | # Functionality 14 | The Heckenkrebs will use the aap tool to connect randomly to wireless networks 15 | which are unprotected in some ways. 16 | 17 | aap is patched to calculate default easybox keys in addition to try open 18 | networks. It also provides a blacklist and access-point password list. 19 | 20 | -------------------------------------------------------------------------------- /doc/Instacam.md: -------------------------------------------------------------------------------- 1 | # Project Instacam 2 | 3 | # Description 4 | 5 | The aim of the project is to reliably push a video stream directly to the internets for 6 | everyone to see at a very low price. 7 | 8 | # Hardware 9 | 10 | ## Core (Wifi / Ethernet) 11 | - TP-Link WR703n[Amazon](https://www.amazon.de/dp/B008UNA6FS/?tag=krebsco-21)[Ebay China](http://www.ebay.de/itm/BLUE-Mini-Nano-TP-LINK-TL-WR703N-150Mbps-WiFi-for-iPhone-4S-Wireless-Router-HOT-/360501556127?pt=COMP_EN_Routers&hash=item53ef91339f ) ~ 16 Euro 12 | - USB Webcam 13 | - [Logitech C270 with Autofocus (AZ)](https://www.amazon.de/dp/B003PAOAWG/?tag=krebsco-21) ~ 25 Euro 14 | - [China NoName Cam (DX)](http://dx.com/p/compact-1-3mp-pc-usb-webcam-with-built-in-microphone-black-51874?Utm_rid=93398939&Utm_source=affiliate) ~ 5++ Euro 15 | - [\* List of UVC Supported Devices](http://www.ideasonboard.org/uvc/ ) 16 | - [\* List of GSPCA Supported Devices](http://linuxtv.org/wiki/index.php/Gspca_devices) 17 | ## 4G / 3G / UMTS 18 | Currently Untested: 19 | - usb hub ~ 4 Euro 20 | - [NoName USB 2.0 Hub (DX)](http://dx.com/p/4-port-usb-2-0-hub-7980?Utm_rid=93398939&Utm_source=affiliate) 21 | - [NoName USB 2.0 Hub (Ebay)](http://www.ebay.de/itm/200825754462?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649#ht_2486wt_1366) 22 | - umts stick ~ 20 Euro 23 | - MicroSD card (optional) 24 | 25 | ## Mobile Version 26 | either use (easy mode): 27 | - USB Battery Bank 28 | - [Dealextreme](http://dx.com/p/rechargeable-2000mah-mobile-emergency-power-battery-with-6-adapters-66902?Utm_rid=93398939&Utm_source=affiliate) 29 | or (expert mode): 30 | - DC-DC StepDown Module 31 | - [Ebay](http://www.ebay.de/itm/221162832094?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649#ht_3092wt_1132) 32 | - Battery Pack 33 | - take any battery pack you can find (car battery, model making) 34 | 35 | # Software 36 | 37 | ## Build Firmware 38 | 39 | git clone github.com/krebscode/painload krebs 40 | cd krebs/minikrebs 41 | ./prepare instacam 42 | builder/init 43 | 44 | ## Flash 45 | 46 | # flash image is at: 47 | # builder/bin/ar71xx/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin 48 | 49 | # either flash image directly via web interface or 50 | # after obtaining ssh-access on the router run 51 | 52 | OWN_IP=<> ./upgrade <> 53 | -------------------------------------------------------------------------------- /doc/QUICKSTART: -------------------------------------------------------------------------------- 1 | # Quickstart to get your own own krebs on wr703n 2 | 3 | !important this is pseudo code, so please use your brains 4 | 5 | cd /krebs/minikrebs 6 | ./prepare krebs 7 | builder/init 8 | 9 | # Stock image 10 | connect to krebs 11 | 12 | dhclient eth0 13 | firefox 192.168.1.1 14 | {{goto the firmware-upgrade page}} 15 | {{upload ../builder/bin/ar71xx/openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin}} 16 | {{wait}} 17 | {{reconnect power}} 18 | 19 | # Upgrade image 20 | 21 | {{ start krebs in recovery mode}} 22 | ifconfig eth0 192.168.1.3 23 | sysctl net.ipv4.ip_forward=1 24 | iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE #assuming wlan0 provides internet access 25 | telnet 192.168.1.1 26 | mount_root 27 | passwd 28 | /etc/init.d/dropbear start 29 | exit 30 | OWN_IP=192.168.1.3 ./upgrade 192.168.1.1 31 | {{reconnect power}} 32 | {{password is minikrebs}} 33 | 34 | # when minikrebs is in dhcp-client mode 35 | echo 'dhcp-range=192.168.0.50,192.168.0.150,12h' > /etc/dnsmasq.conf 36 | ifconfig eth0 192.168.0.1 && dnsmasq -d 37 | 38 | -------------------------------------------------------------------------------- /doc/TLDR: -------------------------------------------------------------------------------- 1 | This is how you get a cool webcam-streamer image for your WR703N: 2 | ./prepare instacam && builder/init 3 | Use it to flash your minirouter, password is `minikrebs` 4 | -------------------------------------------------------------------------------- /doc/arduino.md: -------------------------------------------------------------------------------- 1 | Arduino server 2 | ============== 3 | 4 | Quick Start 5 | ----------- 6 | 7 | Flash this to your device. Connect an Arduino Uno, Mega, or Leonardo. Connect the device to the same network as your Arduino IDE. Use the Arduino IDE to flash to the device over the network (similar to Arduino Yun). 8 | 9 | Documentation 10 | ============= 11 | 12 | Purpose 13 | ------- 14 | 15 | The purpose of this trait is to connect an Arduino to the network so that it can be flashed and the console can be interacted with over the network using the Arduino IDE. 16 | 17 | Hardware 18 | -------- 19 | 20 | The following hardware is the currently known minimum requirement: 21 | - TP-LINK TP-710n, approximately 20 EUR shipped (8 MB flash) 22 | - Arduino Uno, Mega, or Leonardo 23 | 24 | Operation 25 | --------- 26 | 27 | TODO 28 | ---- 29 | 30 | * Investigate the Yun Bridge and how it could be included here. 31 | -------------------------------------------------------------------------------- /doc/mr3020_serial_pinout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/doc/mr3020_serial_pinout.jpg -------------------------------------------------------------------------------- /doc/reveal.js/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .svn 3 | log/*.log 4 | tmp/** 5 | node_modules/ 6 | .sass-cache -------------------------------------------------------------------------------- /doc/reveal.js/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | before_script: 5 | - npm install -g grunt-cli -------------------------------------------------------------------------------- /doc/reveal.js/Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* global module:false */ 2 | module.exports = function(grunt) { 3 | 4 | // Project configuration 5 | grunt.initConfig({ 6 | pkg: grunt.file.readJSON('package.json'), 7 | meta: { 8 | banner: 9 | '/*!\n' + 10 | ' * reveal.js <%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' + 11 | ' * http://lab.hakim.se/reveal-js\n' + 12 | ' * MIT licensed\n' + 13 | ' *\n' + 14 | ' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' + 15 | ' */' 16 | }, 17 | 18 | // Tests will be added soon 19 | qunit: { 20 | files: [ 'test/**/*.html' ] 21 | }, 22 | 23 | uglify: { 24 | options: { 25 | banner: '<%= meta.banner %>\n' 26 | }, 27 | build: { 28 | src: 'js/reveal.js', 29 | dest: 'js/reveal.min.js' 30 | } 31 | }, 32 | 33 | cssmin: { 34 | compress: { 35 | files: { 36 | 'css/reveal.min.css': [ 'css/reveal.css' ] 37 | } 38 | } 39 | }, 40 | 41 | sass: { 42 | main: { 43 | files: { 44 | 'css/theme/default.css': 'css/theme/source/default.scss', 45 | 'css/theme/beige.css': 'css/theme/source/beige.scss', 46 | 'css/theme/night.css': 'css/theme/source/night.scss', 47 | 'css/theme/serif.css': 'css/theme/source/serif.scss', 48 | 'css/theme/simple.css': 'css/theme/source/simple.scss', 49 | 'css/theme/sky.css': 'css/theme/source/sky.scss', 50 | 'css/theme/moon.css': 'css/theme/source/moon.scss', 51 | 'css/theme/solarized.css': 'css/theme/source/solarized.scss' 52 | } 53 | } 54 | }, 55 | 56 | jshint: { 57 | options: { 58 | curly: false, 59 | eqeqeq: true, 60 | immed: true, 61 | latedef: true, 62 | newcap: true, 63 | noarg: true, 64 | sub: true, 65 | undef: true, 66 | eqnull: true, 67 | browser: true, 68 | expr: true, 69 | globals: { 70 | head: false, 71 | module: false, 72 | console: false 73 | } 74 | }, 75 | files: [ 'Gruntfile.js', 'js/reveal.js' ] 76 | }, 77 | 78 | watch: { 79 | main: { 80 | files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ], 81 | tasks: 'default' 82 | }, 83 | theme: { 84 | files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], 85 | tasks: 'themes' 86 | } 87 | } 88 | 89 | }); 90 | 91 | // Dependencies 92 | grunt.loadNpmTasks( 'grunt-contrib-jshint' ); 93 | grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); 94 | grunt.loadNpmTasks( 'grunt-contrib-uglify' ); 95 | grunt.loadNpmTasks( 'grunt-contrib-watch' ); 96 | grunt.loadNpmTasks( 'grunt-contrib-sass' ); 97 | 98 | // Default task 99 | grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] ); 100 | 101 | // Theme task 102 | grunt.registerTask( 'themes', [ 'sass' ] ); 103 | 104 | }; 105 | -------------------------------------------------------------------------------- /doc/reveal.js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Hakim El Hattab, http://hakim.se 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/README.md: -------------------------------------------------------------------------------- 1 | ## Dependencies 2 | 3 | Themes are written using Sass to keep things modular and reduce the need for repeated selectors across files. Make sure that you have the reveal.js development environment including the Grunt dependencies installed before proceding: https://github.com/hakimel/reveal.js#development-environment 4 | 5 | 6 | 7 | ## Creating a Theme 8 | 9 | To create your own theme, start by duplicating any ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source) and adding it to the compilation list in the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js). 10 | 11 | Each theme file does four things in the following order: 12 | 13 | 1. **Include [/css/theme/template/mixins.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/mixins.scss)** 14 | Shared utility functions. 15 | 16 | 2. **Include [/css/theme/template/settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss)** 17 | Declares a set of custom variables that the template file (step 4) expects. Can be overridden in step 3. 18 | 19 | 3. **Override** 20 | This is where you override the default theme. Either by specifying variables (see [settings.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/settings.scss) for reference) or by adding full selectors with hardcoded styles. 21 | 22 | 4. **Include [/css/theme/template/theme.scss](https://github.com/hakimel/reveal.js/blob/master/css/theme/template/theme.scss)** 23 | The template theme file which will generate final CSS output based on the currently defined variables. -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/beige.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Beige theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @font-face { 17 | font-family: 'League Gothic'; 18 | src: url('../../lib/font/league_gothic-webfont.eot'); 19 | src: url('../../lib/font/league_gothic-webfont.eot?#iefix') format('embedded-opentype'), 20 | url('../../lib/font/league_gothic-webfont.woff') format('woff'), 21 | url('../../lib/font/league_gothic-webfont.ttf') format('truetype'), 22 | url('../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular') format('svg'); 23 | 24 | font-weight: normal; 25 | font-style: normal; 26 | } 27 | 28 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 29 | 30 | 31 | // Override theme settings (see ../template/settings.scss) 32 | $mainColor: #333; 33 | $headingColor: #333; 34 | $headingTextShadow: none; 35 | $backgroundColor: #f7f3de; 36 | $linkColor: #8b743d; 37 | $linkColorHover: lighten( $linkColor, 20% ); 38 | $selectionBackgroundColor: rgba(79, 64, 28, 0.99); 39 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 40 | 41 | // Background generator 42 | @mixin bodyBackground() { 43 | @include radial-gradient( rgba(247,242,211,1), rgba(255,255,255,1) ); 44 | } 45 | 46 | 47 | 48 | // Theme template ------------------------------ 49 | @import "../template/theme"; 50 | // --------------------------------------------- -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/default.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Default theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @font-face { 17 | font-family: 'League Gothic'; 18 | src: url('../../lib/font/league_gothic-webfont.eot'); 19 | src: url('../../lib/font/league_gothic-webfont.eot?#iefix') format('embedded-opentype'), 20 | url('../../lib/font/league_gothic-webfont.woff') format('woff'), 21 | url('../../lib/font/league_gothic-webfont.ttf') format('truetype'), 22 | url('../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular') format('svg'); 23 | 24 | font-weight: normal; 25 | font-style: normal; 26 | } 27 | 28 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 29 | 30 | // Override theme settings (see ../template/settings.scss) 31 | $heading1TextShadow: 0 1px 0 #ccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaa, 0 6px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15); 32 | 33 | // Background generator 34 | @mixin bodyBackground() { 35 | @include radial-gradient( rgba(28,30,32,1), rgba(85,90,95,1) ); 36 | } 37 | 38 | 39 | 40 | // Theme template ------------------------------ 41 | @import "../template/theme"; 42 | // --------------------------------------------- -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/moon.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Dark theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @font-face { 16 | font-family: 'League Gothic'; 17 | src: url('../../lib/font/league_gothic-webfont.eot'); 18 | src: url('../../lib/font/league_gothic-webfont.eot?#iefix') format('embedded-opentype'), 19 | url('../../lib/font/league_gothic-webfont.woff') format('woff'), 20 | url('../../lib/font/league_gothic-webfont.ttf') format('truetype'), 21 | url('../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular') format('svg'); 22 | 23 | font-weight: normal; 24 | font-style: normal; 25 | } 26 | 27 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 28 | 29 | /** 30 | * Solarized colors by Ethan Schoonover 31 | */ 32 | html * { 33 | color-profile: sRGB; 34 | rendering-intent: auto; 35 | } 36 | 37 | // Solarized colors 38 | $base03: #002b36; 39 | $base02: #073642; 40 | $base01: #586e75; 41 | $base00: #657b83; 42 | $base0: #839496; 43 | $base1: #93a1a1; 44 | $base2: #eee8d5; 45 | $base3: #fdf6e3; 46 | $yellow: #b58900; 47 | $orange: #cb4b16; 48 | $red: #dc322f; 49 | $magenta: #d33682; 50 | $violet: #6c71c4; 51 | $blue: #268bd2; 52 | $cyan: #2aa198; 53 | $green: #859900; 54 | 55 | // Override theme settings (see ../template/settings.scss) 56 | $mainColor: $base1; 57 | $headingColor: $base2; 58 | $headingTextShadow: none; 59 | $backgroundColor: $base03; 60 | $linkColor: $blue; 61 | $linkColorHover: lighten( $linkColor, 20% ); 62 | $selectionBackgroundColor: $magenta; 63 | 64 | 65 | 66 | // Theme template ------------------------------ 67 | @import "../template/theme"; 68 | // --------------------------------------------- 69 | -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/night.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Black theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | // Include theme-specific fonts 15 | @import url(https://fonts.googleapis.com/css?family=Montserrat:700); 16 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic); 17 | 18 | 19 | // Override theme settings (see ../template/settings.scss) 20 | $backgroundColor: #111; 21 | 22 | $mainFont: 'Open Sans', sans-serif; 23 | $linkColor: #e7ad52; 24 | $linkColorHover: lighten( $linkColor, 20% ); 25 | $headingFont: 'Montserrat', Impact, sans-serif; 26 | $headingTextShadow: none; 27 | $headingLetterSpacing: -0.03em; 28 | $headingTextTransform: none; 29 | $selectionBackgroundColor: #e7ad52; 30 | $mainFontSize: 30px; 31 | 32 | 33 | // Theme template ------------------------------ 34 | @import "../template/theme"; 35 | // --------------------------------------------- -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/serif.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is darkblue. 4 | * 5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se; so is the theme - beige.css - that this is based off of. 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Override theme settings (see ../template/settings.scss) 18 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 19 | $mainColor: #000; 20 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif; 21 | $headingColor: #383D3D; 22 | $headingTextShadow: none; 23 | $headingTextTransform: none; 24 | $backgroundColor: #F0F1EB; 25 | $linkColor: #51483D; 26 | $linkColorHover: lighten( $linkColor, 20% ); 27 | $selectionBackgroundColor: #26351C; 28 | 29 | 30 | 31 | // Theme template ------------------------------ 32 | @import "../template/theme"; 33 | // --------------------------------------------- -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/simple.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * A simple theme for reveal.js presentations, similar 3 | * to the default theme. The accent color is darkblue. 4 | * 5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed. 6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 7 | */ 8 | 9 | 10 | // Default mixins and settings ----------------- 11 | @import "../template/mixins"; 12 | @import "../template/settings"; 13 | // --------------------------------------------- 14 | 15 | 16 | 17 | // Include theme-specific fonts 18 | @import url(https://fonts.googleapis.com/css?family=News+Cycle:400,700); 19 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 20 | 21 | 22 | // Override theme settings (see ../template/settings.scss) 23 | $mainFont: 'Lato', sans-serif; 24 | $mainColor: #000; 25 | $headingFont: 'News Cycle', Impact, sans-serif; 26 | $headingColor: #000; 27 | $headingTextShadow: none; 28 | $headingTextTransform: none; 29 | $backgroundColor: #fff; 30 | $linkColor: #00008B; 31 | $linkColorHover: lighten( $linkColor, 20% ); 32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99); 33 | 34 | 35 | 36 | // Theme template ------------------------------ 37 | @import "../template/theme"; 38 | // --------------------------------------------- -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/sky.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Sky theme for reveal.js. 3 | * 4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se 5 | */ 6 | 7 | 8 | // Default mixins and settings ----------------- 9 | @import "../template/mixins"; 10 | @import "../template/settings"; 11 | // --------------------------------------------- 12 | 13 | 14 | 15 | // Include theme-specific fonts 16 | @import url(https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic); 17 | @import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700); 18 | 19 | 20 | // Override theme settings (see ../template/settings.scss) 21 | $mainFont: 'Open Sans', sans-serif; 22 | $mainColor: #333; 23 | $headingFont: 'Quicksand', sans-serif; 24 | $headingColor: #333; 25 | $headingLetterSpacing: -0.08em; 26 | $headingTextShadow: none; 27 | $backgroundColor: #f7fbfc; 28 | $linkColor: #3b759e; 29 | $linkColorHover: lighten( $linkColor, 20% ); 30 | $selectionBackgroundColor: #134674; 31 | 32 | // Background generator 33 | @mixin bodyBackground() { 34 | @include radial-gradient( #add9e4, #f7fbfc ); 35 | } 36 | 37 | 38 | 39 | // Theme template ------------------------------ 40 | @import "../template/theme"; 41 | // --------------------------------------------- -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/source/solarized.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * Solarized Light theme for reveal.js. 3 | * Author: Achim Staebler 4 | */ 5 | 6 | 7 | // Default mixins and settings ----------------- 8 | @import "../template/mixins"; 9 | @import "../template/settings"; 10 | // --------------------------------------------- 11 | 12 | 13 | 14 | // Include theme-specific fonts 15 | @font-face { 16 | font-family: 'League Gothic'; 17 | src: url('../../lib/font/league_gothic-webfont.eot'); 18 | src: url('../../lib/font/league_gothic-webfont.eot?#iefix') format('embedded-opentype'), 19 | url('../../lib/font/league_gothic-webfont.woff') format('woff'), 20 | url('../../lib/font/league_gothic-webfont.ttf') format('truetype'), 21 | url('../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular') format('svg'); 22 | 23 | font-weight: normal; 24 | font-style: normal; 25 | } 26 | 27 | @import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic); 28 | 29 | 30 | /** 31 | * Solarized colors by Ethan Schoonover 32 | */ 33 | html * { 34 | color-profile: sRGB; 35 | rendering-intent: auto; 36 | } 37 | 38 | // Solarized colors 39 | $base03: #002b36; 40 | $base02: #073642; 41 | $base01: #586e75; 42 | $base00: #657b83; 43 | $base0: #839496; 44 | $base1: #93a1a1; 45 | $base2: #eee8d5; 46 | $base3: #fdf6e3; 47 | $yellow: #b58900; 48 | $orange: #cb4b16; 49 | $red: #dc322f; 50 | $magenta: #d33682; 51 | $violet: #6c71c4; 52 | $blue: #268bd2; 53 | $cyan: #2aa198; 54 | $green: #859900; 55 | 56 | // Override theme settings (see ../template/settings.scss) 57 | $mainColor: $base00; 58 | $headingColor: $base01; 59 | $headingTextShadow: none; 60 | $backgroundColor: $base3; 61 | $linkColor: $blue; 62 | $linkColorHover: lighten( $linkColor, 20% ); 63 | $selectionBackgroundColor: $magenta; 64 | 65 | // Background generator 66 | // @mixin bodyBackground() { 67 | // @include radial-gradient( rgba($base3,1), rgba(lighten($base3, 20%),1) ); 68 | // } 69 | 70 | 71 | 72 | // Theme template ------------------------------ 73 | @import "../template/theme"; 74 | // --------------------------------------------- 75 | -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/template/mixins.scss: -------------------------------------------------------------------------------- 1 | @mixin vertical-gradient( $top, $bottom ) { 2 | background: $top; 3 | background: -moz-linear-gradient( top, $top 0%, $bottom 100% ); 4 | background: -webkit-gradient( linear, left top, left bottom, color-stop(0%,$top), color-stop(100%,$bottom) ); 5 | background: -webkit-linear-gradient( top, $top 0%, $bottom 100% ); 6 | background: -o-linear-gradient( top, $top 0%, $bottom 100% ); 7 | background: -ms-linear-gradient( top, $top 0%, $bottom 100% ); 8 | background: linear-gradient( top, $top 0%, $bottom 100% ); 9 | } 10 | 11 | @mixin horizontal-gradient( $top, $bottom ) { 12 | background: $top; 13 | background: -moz-linear-gradient( left, $top 0%, $bottom 100% ); 14 | background: -webkit-gradient( linear, left top, right top, color-stop(0%,$top), color-stop(100%,$bottom) ); 15 | background: -webkit-linear-gradient( left, $top 0%, $bottom 100% ); 16 | background: -o-linear-gradient( left, $top 0%, $bottom 100% ); 17 | background: -ms-linear-gradient( left, $top 0%, $bottom 100% ); 18 | background: linear-gradient( left, $top 0%, $bottom 100% ); 19 | } 20 | 21 | @mixin radial-gradient( $outer, $inner, $type: circle ) { 22 | background: $outer; 23 | background: -moz-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 24 | background: -webkit-gradient( radial, center center, 0px, center center, 100%, color-stop(0%,$inner), color-stop(100%,$outer) ); 25 | background: -webkit-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 26 | background: -o-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 27 | background: -ms-radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 28 | background: radial-gradient( center, $type cover, $inner 0%, $outer 100% ); 29 | } -------------------------------------------------------------------------------- /doc/reveal.js/css/theme/template/settings.scss: -------------------------------------------------------------------------------- 1 | // Base settings for all themes that can optionally be 2 | // overridden by the super-theme 3 | 4 | // Background of the presentation 5 | $backgroundColor: #2b2b2b; 6 | 7 | // Primary/body text 8 | $mainFont: 'Lato', sans-serif; 9 | $mainFontSize: 36px; 10 | $mainColor: #eee; 11 | 12 | // Headings 13 | $headingFont: 'League Gothic', Impact, sans-serif; 14 | $headingColor: #eee; 15 | $headingLineHeight: 0.9em; 16 | $headingLetterSpacing: 0.02em; 17 | $headingTextTransform: uppercase; 18 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2); 19 | $heading1TextShadow: $headingTextShadow; 20 | 21 | // Links and actions 22 | $linkColor: #13DAEC; 23 | $linkColorHover: lighten( $linkColor, 20% ); 24 | 25 | // Text selection 26 | $selectionBackgroundColor: #FF5E99; 27 | $selectionColor: #fff; 28 | 29 | // Generates the presentation background, can be overridden 30 | // to return a background image or gradient 31 | @mixin bodyBackground() { 32 | background: $backgroundColor; 33 | } -------------------------------------------------------------------------------- /doc/reveal.js/lib/css/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | pre code { 9 | display: block; padding: 0.5em; 10 | background: #3F3F3F; 11 | color: #DCDCDC; 12 | } 13 | 14 | pre .keyword, 15 | pre .tag, 16 | pre .django .tag, 17 | pre .django .keyword, 18 | pre .css .class, 19 | pre .css .id, 20 | pre .lisp .title { 21 | color: #E3CEAB; 22 | } 23 | 24 | pre .django .template_tag, 25 | pre .django .variable, 26 | pre .django .filter .argument { 27 | color: #DCDCDC; 28 | } 29 | 30 | pre .number, 31 | pre .date { 32 | color: #8CD0D3; 33 | } 34 | 35 | pre .dos .envvar, 36 | pre .dos .stream, 37 | pre .variable, 38 | pre .apache .sqbracket { 39 | color: #EFDCBC; 40 | } 41 | 42 | pre .dos .flow, 43 | pre .diff .change, 44 | pre .python .exception, 45 | pre .python .built_in, 46 | pre .literal, 47 | pre .tex .special { 48 | color: #EFEFAF; 49 | } 50 | 51 | pre .diff .chunk, 52 | pre .ruby .subst { 53 | color: #8F8F8F; 54 | } 55 | 56 | pre .dos .keyword, 57 | pre .python .decorator, 58 | pre .class .title, 59 | pre .haskell .label, 60 | pre .function .title, 61 | pre .ini .title, 62 | pre .diff .header, 63 | pre .ruby .class .parent, 64 | pre .apache .tag, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .input_number { 68 | color: #efef8f; 69 | } 70 | 71 | pre .dos .winutils, 72 | pre .ruby .symbol, 73 | pre .ruby .symbol .string, 74 | pre .ruby .symbol .keyword, 75 | pre .ruby .symbol .keymethods, 76 | pre .ruby .string, 77 | pre .ruby .instancevar { 78 | color: #DCA3A3; 79 | } 80 | 81 | pre .diff .deletion, 82 | pre .string, 83 | pre .tag .value, 84 | pre .preprocessor, 85 | pre .built_in, 86 | pre .sql .aggregate, 87 | pre .javadoc, 88 | pre .smalltalk .class, 89 | pre .smalltalk .localvars, 90 | pre .smalltalk .array, 91 | pre .css .rules .value, 92 | pre .attr_selector, 93 | pre .pseudo, 94 | pre .apache .cbracket, 95 | pre .tex .formula { 96 | color: #CC9393; 97 | } 98 | 99 | pre .shebang, 100 | pre .diff .addition, 101 | pre .comment, 102 | pre .java .annotation, 103 | pre .template_comment, 104 | pre .pi, 105 | pre .doctype { 106 | color: #7F9F7F; 107 | } 108 | 109 | pre .xml .css, 110 | pre .xml .javascript, 111 | pre .xml .vbscript, 112 | pre .tex .formula { 113 | opacity: 0.5; 114 | } 115 | 116 | -------------------------------------------------------------------------------- /doc/reveal.js/lib/font/league_gothic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/doc/reveal.js/lib/font/league_gothic-webfont.eot -------------------------------------------------------------------------------- /doc/reveal.js/lib/font/league_gothic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/doc/reveal.js/lib/font/league_gothic-webfont.ttf -------------------------------------------------------------------------------- /doc/reveal.js/lib/font/league_gothic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/doc/reveal.js/lib/font/league_gothic-webfont.woff -------------------------------------------------------------------------------- /doc/reveal.js/lib/font/league_gothic_license: -------------------------------------------------------------------------------- 1 | SIL Open Font License (OFL) 2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL 3 | -------------------------------------------------------------------------------- /doc/reveal.js/lib/js/classList.js: -------------------------------------------------------------------------------- 1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/ 2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p 3 | Copyright Tero Piirainen (tipiirai) 4 | License MIT / http://bit.ly/mit-license 5 | Version 0.96 6 | 7 | http://headjs.com 8 | */(function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c 2 | 3 | 4 | 5 | 6 | 7 | reveal.js - Markdown Demo 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | 19 | 20 |
21 | 22 | 23 |
24 | 34 |
35 | 36 | 37 |
38 | 52 |
53 | 54 | 55 |
56 | 67 |
68 | 69 |
70 |
71 | 72 | 73 | 74 | 75 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/markdown/example.md: -------------------------------------------------------------------------------- 1 | # Markdown Demo 2 | 3 | 4 | 5 | ## External 1.1 6 | 7 | Content 1.1 8 | 9 | 10 | ## External 1.2 11 | 12 | Content 1.2 13 | 14 | 15 | 16 | ## External 2 17 | 18 | Content 2.1 19 | 20 | 21 | 22 | ## External 3.1 23 | 24 | Content 3.1 25 | 26 | 27 | ## External 3.2 28 | 29 | Content 3.2 30 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/multiplex/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var multiplex = Reveal.getConfig().multiplex; 3 | var socketId = multiplex.id; 4 | var socket = io.connect(multiplex.url); 5 | 6 | socket.on(multiplex.id, function(data) { 7 | // ignore data from sockets that aren't ours 8 | if (data.socketId !== socketId) { return; } 9 | if( window.location.host === 'localhost:1947' ) return; 10 | 11 | Reveal.slide(data.indexh, data.indexv, data.indexf, 'remote'); 12 | }); 13 | }()); 14 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/multiplex/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var fs = require('fs'); 3 | var io = require('socket.io'); 4 | var crypto = require('crypto'); 5 | 6 | var app = express.createServer(); 7 | var staticDir = express.static; 8 | 9 | io = io.listen(app); 10 | 11 | var opts = { 12 | port: 1948, 13 | baseDir : __dirname + '/../../' 14 | }; 15 | 16 | io.sockets.on('connection', function(socket) { 17 | socket.on('slidechanged', function(slideData) { 18 | if (typeof slideData.secret == 'undefined' || slideData.secret == null || slideData.secret === '') return; 19 | if (createHash(slideData.secret) === slideData.socketId) { 20 | slideData.secret = null; 21 | socket.broadcast.emit(slideData.socketId, slideData); 22 | }; 23 | }); 24 | }); 25 | 26 | app.configure(function() { 27 | [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) { 28 | app.use('/' + dir, staticDir(opts.baseDir + dir)); 29 | }); 30 | }); 31 | 32 | app.get("/", function(req, res) { 33 | fs.createReadStream(opts.baseDir + '/index.html').pipe(res); 34 | }); 35 | 36 | app.get("/token", function(req,res) { 37 | var ts = new Date().getTime(); 38 | var rand = Math.floor(Math.random()*9999999); 39 | var secret = ts.toString() + rand.toString(); 40 | res.send({secret: secret, socketId: createHash(secret)}); 41 | }); 42 | 43 | var createHash = function(secret) { 44 | var cipher = crypto.createCipher('blowfish', secret); 45 | return(cipher.final('hex')); 46 | }; 47 | 48 | // Actually listen 49 | app.listen(opts.port || null); 50 | 51 | var brown = '\033[33m', 52 | green = '\033[32m', 53 | reset = '\033[0m'; 54 | 55 | console.log( brown + "reveal.js:" + reset + " Multiplex running on port " + green + opts.port + reset ); -------------------------------------------------------------------------------- /doc/reveal.js/plugin/multiplex/master.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // don't emit events from inside the previews themselves 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | var multiplex = Reveal.getConfig().multiplex; 5 | 6 | var socket = io.connect(multiplex.url); 7 | 8 | var notify = function( slideElement, indexh, indexv, origin ) { 9 | if( typeof origin === 'undefined' && origin !== 'remote' ) { 10 | var nextindexh; 11 | var nextindexv; 12 | 13 | var fragmentindex = Reveal.getIndices().f; 14 | if (typeof fragmentindex == 'undefined') { 15 | fragmentindex = 0; 16 | } 17 | 18 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 19 | nextindexh = indexh; 20 | nextindexv = indexv + 1; 21 | } else { 22 | nextindexh = indexh + 1; 23 | nextindexv = 0; 24 | } 25 | 26 | var slideData = { 27 | indexh : indexh, 28 | indexv : indexv, 29 | indexf : fragmentindex, 30 | nextindexh : nextindexh, 31 | nextindexv : nextindexv, 32 | secret: multiplex.secret, 33 | socketId : multiplex.id 34 | }; 35 | 36 | socket.emit('slidechanged', slideData); 37 | } 38 | } 39 | 40 | Reveal.addEventListener( 'slidechanged', function( event ) { 41 | notify( event.currentSlide, event.indexh, event.indexv, event.origin ); 42 | } ); 43 | 44 | var fragmentNotify = function( event ) { 45 | notify( Reveal.getCurrentSlide(), Reveal.getIndices().h, Reveal.getIndices().v, event.origin ); 46 | }; 47 | 48 | Reveal.addEventListener( 'fragmentshown', fragmentNotify ); 49 | Reveal.addEventListener( 'fragmenthidden', fragmentNotify ); 50 | }()); -------------------------------------------------------------------------------- /doc/reveal.js/plugin/notes-server/client.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | // don't emit events from inside the previews themselves 3 | if ( window.location.search.match( /receiver/gi ) ) { return; } 4 | 5 | var socket = io.connect(window.location.origin); 6 | var socketId = Math.random().toString().slice(2); 7 | 8 | console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId); 9 | window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId); 10 | 11 | // Fires when a fragment is shown 12 | Reveal.addEventListener( 'fragmentshown', function( event ) { 13 | var fragmentData = { 14 | fragment : 'next', 15 | socketId : socketId 16 | }; 17 | socket.emit('fragmentchanged', fragmentData); 18 | } ); 19 | 20 | // Fires when a fragment is hidden 21 | Reveal.addEventListener( 'fragmenthidden', function( event ) { 22 | var fragmentData = { 23 | fragment : 'previous', 24 | socketId : socketId 25 | }; 26 | socket.emit('fragmentchanged', fragmentData); 27 | } ); 28 | 29 | // Fires when slide is changed 30 | Reveal.addEventListener( 'slidechanged', function( event ) { 31 | var nextindexh; 32 | var nextindexv; 33 | var slideElement = event.currentSlide; 34 | 35 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { 36 | nextindexh = event.indexh; 37 | nextindexv = event.indexv + 1; 38 | } else { 39 | nextindexh = event.indexh + 1; 40 | nextindexv = 0; 41 | } 42 | 43 | var notes = slideElement.querySelector('aside.notes'); 44 | var slideData = { 45 | notes : notes ? notes.innerHTML : '', 46 | indexh : event.indexh, 47 | indexv : event.indexv, 48 | nextindexh : nextindexh, 49 | nextindexv : nextindexv, 50 | socketId : socketId, 51 | markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false 52 | 53 | }; 54 | 55 | socket.emit('slidechanged', slideData); 56 | } ); 57 | }()); 58 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/notes-server/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var fs = require('fs'); 3 | var io = require('socket.io'); 4 | var _ = require('underscore'); 5 | var Mustache = require('mustache'); 6 | 7 | var app = express.createServer(); 8 | var staticDir = express.static; 9 | 10 | io = io.listen(app); 11 | 12 | var opts = { 13 | port : 1947, 14 | baseDir : __dirname + '/../../' 15 | }; 16 | 17 | io.sockets.on('connection', function(socket) { 18 | socket.on('slidechanged', function(slideData) { 19 | socket.broadcast.emit('slidedata', slideData); 20 | }); 21 | socket.on('fragmentchanged', function(fragmentData) { 22 | socket.broadcast.emit('fragmentdata', fragmentData); 23 | }); 24 | }); 25 | 26 | app.configure(function() { 27 | [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach(function(dir) { 28 | app.use('/' + dir, staticDir(opts.baseDir + dir)); 29 | }); 30 | }); 31 | 32 | app.get("/", function(req, res) { 33 | fs.createReadStream(opts.baseDir + '/index.html').pipe(res); 34 | }); 35 | 36 | app.get("/notes/:socketId", function(req, res) { 37 | 38 | fs.readFile(opts.baseDir + 'plugin/notes-server/notes.html', function(err, data) { 39 | res.send(Mustache.to_html(data.toString(), { 40 | socketId : req.params.socketId 41 | })); 42 | }); 43 | // fs.createReadStream(opts.baseDir + 'notes-server/notes.html').pipe(res); 44 | }); 45 | 46 | // Actually listen 47 | app.listen(opts.port || null); 48 | 49 | var brown = '\033[33m', 50 | green = '\033[32m', 51 | reset = '\033[0m'; 52 | 53 | var slidesLocation = "http://localhost" + ( opts.port ? ( ':' + opts.port ) : '' ); 54 | 55 | console.log( brown + "reveal.js - Speaker Notes" + reset ); 56 | console.log( "1. Open the slides at " + green + slidesLocation + reset ); 57 | console.log( "2. Click on the link your JS console to go to the notes page" ); 58 | console.log( "3. Advance through your slides and your notes will advance automatically" ); 59 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/notes-server/notes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | reveal.js - Slide Notes 7 | 8 | 87 | 88 | 89 | 90 | 91 |
92 | 93 |
94 | 95 |
96 | 97 | UPCOMING: 98 |
99 |
100 | 101 | 102 | 103 | 104 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/notes/notes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Handles opening of and synchronization with the reveal.js 3 | * notes window. 4 | */ 5 | var RevealNotes = (function() { 6 | 7 | function openNotes() { 8 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path 9 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path 10 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' ); 11 | 12 | // Fires when slide is changed 13 | Reveal.addEventListener( 'slidechanged', function( event ) { 14 | post('slidechanged'); 15 | } ); 16 | 17 | // Fires when a fragment is shown 18 | Reveal.addEventListener( 'fragmentshown', function( event ) { 19 | post('fragmentshown'); 20 | } ); 21 | 22 | // Fires when a fragment is hidden 23 | Reveal.addEventListener( 'fragmenthidden', function( event ) { 24 | post('fragmenthidden'); 25 | } ); 26 | 27 | /** 28 | * Posts the current slide data to the notes window 29 | * 30 | * @param {String} eventType Expecting 'slidechanged', 'fragmentshown' 31 | * or 'fragmenthidden' set in the events above to define the needed 32 | * slideDate. 33 | */ 34 | function post( eventType ) { 35 | var slideElement = Reveal.getCurrentSlide(), 36 | messageData; 37 | 38 | if( eventType === 'slidechanged' ) { 39 | var notes = slideElement.querySelector( 'aside.notes' ), 40 | indexh = Reveal.getIndices().h, 41 | indexv = Reveal.getIndices().v, 42 | nextindexh, 43 | nextindexv; 44 | 45 | if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) { 46 | nextindexh = indexh; 47 | nextindexv = indexv + 1; 48 | } else { 49 | nextindexh = indexh + 1; 50 | nextindexv = 0; 51 | } 52 | 53 | messageData = { 54 | notes : notes ? notes.innerHTML : '', 55 | indexh : indexh, 56 | indexv : indexv, 57 | nextindexh : nextindexh, 58 | nextindexv : nextindexv, 59 | markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false 60 | }; 61 | } 62 | else if( eventType === 'fragmentshown' ) { 63 | messageData = { 64 | fragment : 'next' 65 | }; 66 | } 67 | else if( eventType === 'fragmenthidden' ) { 68 | messageData = { 69 | fragment : 'prev' 70 | }; 71 | } 72 | 73 | notesPopup.postMessage( JSON.stringify( messageData ), '*' ); 74 | } 75 | 76 | // Navigate to the current slide when the notes are loaded 77 | notesPopup.addEventListener( 'load', function( event ) { 78 | post('slidechanged'); 79 | }, false ); 80 | } 81 | 82 | // If the there's a 'notes' query set, open directly 83 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) { 84 | openNotes(); 85 | } 86 | 87 | // Open the notes when the 's' key is hit 88 | document.addEventListener( 'keydown', function( event ) { 89 | // Disregard the event if the target is editable or a 90 | // modifier is present 91 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return; 92 | 93 | if( event.keyCode === 83 ) { 94 | event.preventDefault(); 95 | openNotes(); 96 | } 97 | }, false ); 98 | 99 | return { open: openNotes }; 100 | })(); 101 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/postmessage/example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 |
11 | 12 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/postmessage/postmessage.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | simple postmessage plugin 4 | 5 | Useful when a reveal slideshow is inside an iframe. 6 | It allows to call reveal methods from outside. 7 | 8 | Example: 9 | var reveal = window.frames[0]; 10 | 11 | // Reveal.prev(); 12 | reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*'); 13 | // Reveal.next(); 14 | reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*'); 15 | // Reveal.slide(2, 2); 16 | reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*'); 17 | 18 | Add to the slideshow: 19 | 20 | dependencies: [ 21 | ... 22 | { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } } 23 | ] 24 | 25 | */ 26 | 27 | (function (){ 28 | 29 | window.addEventListener( "message", function ( event ) { 30 | var data = JSON.parse( event.data ), 31 | method = data.method, 32 | args = data.args; 33 | 34 | if( typeof Reveal[method] === 'function' ) { 35 | Reveal[method].apply( Reveal, data.args ); 36 | } 37 | }, false); 38 | 39 | }()); 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /doc/reveal.js/plugin/print-pdf/print-pdf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * phantomjs script for printing presentations to PDF. 3 | * 4 | * Example: 5 | * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf 6 | * 7 | * By Manuel Bieh (https://github.com/manuelbieh) 8 | */ 9 | 10 | // html2pdf.js 11 | var page = new WebPage(); 12 | var system = require( 'system' ); 13 | 14 | page.paperSize = { 15 | format: 'A4', 16 | orientation: 'landscape', 17 | margin: { 18 | left: '0', 19 | right: '0', 20 | top: '0', 21 | bottom: '0' 22 | } 23 | }; 24 | page.zoomFactor = 1.5; 25 | 26 | var revealFile = system.args[1] || 'index.html?print-pdf'; 27 | var slideFile = system.args[2] || 'slides.pdf'; 28 | 29 | if( slideFile.match( /\.pdf$/gi ) === null ) { 30 | slideFile += '.pdf'; 31 | } 32 | 33 | console.log( 'Printing PDF...' ); 34 | 35 | page.open( revealFile, function( status ) { 36 | console.log( 'Printed succesfully' ); 37 | page.render( slideFile ); 38 | phantom.exit(); 39 | } ); -------------------------------------------------------------------------------- /doc/reveal.js/plugin/remotes/remotes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Touch-based remote controller for your presentation courtesy 3 | * of the folks at http://remotes.io 4 | */ 5 | 6 | (function(window){ 7 | 8 | /** 9 | * Detects if we are dealing with a touch enabled device (with some false positives) 10 | * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js 11 | */ 12 | var hasTouch = (function(){ 13 | return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; 14 | })(); 15 | 16 | /** 17 | * Detects if notes are enable and the current page is opened inside an /iframe 18 | * this prevents loading Remotes.io several times 19 | */ 20 | var remotesAndIsNotes = (function(){ 21 | return !(window.RevealNotes && self == top); 22 | })(); 23 | 24 | if(!hasTouch && !remotesAndIsNotes){ 25 | head.ready( 'remotes.ne.min.js', function() { 26 | new Remotes("preview") 27 | .on("swipe-left", function(e){ Reveal.right(); }) 28 | .on("swipe-right", function(e){ Reveal.left(); }) 29 | .on("swipe-up", function(e){ Reveal.down(); }) 30 | .on("swipe-down", function(e){ Reveal.up(); }) 31 | .on("tap", function(e){ 32 | Reveal.toggleOverview(); 33 | }); 34 | } ); 35 | 36 | head.js('https://raw.github.com/Remotes/Remotes/master/dist/remotes.ne.min.js'); 37 | } 38 | })(window); -------------------------------------------------------------------------------- /lib/append_files: -------------------------------------------------------------------------------- 1 | etc/rc.local 2 | etc/firstrun.commands 3 | -------------------------------------------------------------------------------- /lib/init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -x 3 | 4 | cd $(dirname $(readlink -f $0)) 5 | if [ ! -e Makefile ] ;then 6 | echo "ImageBuilder not checked out yet" 7 | echo "try running ../prepare $$PROFILE" 8 | exit 1 9 | fi 10 | 11 | echo 12 | rm -r bin/ || echo "no bindir, skipping removal" 13 | if [ -e ./custom_make ];then 14 | echo "Starting Custom Make" 15 | sh ./custom_make # 2>/dev/null | while read line; do 16 | # printf "." 17 | # done 18 | else 19 | echo "No Custom Make Script exists, bailing out!" 20 | exit 1 21 | fi 22 | 23 | echo 24 | 25 | FACTORY=$(find bin/ | grep -e "squashfs-factory.bin$" | head -n 1) 26 | SYSUPGRADE=$(find bin/ | grep -e "squashfs-sysupgrade.bin$" | head -n 1) 27 | 28 | if [ "$FACTORY" == "" ]; then 29 | # x86-64 30 | FACTORY=$(find bin/ | grep -e "combined-squashfs.img$" | head -n 1) 31 | fi 32 | 33 | if [ "$FACTORY" != "" ]; 34 | then 35 | cat << EOF 36 | finished building 37 | You can use the following images: 38 | Factory : $FACTORY 39 | System Upgrade: ${SYSUPGRADE:-No sysupgrade produced} 40 | EOF 41 | exit 0 42 | else 43 | cat << EOF 44 | It seems like the factory image has not been created, it could mean 45 | that the image would be too big and does not fit into the tiny FLASH. 46 | 47 | Observe the output above, fix, and retry building. 48 | In bin/ : 49 | $(find bin/) 50 | EOF 51 | exit 1 52 | fi 53 | -------------------------------------------------------------------------------- /lib/init_overlay: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd $(dirname $(readlink -f $0)) 3 | [ ! -e overlay/ ] && echo "profile data for external overlay does not exist, bailing out" 4 | 5 | [ -e doc/overlay ] && echo "Profile demands the following partitioning of the overlay usb stick:" && cat doc/OVERLAY 6 | 7 | if grep -q $PWD/mnt/overlay /etc/mtab;then 8 | echo "overlay mounted" 9 | echo "[*] copying overlay data:" 10 | find mnt/overlay/ -mindepth 1 -maxdepth 1 | while read data; do 11 | rm -r $data 12 | done 13 | [ -e overlay/ ] && find overlay/ -mindepth 1 -maxdepth 1 | while read data; do 14 | rm -rf mnt/overlay/$(basename $data) 15 | cp -vr $data mnt/overlay 16 | done 17 | echo "[*] adding packages" 18 | for i in `cat overlay_packages`;do 19 | mkdir -p mnt/overlay/packages 20 | cp -vnr packages/${i}_*.ipk mnt/overlay/packages 21 | done 22 | echo 23 | echo "[*] unmounting overlay" 24 | umount mnt/overlay/ 25 | else 26 | mkdir -p $PWD/mnt/overlay 27 | echo "please mount your overlay to $PWD/mnt/overlay" 28 | fi 29 | 30 | -------------------------------------------------------------------------------- /lib/postbuild/convert-vdi_qcow2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -xeu 3 | 4 | cd bin/* 5 | ls -altrh 6 | # VDI 7 | echo "Converting image to Virtualbox" > 2 8 | 9 | SIMG=`ls -1 *-combined-squashfs.img` 10 | VBoxManage convertfromraw "$SIMG" "${SIMG%.img}.vdi" --format VDI 11 | 12 | echo "converting image to qcow2" 13 | EGIMG=`ls -1 *-combined-ext4.img.gz` 14 | EIMG=${EGIMG%.gz} 15 | gunzip "$EGIMG" 16 | qemu-img convert "$EIMG" -O qcow2 "${EIMG%.img}.qcow2" 17 | gzip "$EIMG" 18 | 19 | cd - 20 | -------------------------------------------------------------------------------- /lib/prebuild/tlwr-16m.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -xeuf 3 | echo $PWD 4 | ls 5 | test -e target/linux/ar71xx/image/Makefile 6 | sed -i 's#Device/tplink-4mlzma#Device/tplink-16mlzma#' target/linux/ar71xx/image/Makefile 7 | -------------------------------------------------------------------------------- /prepare: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eu 3 | # TODO: provide a means to switch builder. right now, simply move builder to builder-ar71xx and symlink to builder 4 | #IMAGEBUILDER_URL="http://downloads.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i486.tar.bz2" 5 | # Caution: Snapshots are unstable 6 | #IMAGEBUILDER_URL="http://downloads.openwrt.org/snapshots/trunk/ar71xx/OpenWrt-ImageBuilder-ar71xx_generic-for-linux-x86_64.tar.bz2" 7 | IMAGEBUILDER_URL=${IMAGEBUILDER_URL:-https://downloads.openwrt.org/chaos_calmer/15.05/x86/64/OpenWrt-ImageBuilder-15.05-x86-64.Linux-x86_64.tar.bz2} 8 | archive=$(basename $IMAGEBUILDER_URL) 9 | 10 | # $IMAGEBUILDER_URL can be an environment variable set outside this script 11 | if [ -z "$IMAGEBUILDER_URL" ] ; then 12 | IMAGEBUILDER_URL="https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64.tar.bz2" 13 | # IMAGEBUILDER_URL="https://downloads.openwrt.org/snapshots/trunk/ramips/generic/OpenWrt-ImageBuilder-ramips-rt305x.Linux-x86_64.tar.bz2" 14 | # Caution: Snapshots are unstable 15 | fi 16 | 17 | cd $(dirname $(readlink -f $0)) 18 | git submodule update --init 19 | if [ -z "${1:-}" ];then 20 | echo "usage: $0 PROFILE" 21 | echo 22 | HIDE_TRAITS="true" sh $(dirname $(readlink -f $0))/bin/available_profiles 23 | exit 1 24 | fi 25 | PROFILE=$1 26 | if [ ! -e builder/init ]; then 27 | wget --trust-server-names -c "$IMAGEBUILDER_URL" 28 | tar xf $(basename "$IMAGEBUILDER_URL") 29 | mv OpenWrt-*-x86_64 builder 30 | echo "Builder successfully downloaded" 31 | else 32 | echo "Builder already installed, skipping download" 33 | fi 34 | echo 35 | echo "copying generic init:" 36 | cp --remove-destination lib/init builder/init 37 | echo " profile/init -> builder/init" 38 | cp --remove-destination lib/init_overlay builder/init_overlay 39 | echo " profile/init_overlay -> builder/init_overlay" 40 | [ -e builder/overlay ] && echo "removing old overlay" && rm -rf builder/overlay 41 | echo 42 | echo "copying profile:" 43 | ./copy_profile "$PROFILE" 44 | 45 | if [ -e builder/overlay ];then 46 | echo 47 | echo "This profile also contains overlay data," 48 | echo 'run `builder/init_overlay` to copy' 49 | fi 50 | -------------------------------------------------------------------------------- /profiles/anonabox: -------------------------------------------------------------------------------- 1 | core 2 | core/firstrun 3 | minimal/no-ppp 4 | network/open-wifi-ap 5 | network/eth-dhcp 6 | network/tor 7 | -------------------------------------------------------------------------------- /profiles/arduino: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | minimal/no-iptables 5 | minimal/no-ipv6 6 | minimal/no-firewall 7 | network/client-mode 8 | network/avahi 9 | special_purpose/arduino 10 | -------------------------------------------------------------------------------- /profiles/captive: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-ipv6 4 | network/client-mode 5 | network/avahi 6 | network/captive 7 | -------------------------------------------------------------------------------- /profiles/dali_master: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | special_purpose/dali 6 | special_purpose/dali_web 7 | krebs/infest 8 | -------------------------------------------------------------------------------- /profiles/easybox_simulator: -------------------------------------------------------------------------------- 1 | core/firstrun 2 | minimal/no-ppp 3 | network/wifi-dhcp 4 | gui/luci/uhttpd 5 | special_puropose/easybox_simulator 6 | -------------------------------------------------------------------------------- /profiles/heckenkrebs: -------------------------------------------------------------------------------- 1 | core 2 | core/firstrun 3 | minimal/no-ppp 4 | minimal/no-dnsmasq 5 | network/client-mode 6 | network/wifi-client 7 | network/interactive-tools 8 | network/autoconnect/autostart 9 | krebs/infest 10 | krebs/ssh_keys 11 | -------------------------------------------------------------------------------- /profiles/homepass: -------------------------------------------------------------------------------- 1 | # Nintendo Zone profile for TLWR703 2 | # 3 | # to make it a bit more secure we will use everything in our might to protect 4 | # the open wifi: 5 | # * run all traffic through tor 6 | # * protect ssh and http ports via firewall 7 | core 8 | core/firstrun 9 | minimal/no-ppp 10 | # eth0:dhcp-client 11 | network/eth-dhcp 12 | # configure wifi access point 13 | network/tor/wifi-homepass 14 | 15 | # configure br-tor 16 | network/tor/wifi-static-br-tor 17 | # configure nat-ing for br-tor, enable tor daemon 18 | network/tor/torrouter 19 | 20 | # enable remote management 21 | network/firewall/wan-open 22 | # enable luci for easier management 23 | gui/luci 24 | gui/luci/uhttpd 25 | -------------------------------------------------------------------------------- /profiles/instacam: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | special_purpose/instacam 6 | special_purpose/instacam/uvc 7 | -------------------------------------------------------------------------------- /profiles/krebs: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | krebs 6 | -------------------------------------------------------------------------------- /profiles/madplayer: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | audio/madplay 6 | -------------------------------------------------------------------------------- /profiles/mpd: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-ipv6 4 | minimal/no-dnsmasq 5 | minimal/no-iptables 6 | minimal/no-firewall 7 | network/client-mode 8 | audio/mpd 9 | -------------------------------------------------------------------------------- /profiles/netem: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | minimal/no-iptables 5 | minimal/no-ipv6 6 | minimal/no-firewall 7 | network/client-mode 8 | network/avahi 9 | network/netem 10 | -------------------------------------------------------------------------------- /profiles/nfc_login: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | usb 6 | mods/vfd_lcd 7 | special_purpose/nfc_login 8 | krebs/infest 9 | -------------------------------------------------------------------------------- /profiles/overlay_krebs: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | usb/root_overlay 6 | krebs/infest 7 | -------------------------------------------------------------------------------- /profiles/pyserial: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | minimal/no-iptables 5 | minimal/no-ipv6 6 | minimal/no-firewall 7 | network/client-mode 8 | special_purpose/pyserial 9 | -------------------------------------------------------------------------------- /profiles/radio: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | minimal/no-iptables 5 | minimal/no-ipv6 6 | minimal/no-firewall 7 | network/client-mode 8 | audio/radio 9 | -------------------------------------------------------------------------------- /profiles/rickroller_advanced: -------------------------------------------------------------------------------- 1 | core/firstrun 2 | minimal/no-ppp 3 | network/open-wifi-ap 4 | usb/root_overlay 5 | usb/root_overlay/install_overlay_packages 6 | network/aircrack-overlay 7 | special_purpose/rickroller 8 | special_purpose/rickroller/advanced 9 | krebs/ssh_keys 10 | -------------------------------------------------------------------------------- /profiles/rickroller_bare: -------------------------------------------------------------------------------- 1 | core/firstrun 2 | minimal/no-ppp 3 | network/open-wifi-ap 4 | special_purpose/rickroller/uhttpd 5 | -------------------------------------------------------------------------------- /profiles/shack_bridge: -------------------------------------------------------------------------------- 1 | core 2 | core/firstrun 3 | minimal/no-ppp 4 | private/shack_maintenancenet 5 | network/eth-wifi-nat 6 | krebs/infest 7 | -------------------------------------------------------------------------------- /profiles/shack_dali: -------------------------------------------------------------------------------- 1 | core 2 | core/firstrun 3 | minimal/no-ppp 4 | minimal/no-dnsmasq 5 | network/client-mode 6 | private/shack_maintenancenet 7 | special_purpose/dali 8 | -------------------------------------------------------------------------------- /profiles/shack_instacam: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | network/client-mode 5 | special_purpose/instacam 6 | special_purpose/instacam/uvc 7 | private/shack_maintenancenet 8 | -------------------------------------------------------------------------------- /profiles/shack_streamer: -------------------------------------------------------------------------------- 1 | core 2 | core/firstrun 3 | minimal/no-ppp 4 | minimal/no-dnsmasq 5 | network/client-mode 6 | usb/root_overlay/install_overlay_packages 7 | private/shack_maintenancenet 8 | special_purpose/ffmpeg 9 | -------------------------------------------------------------------------------- /profiles/shairport: -------------------------------------------------------------------------------- 1 | core 2 | minimal/no-ppp 3 | minimal/no-dnsmasq 4 | minimal/no-iptables 5 | minimal/no-firewall 6 | network/client-mode 7 | audio/shairport 8 | -------------------------------------------------------------------------------- /profiles/superheckenkrebs: -------------------------------------------------------------------------------- 1 | core 2 | core/firstrun 3 | minimal/no-ppp 4 | minimal/no-dnsmasq 5 | network/client-mode 6 | network/interactive-tools 7 | network/autoconnect 8 | network/aircrack-overlay 9 | krebs/infest 10 | krebs/ssh_keys 11 | usb/root_overlay/install_overlay_packages 12 | -------------------------------------------------------------------------------- /profiles/tinc-gateway: -------------------------------------------------------------------------------- 1 | # Tor Router profile 2 | # two network interfaces will be configured (eth0,eth1) 3 | # all tcp traffic will be routed through tor 4 | # 5 | # for a qemu vm : PLATFORM='' IMAGEBUILDER_URL='https://downloads.openwrt.org/chaos_calmer/15.05/x86/64/OpenWrt-ImageBuilder-15.05-x86-64.Linux-x86_64.tar.bz2' ./prepare 6 | core 7 | core/firstrun 8 | minimal/no-ppp 9 | # eth0:dhcp-client 10 | network/eth-dhcp 11 | network/tinc 12 | -------------------------------------------------------------------------------- /profiles/tor-router: -------------------------------------------------------------------------------- 1 | # Tor Router profile for TLWR703 2 | # 3 | # you will need to have a 16mb modded version and edit the following files in 4 | # builder/ 5 | # sed -i 's#Device/tplink-4mlzma#Device/tplink-16mlzma#' target/linux/ar71xx/image/Makefile 6 | # 7 | # 8 | # eth0 is the INTERNET itf 9 | # wlan0 is the transparent tor interface 10 | # 11 | # a build for wr703: PLATFORM='TLWR703' IMAGEBUILDER_URL='https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64.tar.bz2' ./prepare tor-router 12 | core 13 | core/firstrun 14 | minimal/no-ppp 15 | # eth0:dhcp-client 16 | network/eth-dhcp 17 | # configure wifi access point 18 | network/tor/wifi-connecTOR-open 19 | # configure br-tor 20 | network/tor/wifi-static-br-tor 21 | 22 | # configure nat-ing for br-tor, enable tor daemon 23 | network/tor/torrouter 24 | -------------------------------------------------------------------------------- /profiles/tor-router-dual-eth: -------------------------------------------------------------------------------- 1 | # Dual-Ethernet Tor Router profile 2 | # 3 | # two network interfaces will be configured (eth0,eth1) 4 | # all tcp traffic will be routed through tor 5 | # DNS traffic will also be handled by tor 6 | # all other udp/icmp traffic is dropped 7 | # 8 | # Build a qemu vm: 9 | # PLATFORM='' IMAGEBUILDER_URL='https://downloads.openwrt.org/chaos_calmer/15.05/x86/64/OpenWrt-ImageBuilder-15.05-x86-64.Linux-x86_64.tar.bz2' ./prepare 10 | # 11 | # Convert to Virtualbox image: 12 | # VboxManage convertfromraw *-combined-squashfs.img openwrt-torrouter.vdi --format VDI 13 | # 14 | # Convert to qemu QCOW2: 15 | # qemu-img convert openwrt-15.05-x86-64-combined-ext4.img -O qcow2 openwrt-ext4.qcow2 16 | # 17 | core 18 | core/firstrun 19 | minimal/no-ppp 20 | # eth0:dhcp-client 21 | network/eth-dhcp 22 | # eth1: dhcp-server, named 'tor-br' 23 | # configure firewall tor tor itf 24 | network/tor/secondary-eth-static-tor 25 | # configure nat-ing for br-tor, enable tor daemon 26 | network/tor/torrouter 27 | -------------------------------------------------------------------------------- /profiles/tor-router-glinet: -------------------------------------------------------------------------------- 1 | # Tor Router profile 2 | # two eth network interfaces will be configured (eth0,eth1) and one wifi 3 | # interface (wlan0) 4 | # all tcp traffic will be routed through tor (from eth1,wlan0 to eth0) 5 | # 6 | # a build for glinet : PLATFORM='GLINET' IMAGEBUILDER_URL='https://downloads.openwrt.org/chaos_calmer/15.05/ar71xx/generic/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64.tar.bz2' ./prepare tor-router-glinet 7 | core 8 | core/firstrun 9 | minimal/no-ppp 10 | # eth0:dhcp-client 11 | network/eth-dhcp 12 | # eth1: dhcp-server, named 'tor-br' 13 | # configure firewall tor tor itf 14 | network/tor/secondary-eth-static-tor 15 | # configure nat-ing for br-tor, enable tor daemon 16 | network/tor/wifi-connecTOR-open 17 | network/tor/torrouter 18 | 19 | gui/luci 20 | gui/luci/uhttpd 21 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | pkgs.stdenv.mkDerivation rec { 4 | name = "minikrebs-env"; 5 | version = "1.1"; 6 | buildInputs = with pkgs; [ 7 | wget 8 | subversion 9 | gnused 10 | gcc 11 | git 12 | gawk 13 | openssl 14 | bash 15 | which 16 | qemu 17 | ]; 18 | shellHook = '' 19 | HISTFILE=$PWD/.histfile 20 | ''; 21 | } 22 | -------------------------------------------------------------------------------- /traits/.gitignore: -------------------------------------------------------------------------------- 1 | private 2 | -------------------------------------------------------------------------------- /traits/audio/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="kmod-sound-core kmod-usb-audio" 2 | DEPENDS="usb" 3 | -------------------------------------------------------------------------------- /traits/audio/madplay/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="madplay" 2 | DEPENDS="usb" 3 | -------------------------------------------------------------------------------- /traits/audio/mpd/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="alsa-utils mpd-mini -kmod-gpio-button-hotplug -kmod-leds-gpio -kmod-ledtrig-default-on -kmod-ledtrig-netdev -kmod-ledtrig-timer -swconfig -uboot-envtools" 2 | -------------------------------------------------------------------------------- /traits/audio/radio/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="luci-mod-admin-full uhttpd libiwinfo-lua luci-theme-bootstrap alsa-utils madplay coreutils-stty kmod-hid-generic kmod-usb-hid kmod-input-evdev triggerhappy kmod-usb-acm openssh-sftp-server" 2 | -------------------------------------------------------------------------------- /traits/audio/radio/README: -------------------------------------------------------------------------------- 1 | Provides a web radio player. 2 | See doc/radio.md for more information. 3 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/asound.conf: -------------------------------------------------------------------------------- 1 | # We need this line to prevent from stutter on USB sound cards 2 | defaults.dmix."USB-Audio".period_size 2048 3 | 4 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/hotplug.d/button/buttons: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # To handle short and long presses, see http://wiki.openwrt.org/doc/howto/hardware.button 3 | logger $BUTTON 4 | logger $ACTION 5 | if [ $BUTTON = reset -a $ACTION = pressed ]; then 6 | TUNE=$(($(uci get radio.next)+1)) 7 | uci set radio.next=$TUNE 8 | killall madplay 9 | fi 10 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/hotplug.d/usb/usb-audio-radio: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /etc/init.d/radio enabled || exit 0 3 | case "$PRODUCT" in 4 | d8c*) // Only do this if the USB device in question is a C-Media USB audio device 5 | case "$ACTION" in 6 | add) 7 | logger -t button-hotplug Device: $DEVICE / Product: $PRODUCT / Action: $ACTION 8 | logger -t C-Media USB audio device detected, starting Radio 9 | /etc/init.d/radio start 10 | ;; 11 | remove) 12 | logger -t button-hotplug Device: $DEVICE / Product: $PRODUCT / Action: $ACTION 13 | /etc/init.d/radio stop 14 | ;; 15 | esac 16 | ;; 17 | esac 18 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | # ttyATH0::askfirst:/bin/ash --login ### apparently this file gets overwritten? NEED to make sure that this line is commented out 4 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/rc.d/K15radio: -------------------------------------------------------------------------------- 1 | ../init.d/radio -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/rc.d/S94radio: -------------------------------------------------------------------------------- 1 | ../init.d/radio -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Is this too early here? Convert to init.d script 4 | cd '/sys/devices/platform/leds-gpio/leds/tp-link:blue:system/' 5 | echo timer > trigger 6 | echo 50 > delay_on 7 | echo 1950 > delay_off 8 | cd - 9 | 10 | # Without this, I get problems on Unitymedia: 11 | # In /etc/config/network 12 | # option dns '8.8.8.8 8.8.4.4' 13 | # for each network listed there 14 | 15 | # fritzlisten & 16 | 17 | ## If we have an IP address via Ethernet, then we don't need WLAN 18 | #RESULT=$(ifconfig br-lan | grep "inet addr") 19 | #if [ "$RESULT" ] ; then 20 | # wifi down 21 | # rmmod ath9k 22 | # rmmod ath9k_common ath9k_hw ath 23 | # rmmod mac80211 cfg80211 compat aes_generic crypto_algapi 24 | #fi 25 | 26 | exit 0 27 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/ser2net.conf: -------------------------------------------------------------------------------- 1 | 1234:raw:0:/dev/ttyATH0:57600 2 | -------------------------------------------------------------------------------- /traits/audio/radio/files/etc/triggerhappy/triggers.d/radio.conf: -------------------------------------------------------------------------------- 1 | # This is for the "Virtual7.1Ch Sound USB sound card", "C-Media USB Headphone Set", USB vendor 0x0d8c, USB device 0x000c 2 | KEY_VOLUMEDOWN 1 tune down 3 | KEY_VOLUMEUP 1 tune up 4 | KEY_MIN_INTERESTING 1 tune up 5 | KEY_MIN_INTERESTING+KEY_VOLUMEUP 1 speak "up" 6 | KEY_MIN_INTERESTING 2 speak "hold" 7 | 8 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/arduinoflash: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -v 4 | 5 | killall arduinolisten 6 | 7 | export PATH=/tmp/usr/bin/:$PATH 8 | export LD_LIBRARY_PATH=/tmp/usr/lib/:$LD_LIBRARY_PATH 9 | 10 | # GPIO 29 is on "pin" R17-S (south end of resistor 17) 11 | # This is connected to the Arudino reset pin, hence we need to change it from "grounded" to "isolated" 12 | # so that the Arduino can start running 13 | echo 29 > /sys/class/gpio/export 14 | echo out > /sys/class/gpio/gpio29/direction 15 | echo 1 > /sys/class/gpio/gpio29/value # isolated 16 | 17 | if [ -z "$1" ] ; then 18 | URL=http://arduinocodeinone.googlecode.com/svn-history/r2/trunk/Arduino/Blink/applet/Blink.hex 19 | else 20 | URL="$1" 21 | fi 22 | 23 | wget -c "$URL" -O /tmp/_tmp.hex 24 | 25 | # Reset using "pin" R17-S (south end of resistor 17) 26 | echo 0 > /sys/class/gpio/gpio29/value # grounded 27 | sleep 1 # Is needed to make it reliable 28 | echo 1 > /sys/class/gpio/gpio29/value # isolated 29 | avrdude -v -p atmega328p -c arduino -P /dev/ttyATH0 -b 57600 -D -U flash:w:/tmp/_tmp.hex:i || echo "Is another process accessing the port?" 30 | 31 | rm /tmp/_tmp.hex 32 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/arduinolisten: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This assumes a sketch on the Arduino on ttyATH0 that outputs hashes like 7354AEB4 3 | 4 | # GPIO 29 is on "pin" R17-S (south end of resistor 17) 5 | # This is connected to the Arudino reset pin, hence we need to change it from "grounded" to "isolated" 6 | # so that the Arduino can start running 7 | echo 29 > /sys/class/gpio/export 8 | echo out > /sys/class/gpio/gpio29/direction 9 | echo 1 > /sys/class/gpio/gpio29/value # isolated 10 | 11 | stty -F /dev/ttyATH0 cs8 57600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts 12 | 13 | SPEAKER=$(amixer scontrols | head -n 1 | cut -d "'" -f 2) 14 | LAST=0 15 | 16 | volume() 17 | { 18 | if [ "$1" == "up" ] ; then 19 | amixer set "$SPEAKER" 2dB+ 20 | fi 21 | if [ "$1" == "down" ] ; then 22 | amixer set "$SPEAKER" 2dB- 23 | fi 24 | } 25 | 26 | while read LINE; do 27 | LINE=$(echo $LINE | sed -e 's|\n||g' | sed -e 's|\r||g' | sed -e 's|\l||g' ) 28 | LENGTH=$(echo "$LINE" | wc -m) 29 | if [ "$LENGTH" == "9" ] ; then 30 | echo $LINE 31 | THISTIME=$(date +"%s") 32 | COMMAND=$(uci get radio.$LINE.command) 33 | echo $COMMAND 34 | REPEATABLE=$(uci get radio.$LINE.repeat) 35 | echo $REPEATABLE 36 | if [ "$LASTCOMMAND" == "$COMMAND" ] ; then 37 | echo "REPEAT" 38 | if [ "$REPEATABLE" == "1" ] ; then 39 | eval $COMMAND 40 | else 41 | if [ $THISTIME -ge $((LASTTIME+2)) ] ; then # At least 2 seconds between repeats 42 | eval $COMMAND 43 | else 44 | echo "REJECTED THIS REPEAT" 45 | fi 46 | fi 47 | else 48 | eval $COMMAND 49 | fi 50 | LASTCOMMAND=$COMMAND 51 | LASTTIME=$THISTIME 52 | fi 53 | 54 | done < /dev/ttyATH0 55 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/arduinoreset: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # GPIO 29 is on "pin" R17-S (south end of resistor 17) 4 | # This is connected to the Arudino reset pin, hence we need to change it from "grounded" to "isolated" 5 | # so that the Arduino can start running 6 | echo 29 > /sys/class/gpio/export 7 | echo out > /sys/class/gpio/gpio29/direction 8 | echo 1 > /sys/class/gpio/gpio29/value # isolated 9 | 10 | echo 0 > /sys/class/gpio/gpio29/value # grounded 11 | sleep 1 12 | echo 1 > /sys/class/gpio/gpio29/value # isolated 13 | sleep 1 14 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/fritzlisten: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Tell the who the caller is 5 | # whenever the Fritz!Box receives a call 6 | # based on reverse lookup 7 | # TODO: Also use the Fritz!Box address book 8 | # 9 | 10 | FRITZBOX=192.168.178.30 11 | 12 | ############################## 13 | 14 | nc $FRITZBOX 1012 | while read LINE; do 15 | echo "Got: $LINE" 16 | case $LINE in 17 | *RING*) 18 | 19 | RUFNR=$(echo $LINE | cut -d ";" -f 4) 20 | 21 | FOUND="" 22 | FOUND=$(wget -q -O - "http://www.dasoertliche.de/Controller?form_name=search_inv&ph=$RUFNR" | grep getItemData) 23 | ORTSNETZ="" 24 | 25 | if [ "" == "$FOUND" ] ; then 26 | ORTSNETZ=$(wget -q -O - "http://www.teltarif.de/festnetz/vorwahl/orte.html?nach=$RUFNR&land=1" | grep -e "<\/B><\/TD>" | grep EEEEEE | head -n 1 | cut -d "<" -f 6 | cut -d ">" -f 2) 27 | speak "Anruf aus $ORTSNETZ. - Ich wiederhole: Anruf aus $ORTSNETZ." 28 | else 29 | # PLZ=$(echo $FOUND | cut -d "'" -f 8) 30 | ORT=$(echo $FOUND | cut -d "'" -f 10) 31 | NAME$(echo $FOUND | cut -d "'" -f 12) 32 | # STRASSE=$(echo $FOUND | cut -d "'" -f 14) 33 | # HAUSNR=$(echo $FOUND | cut -d "'" -f 16) 34 | speak "Anruf von $NAME aus $ORT. - Ich wiederhole: Anruf von $NAME aus $ORT." 35 | fi 36 | ;; 37 | esac 38 | done 39 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/metaebene: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Search for episodes on Metaebene and play the first result 5 | # 6 | 7 | wget -U "" "http://metaebene.me/updates/" -O /tmp/_html 8 | SNIP=$(grep -o -e "thumbnail.*" /tmp/_html | head -n 1) 9 | URL=$(echo $SNIP | cut -d '"' -f 3) 10 | wget -U "" "$URL" -O /tmp/_html 11 | MP3=$(grep -r "og:audio.*.mp3" /tmp/_html | head -n 1 | cut -d '"' -f 4) 12 | wget -U "" "$MP3" -O - | madplay - 13 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/package-local: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # This script will one day generate an installable OpenWRT package 5 | # from all locally changed files on the running OpenWRT system that are not 6 | # known (keep) conf files. This is useful in rapid (scripting) development. 7 | # Currently it "just" creates 2 tar.gz files 8 | # 9 | 10 | cd /overlay 11 | opkg list-changed-conffiles > /tmp/excludes 12 | find /lib/upgrade/keep.d -type f -exec cat {} \; | grep -v "#" >> /tmp/excludes 13 | tar cvz -X /tmp/excludes -f /tmp/overlay.tar.gz * 2>/dev/null 14 | tar cvz -T /tmp/excludes -f /tmp/overlay-excluded.tar.gz 2>/dev/null 15 | rm /tmp/excludes 16 | cd - 17 | ls -lh /tmp/overlay*tar.gz 18 | 19 | exit 0 20 | 21 | ################################################################################## 22 | # Now create the ipkg (untested, probably buggy) 23 | # For this, "ar" would need to be installed (package binutils is relatively large) 24 | ################################################################################## 25 | 26 | mkdir -p /tmp/_ipkg/CONTROL 27 | 28 | cat > /tmp/_ipkg/CONTROL/control <<\EOF 29 | Package: custom-scripts 30 | Version: 0.1 31 | Description: Custom scripts 32 | Architecture: all 33 | Section: extra 34 | Priority: optional 35 | Maintainer: user 36 | Homepage: 37 | Depends: busybox 38 | Source: Inside this file 39 | EOF 40 | 41 | cd /tmp/_ipkg/CONTROL 42 | tar cvz -f /tmp/_ipkg/control.tar.gz * 2>/dev/null 43 | cd - 44 | 45 | mv /tmp/overlay.tar.gz /tmp/_ipkg/data.tar.gz 46 | 47 | echo "2.0" > /tmp/_ipkg/debian-binary 48 | 49 | ar -r /tmp/custom-scripts.ipk ./debian-binary ./data.tar.gz ./control.tar.gz 50 | 51 | rm -rf /tmp/_ipkg 52 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/play: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | wget -U "" "$1" -O - | \ 4 | madplay --fade-in=0.1 -a +10 -o wave:- - | aplay -Dplug:dmix 5 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/simplesleep: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MINS=90 4 | SECS=$(($MINS*60)) 5 | # SECS=60 ### For testing 6 | 7 | NUM=$( ps | grep "sleep $SECS" | wc -l ) 8 | echo $NUM 9 | 10 | # Only if we are not already in the sleep state, we start to sleep 11 | if [ $NUM == 1 ]; then 12 | # Sleep in the subshell 13 | ( sleep $SECS && /etc/init.d/radio stop ) & 14 | fi 15 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/sleeptimer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Find all PIDs of processes with the same name as myself 4 | PIDS=$(echo $(pidof $(basename $0))) 5 | echo $PIDS 6 | 7 | # Find my PID 8 | MYPID=$(echo $PIDS | cut -d " " -f 2) 9 | echo $MYPID 10 | 11 | # Kill all PIDs of processes with the name name that are not myself 12 | for PID in $PIDS ; do 13 | if [ "$PID" != "$MYPID" ] ; then 14 | echo kill $PID 15 | kill -9 $PID >/dev/null 2>&1 16 | fi 17 | done 18 | 19 | # Not clean 20 | killall sleep 21 | 22 | # Calculate seconds 23 | MINS=$(uci get radio.sleeptimer || echo 0) 24 | if [ $MINS -gt 100 ] ; then 25 | MINS=0 26 | fi 27 | NEWMINS=$(($MINS+15)) 28 | uci set radio.sleeptimer=$NEWMINS 29 | NEWSECS=$(($NEWMINS*60)) 30 | speak "Schaltee ab in $NEWMINS Minuten" 31 | 32 | # Sleep for certain time, then switch USB power off 33 | # (if we have set up everything correctly, this stops playback 34 | # and sends shutdown IR signal to external devices) 35 | sleep $NEWSECS ; echo 0 > /sys/class/gpio/gpio8/value 36 | 37 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/speak: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SPEAKER=$(amixer scontrols | head -n 1 | cut -d "'" -f 2) 4 | VOLUME=$(amixer get $SPEAKER | grep "\[" | head -n 1 | cut -d "[" -f 2 | cut -d "]" -f 1) 5 | 6 | # Pause any running madplay 7 | kill -SIGSTOP $(pidof madplay) 8 | sleep 1 9 | 10 | # Increase overall volume 11 | amixer sset $SPEAKER 5dB+ 12 | 13 | # FIXME: Can I send this to a different mixer that is not affected by the reduced overall volume? 14 | LANG=$1 15 | shift 16 | TEXT=$(echo "$@" | sed -e 's|\ |+|g') 17 | echo $TEXT 18 | 19 | if [ "$LANG" == "de" ] ; then 20 | VOICE="&VOICE=bits3-hsmm" 21 | fi 22 | 23 | if [ "$LANG" == "en" ] ; then 24 | LANG="en_US" 25 | fi 26 | 27 | URL="http://mary.dfki.de:59125/process?INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&AUDIO=WAVE_FILE&LOCALE=$LANG$VOICE&INPUT_TEXT=$TEXT" 28 | echo $URL 29 | 30 | wget -U "" "$URL" -O - | aplay -Dplug:dmix 31 | 32 | # Set back to original volume 33 | amixer sset $SPEAKER $VOLUME 34 | 35 | # Continue any running madplay 36 | kill -SIGCONT $(pidof madplay) 37 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/tune: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [[ $# -eq 0 ]] ; then 4 | echo "Usage: $0 up|down|channel" 5 | exit 0 6 | fi 7 | 8 | case "$1" in 9 | up) uci set radio.next=$(($(uci get radio.next)+1)) ;; 10 | down) uci set radio.next=$(($(uci get radio.next)-1)) ;; 11 | *) exit 1 ;; 12 | esac 13 | 14 | killall -9 wget 15 | killall -9 madplay 16 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/bin/wifionoff: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | SW=$(uci -q get wireless.@wifi-device[0].disabled) 3 | [ "$SW" == "1" ] && uci set wireless.@wifi-device[0].disabled=0 4 | [ "$SW" == "1" ] || uci set wireless.@wifi-device[0].disabled=1 5 | wifi 6 | 7 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/lib/lua/luci/controller/myapp/mymodule.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Install to 3 | /usr/lib/lua/luci/controller/myapp/mymodule.lua 4 | ]]-- 5 | 6 | module("luci.controller.myapp.mymodule", package.seeall) 7 | 8 | function index() 9 | 10 | -- Create a new item in the main menu bar 11 | entry({"admin", "radio"}, cbi("myapp-mymodule/radio"), _("Radio"), 21).dependent = true 12 | 13 | -- Attach the submenus to the main menu item 14 | entry({"admin", "radio", "stations"}, cbi("myapp-mymodule/radio"), "Radio stations", 30).dependent=true 15 | entry({"admin", "radio", "remote"}, cbi("myapp-mymodule/remote"), "Radio remote control", 31).dependent=true 16 | 17 | -- entry({"click", "here", "now"}, call("action_tryme"), "Click here", 10).dependent=false 18 | -- entry({"my", "new", "template"}, template("myapp-mymodule/helloworld"), "Hello world", 20).dependent=false 19 | 20 | end 21 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/lib/lua/luci/model/cbi/myapp-mymodule/radio.lua: -------------------------------------------------------------------------------- 1 | -- uci config file /etc/config/radio, for this to work 2 | -- there must be a uci file created with "touch /etc/config/radio" 3 | m = Map("radio", "Personal Audio") 4 | 5 | -- Kill madplay when apply is clicked, so that we move to playonce track if we have one set 6 | m.on_after_commit = function(self) 7 | luci.util.exec("killall madplay") 8 | end 9 | 10 | s = m:section(TypedSection, "playonce", "Play once") 11 | s.template = "cbi/tblsection" 12 | 13 | s.addremove = true -- Allow the user to create and remove playonce instances 14 | 15 | p = s:option(ListValue, "type", "Type") 16 | p:value("mp3", "MP3") 17 | p:value("song", "Song") 18 | p.default = "mp3" 19 | 20 | url = s:option(Value, "url", "URL", "The http:// address of the mp3") 21 | function url:validate(value) 22 | return value:match("http://.*") 23 | end 24 | url:depends("type", "mp3") 25 | 26 | so = s:option(Value, "title", "Song title", "The name of the song") 27 | so:depends("type", "song") 28 | 29 | s = m:section(TypedSection, "station", "Stations") 30 | s.template = "cbi/tblsection" 31 | function s:filter(value) 32 | return value ~= "next" and value -- Don't touch variable "radio.next" 33 | end 34 | 35 | s.addremove = true -- Allow the user to create and station instances 36 | 37 | p = s:option(ListValue, "type", "Station type") 38 | p:value("mp3", "MP3 stream") 39 | p:value("pls", "M3U/PLS playlist") 40 | p:value("rss", "Podcast Feed") 41 | p.default = "mp3" 42 | 43 | url = s:option(Value, "url", "Stream URL", "The http:// address of the stream") 44 | function url:validate(value) 45 | return value:match("http://.*") 46 | end 47 | 48 | p = s:option(ListValue, "sidtype", "Station ID type") 49 | p:value("jingle", "Jingle") 50 | p:value("spoken", "Spoken") 51 | p.default = "jingle" 52 | 53 | sidurl = s:option(Value, "sidurl", "Station ID URL", "The http:// address of the station ID (jingle)") 54 | sidurl:depends("sidtype", "jingle") 55 | function sidurl:validate(value) 56 | return value:match("http://.*") 57 | end 58 | 59 | p = s:option(ListValue, "lang", "Language") 60 | p:value("de", "German") 61 | p:value("en_US", "English (US)") 62 | p.default = "de" 63 | p:depends("sidtype", "spoken") 64 | 65 | n = s:option(Value, "speakname", "Speakable station name", "This spoken as the station ID if no jingle is present") 66 | n:depends("sidtype", "spoken") 67 | 68 | luci.util.exec("/etc/init.d radio start") 69 | 70 | return m -- Returns the map 71 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/lib/lua/luci/model/cbi/myapp-mymodule/remote.lua: -------------------------------------------------------------------------------- 1 | -- uci config file /etc/config/radio, for this to work 2 | -- there must be a uci file created with "touch /etc/config/radio" 3 | m = Map("radio", "Radio") 4 | 5 | s = m:section(TypedSection, "rcc", "Remote Control Codes") 6 | s.template = "cbi/tblsection" 7 | function s:filter(value) 8 | return value ~= "next" and value -- Don't touch variable "radio.next" 9 | end 10 | 11 | s.addremove = true -- Allow the user to create and remove stations 12 | 13 | p = s:option(ListValue, "repeat", "Key type") 14 | p:value("0", "Not repeatable") 15 | p:value("1", "Repeatable (e.g., volume keys)") 16 | p.default = "0" 17 | 18 | n = s:option(Value, "command", "Command", "The command to be executed when this command is received") 19 | 20 | luci.util.exec("/etc/init.d/radio start") 21 | 22 | return m -- Returns the map 23 | -------------------------------------------------------------------------------- /traits/audio/radio/files/usr/lib/lua/luci/view/themes/openwrt.org/footer.htm: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /traits/audio/radio/files/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /traits/audio/shairport/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="alsa-utils shairport -6relayd -ip6tables -opkg -kmod-gpio-button-hotplug -kmod-leds-gpio -kmod-ledtrig-default-on -kmod-ledtrig-netdev -kmod-ledtrig-timer -swconfig -uboot-envtools" 2 | -------------------------------------------------------------------------------- /traits/core/files/etc/dropbear/authorized_keys: -------------------------------------------------------------------------------- 1 | /root/.ssh/authorized_keys -------------------------------------------------------------------------------- /traits/core/files/etc/shadow: -------------------------------------------------------------------------------- 1 | root:$1$WFDw.yoc$MuPQ4h/nu3WMpHmte5Yrp/:15719:0:99999:7::: 2 | daemon:*:0:0:99999:7::: 3 | ftp:*:0:0:99999:7::: 4 | network:*:0:0:99999:7::: 5 | nobody:*:0:0:99999:7::: 6 | -------------------------------------------------------------------------------- /traits/core/files/usr/bin/all_led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | action=${1?\$1 must be ACTION (none|default-on|timer|...)} 3 | find /sys/class/leds/ -maxdepth 1 -mindepth 1 | while read led;do 4 | led ${led##/sys/class/leds/} $action 5 | done 6 | 7 | -------------------------------------------------------------------------------- /traits/core/files/usr/bin/genhostid: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | dd if=/dev/urandom bs=1 count=4> /etc/hostid 3 | -------------------------------------------------------------------------------- /traits/core/files/usr/bin/led: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LED="$1" 3 | ACTION="$2" 4 | echo $ACTION > /sys/class/leds/$LED/trigger 5 | -------------------------------------------------------------------------------- /traits/core/firstrun/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | /usr/bin/firstrun 2 | -------------------------------------------------------------------------------- /traits/core/firstrun/files/usr/bin/firstrun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | if [ -e /etc/firstrun.d/ -a ! -e /etc/firstrun.complete ];then 5 | find /etc/firstrun.d/ -type f | grep -v '.complete$' | while read cmd; do 6 | [ ! -e ${cmd}.complete ] || continue 7 | if sh "$cmd" 2>&1 >/root/firstrun.log ;then 8 | logger "$cmd successful" 9 | touch ${cmd}.complete 10 | else 11 | logger "$cmd failed, bailing out!" 12 | exit 1 13 | fi 14 | done 15 | touch /etc/firstrun.complete 16 | fi 17 | -------------------------------------------------------------------------------- /traits/core/firstrun/files/usr/lib/firstrun.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -euf 3 | get_ifnames_for_phy () { 4 | itf=$1 5 | uci show network | grep ifname | grep "'$itf'" \ 6 | | cut -d. -f 2| while read -r ifname; do 7 | echo "$ifname" 8 | done 9 | } 10 | clear_interface_config (){ 11 | # TODO: maybe just remove the interface from the configured networks? 12 | # itf: the real,physical interface 13 | itf="${1?must provide interface to clear config for}" 14 | get_ifnames_for_phy "$itf" | while read -r ifname; do 15 | uci delete network."$ifname" 16 | # TODO: maybe clear_dhcp_config $ifname 17 | # TODO: maybe clear_firewall_zone 18 | # returns the original luci interface name 19 | echo "$ifname" 20 | done 21 | } 22 | 23 | clear_dhcp_config() { 24 | ifname=$1 25 | # the network interface name 26 | uci show dhcp | grep interface | grep "'$ifname'" \ 27 | | cut -d. -f 2 | while read -r dhcpname; do 28 | uci delete "dhcp.$dhcpname" || : 29 | done 30 | } 31 | 32 | clear_firewall_zone() { 33 | # use the ifname which gets returned for clear_interface_config 34 | # normally we do not need to remove configured zones 35 | ifname=$1 36 | uci show firewall | grep zone | grep network= \ 37 | | grep "$ifname" | cut -d. -f 2 | while read -r zone;do 38 | zonename=$(uci get firewall."${zone}".name) 39 | uci show firewall | egrep '(src|dest)' | grep "$zonename" \ 40 | | cut -d. -f 1 | while read -r rule; do 41 | uci delete firewall."${rule}" 42 | done 43 | done 44 | } 45 | -------------------------------------------------------------------------------- /traits/gui/luci/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="luci" 2 | -------------------------------------------------------------------------------- /traits/gui/luci/uhttpd/README: -------------------------------------------------------------------------------- 1 | Starts LUCI via uhttpd 2 | -------------------------------------------------------------------------------- /traits/gui/luci/uhttpd/files/etc/uci-defaults/50_enable_luci: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | /etc/init.d/uhttpd enable 3 | /etc/init.d/uhttpd start 4 | -------------------------------------------------------------------------------- /traits/krebs/infest/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="tinc" 2 | DEPENDS="core/firstrun" 3 | -------------------------------------------------------------------------------- /traits/krebs/infest/README: -------------------------------------------------------------------------------- 1 | The base Krebs Trait 2 | =================== 3 | - installs and auto-boots tinc-retiolum 4 | -------------------------------------------------------------------------------- /traits/krebs/infest/TODO: -------------------------------------------------------------------------------- 1 | Infest after autoconnection by autowifi is completed 2 | -------------------------------------------------------------------------------- /traits/krebs/infest/files/etc/config/system: -------------------------------------------------------------------------------- 1 | config system 2 | option hostname krebsplug 3 | option timezone UTC 4 | -------------------------------------------------------------------------------- /traits/krebs/infest/files/etc/firstrun.d/5krebs_tinc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cat >> /etc/rc.local </dev/null 2>/&1 ; then (wget -O- http://euer.krebsco.de/retiolum/supernodes.tar.gz | tar xz -C /etc/tinc/retiolum/hosts/);fi 4 | fi 5 | -------------------------------------------------------------------------------- /traits/krebs/ssh_keys/files/root/.ssh/authorized_keys: -------------------------------------------------------------------------------- 1 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl3RTOHd5DLiVeUbUr/GSiKoRWknXQnbkIf+uNiFO+XxiqZVojPlumQUVhasY8UzDzj9tSDruUKXpjut50FhIO5UFAgsBeMJyoZbgY/+R+QKU00Q19+IiUtxeFol/9dCO+F4o937MC0OpAC10LbOXN/9SYIXueYk3pJxIycXwUqhYmyEqtDdVh9Rx32LBVqlBoXRHpNGPLiswV2qNe0b5p919IGcslzf1XoUzfE3a3yjk/XbWh/59xnl4V7Oe7+iQheFxOT6rFA30WYwEygs5As//ZYtxvnn0gA02gOnXJsNjOW9irlxOUeP7IOU6Ye3WRKFRR0+7PS+w8IJLag2xb makefu@servarch 2 | ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3SFNYGRiH0oz44G51MWx+o4cC3Fj+ez5DKO5jjtEFZ0ik8XQ5CrVj7a87WbwABA/XRdIt+3WHoInsRmuDfgcIMYgWC567v2GdOxXg2danEIAhhsOY7KiCBLCfZz7lrFO7F6eJH1RCkwrXY+59hkA+i3LNtLmZazJIb2AGwFF8Xf+b/eWmLhqjCYON+OpvqftbCm9CwhLYOUcVoR94gFAzlMYSCHR7RuBBdLV6zrkmEwFEsKghBI7fcdhwfQxuV5UGVCD58KkTQTgK/Mf2tmAg/muBM+P8s2O6wVbtixmIiiDxfc99C3QD1MYVNHqWgV1Rz9JKfmyuVvFqn7TRuuT1 tv@also 3 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtDhAxjiCH0SmTGNDqmlKPug9qTf+IFOVjdXfk01lAV2KMVW00CgNo2d5kl5+6pM99K7zZO7Uo7pmSFLSCAg8J6cMRI3v5OxFsnQfcJ9TeGLZt/ua7F8YsyIIr5wtqKtFbujqve31q9xJMypEpiX4np3nLiHfYwcWu7AFAUY8UHcCNl4JXm6hsmPe+9f6Mg2jICOdkfMMn0LtW+iq1KZpw1Nka2YUSiE2YuUtV+V+YaVMzdcjknkVkZNqcVk6tbJ1ZyZKM+bFEnE4VkHJYDABZfELpcgBAszfWrVG0QpEFjVCUq5atpIVHJcWWDx072r0zgdTPcBuzsHHC5PRfVBLEw== makefu@arch 4 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAp83zynhIueJJsWlSEykVSBrrgBFKq38+vT8bRfa+csqyjZBl2SQFuCPo+Qbh49mwchpZRshBa9jQEIGqmXxv/PYdfBFQuOFgyUq9ZcTZUXqeynicg/SyOYFW86iiqYralIAkuGPfQ4howLPVyjTZtWeEeeEttom6p6LMY5Aumjz2em0FG0n9rRFY2fBzrdYAgk9C0N6ojCs/Gzknk9SGntA96MDqHJ1HXWFMfmwOLCnxtE5TY30MqSmkrJb7Fsejwjoqoe9Y/mCaR0LpG2cStC1+37GbHJNH0caCMaQCX8qdfgMVbWTVeFWtV6aWOaRgwLrPDYn4cHWQJqTfhtPrNQ== death@Uriel 5 | ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQB2G4SpJ/UYxmTidUl8ytT6bdNGTdYvv2nmhQyaFBroNit3xdDOVxKvaMEGDuR6ncRugw5BBvrv6iPMTCFluHJxjuh6lk3JrrsJ8CT22ZOGsA593hRoXZOCrs5SxcFkw9EBiCuaHHlWiS9+Dffr6/zpkhH3djTz05uGnDrvtKuV/Zmu5XHAurNn+X3C5S/zk/y0n8o62iSQHVKeNBGO2WYhVce9d65Ucek5dOvXZYVKSe1LeAOKyeHWv+VWP8QlObmfVrQ5l1Pou6WV6Wpo85KBa/mmBJIygC9rrG+gx/1LX7JxStbCu/WoUlUwkSaP2qxWaET9KaSO8+2Wrg5i34ax== samuel@localhost 6 | ssh-dss AAAAB3NzaC1kc3MAAACBAJE2uV+hM74kPr6IwIp5sDKBmbwDnugLxail3MeVCSPtoLLJ9fRj/HBissAubX2/20d3jPkV5DjipWJGZCxMuNl9pEDrlxL/jOp1HERoq0hj7XdIj/ka+wmLKWU9mLu3gX77M/QzrcpDNBrhYX8FePBHgMZr/gXap2raDZBAE8CjAAAAFQD4QaW+3N07Mvfh1yC/WVsEZ+6nUwAAAIAiQvhzUWUNon5e+UZlvGBlFV8B0isLDf87qxUZHRY0siSSXIlekEtAB0i4aXEVtBOJwsDdJjrCygoBtKT6VMsWCrXnAqvVAd3oVl9YeZ7R4zDPpWTYhERagTFla8yBEOTvEdHZ6Lfn72RDg0IDSnofdMzs6XwlD7c6uo6dRZ7+zgAAAIEAhakAD84QgbPRCwvRBVs4HAbnWps8GTQQx7WN2FC8Twv+Gkltha2RZtD7Artcm7d79kofiGax2NQrrzFKY1/gsBuIe15XhNiLpVqdSj3aK/LRRoNNOOCWvc6uQWXEN7gOVE8JTXyi+RDvzeP4Fn9jp+Ub6OGvWvsaBb9Z6IyfTHo= momo 7 | -------------------------------------------------------------------------------- /traits/minimal/README: -------------------------------------------------------------------------------- 1 | # Minimal Modules 2 | 3 | These modules actually remove specific traits in order to shrink the profiles 4 | in size. 5 | -------------------------------------------------------------------------------- /traits/minimal/no-dnsmasq/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="-dnsmasq -radvd -odhcpd" 2 | -------------------------------------------------------------------------------- /traits/minimal/no-firewall/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="-firewall" 2 | -------------------------------------------------------------------------------- /traits/minimal/no-iptables/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="-kmod-ipt-nat -kmod-ipt-nathelper -kmod-ipt-conntrack -iptables -kmod-nf-ipt6 -kmod-nf-nathelper-extra -kmod-nf-nat -kmod-nf-conntrack -kmod-nf-nat6 -kmod-nf-ipt -kmod-nf-nathelper -kmod-nf-conntrack6 -kmod-nf-conntrack-netlink" 2 | -------------------------------------------------------------------------------- /traits/minimal/no-ipv6/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="-kmod-ipv6 -6relayd -ip6tables -odhcp6c" 2 | -------------------------------------------------------------------------------- /traits/minimal/no-ppp/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES=" -kmod-ppp -kmod-pppoe -kmod-pppox -ppp -ppp-mod-pppoe" 2 | -------------------------------------------------------------------------------- /traits/mods/vfd_lcd/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="coreutils-stty" 2 | -------------------------------------------------------------------------------- /traits/mods/vfd_lcd/README: -------------------------------------------------------------------------------- 1 | # LCD 2 | This mod adds a VFD LCD to the uart port of your minikrebs. 3 | The following Pinout is required on the LCD: 4 | 5 | Using Blue Connector: 6 | - 1 - 5V 7 | - 3 - RX 8 | - 4 - GND 9 | 10 | The Following Pins can be used on the MR3020: 11 | 12 | - TX from UART connector 13 | - 5V from USB-Connector 14 | - GND from slide switch 15 | -------------------------------------------------------------------------------- /traits/mods/vfd_lcd/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | /usr/bin/lcd-write "This is the Minikrebs Version 84" 2 | -------------------------------------------------------------------------------- /traits/mods/vfd_lcd/files/usr/bin/lcd-write: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PORT=${LCD_PORT:-/dev/ttyATH0} 4 | stty < $PORT | grep -q "9600" || stty -F $PORT 9600 5 | echo > $PORT 6 | echo -n "$@" > $PORT 7 | -------------------------------------------------------------------------------- /traits/network/3g/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="comgt usb-modeswitch kmod-usb-serial" 2 | # comgt chat 3 | # usb-modeswitch libusb 4 | # kmod-usb-serial might only be needed for (k5005 12d1:14c3 ) 5 | # probably kmod-usb-serial-wwan 6 | # see: http://wiki.openwrt.org/doc/recipes/3gdongle 7 | # http://oleniner.blogspot.de/2011/11/tp-link-3420-openwrt-huawei-e398-3g.html 8 | -------------------------------------------------------------------------------- /traits/network/aircrack-overlay/MANIFEST: -------------------------------------------------------------------------------- 1 | OVERLAY_PACKAGES="aircrack-ng libopenssl libpcap libpthread zlib libsqlite3 reaver kmod-tun ip wireless-tools" 2 | -------------------------------------------------------------------------------- /traits/network/autoconnect/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="coreutils-readlink wpa-cli" 2 | DEPENDS="network/client-mode network/interactive-tools" 3 | -------------------------------------------------------------------------------- /traits/network/autoconnect/TODO: -------------------------------------------------------------------------------- 1 | * make a special branch for autowifi for openwrt as long as it is horribly 2 | broken 3 | -------------------------------------------------------------------------------- /traits/network/autoconnect/autostart/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="" 2 | DEPENDS="core/firstrun" 3 | -------------------------------------------------------------------------------- /traits/network/autoconnect/autostart/files/etc/firstrun.d/30_autostart_autowifi: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | echo '/usr/bin/autowifi &' >> /etc/rc.local 3 | -------------------------------------------------------------------------------- /traits/network/autoconnect/docs/wpa_supplicant_wps_logs: -------------------------------------------------------------------------------- 1 | # working 2 | wlan0: Trying to associate with 14:cf:92:87:10:74 (SSID='hardbox' freq=2437 MHz) 3 | wlan0: Association request to the driver failed 4 | wlan0: Associated with 14:cf:92:87:10:74 5 | wlan0: CTRL-EVENT-EAP-STARTED EAP authentication started 6 | wlan0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1 7 | wlan0: CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected 8 | WPS: Received old AP configuration from AP 9 | wlan0: WPS-CRED-RECEIVED 10 | wlan0: WPS-FAIL msg=11 config_error=0 11 | wlan0: CTRL-EVENT-EAP-FAILURE EAP authentication failed 12 | wlan0: WPS-FAIL 13 | wlan0: CTRL-EVENT-DISCONNECTED bssid=14:cf:92:87:10:74 reason=3 locally_generated=1 14 | ioctl[SIOCSIWFREQ]: Device or resource busy 15 | wlan0: Trying to associate with 14:cf:92:87:10:74 (SSID='hardbox' freq=2437 MHz) 16 | wlan0: Association request to the driver failed 17 | wlan0: Associated with 14:cf:92:87:10:74 18 | wlan0: WPA: Key negotiation completed with 14:cf:92:87:10:74 [PTK=CCMP GTK=TKIP] 19 | wlan0: CTRL-EVENT-CONNECTED - Connection to 14:cf:92:87:10:74 completed [id=0 id_str=] 20 | 21 | # Wrong PIN 22 | ioctl[SIOCSIWFREQ]: Device or resource busy 23 | wlan0: Trying to associate with 14:cf:92:87:10:74 (SSID='hardbox' freq=2437 MHz) 24 | wlan0: Association request to the driver failed 25 | wlan0: Associated with 14:cf:92:87:10:74 26 | wlan0: CTRL-EVENT-EAP-STARTED EAP authentication started 27 | wlan0: CTRL-EVENT-EAP-PROPOSED-METHOD vendor=14122 method=1 28 | wlan0: CTRL-EVENT-EAP-METHOD EAP vendor 14122 method 1 (WSC) selected 29 | wlan0: WPS-FAIL msg=10 config_error=18 30 | wlan0: CTRL-EVENT-EAP-FAILURE EAP authentication failed 31 | wlan0: WPS-FAIL 32 | wlan0: Authentication with 14:cf:92:87:10:74 timed out. 33 | wlan0: CTRL-EVENT-DISCONNECTED bssid=14:cf:92:87:10:74 reason=3 locally_generated=1 34 | 35 | 36 | # Rate Limiting 37 | wlan0: Trying to associate with 14:cf:92:87:10:74 (SSID='hardbox' freq=2437 MHz) 38 | wlan0: Association request to the driver failed 39 | wlan0: Associated with 14:cf:92:87:10:74 40 | wlan0: CTRL-EVENT-EAP-STARTED EAP authentication started 41 | wlan0: CTRL-EVENT-EAP-FAILURE EAP authentication failed 42 | -------------------------------------------------------------------------------- /traits/network/avahi/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="avahi-daemon" 2 | -------------------------------------------------------------------------------- /traits/network/avahi/files/etc/avahi/avahi-daemon.conf: -------------------------------------------------------------------------------- 1 | [server] 2 | # The following line is important, otherwise the daemon will not start up 3 | enable-dbus=no 4 | use-ipv4=yes 5 | use-ipv6=no 6 | check-response-ttl=no 7 | use-iff-running=no 8 | 9 | [publish] 10 | publish-addresses=yes 11 | publish-hinfo=yes 12 | publish-workstation=no 13 | publish-domain=yes 14 | 15 | [reflector] 16 | enable-reflector=no 17 | reflect-ipv=no 18 | 19 | [rlimits] 20 | rlimit-core=0 21 | rlimit-data=4194304 22 | rlimit-fsize=0 23 | rlimit-nofile=30 24 | rlimit-stack=4194304 25 | rlimit-nproc=3 26 | -------------------------------------------------------------------------------- /traits/network/captive/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="luci-mod-admin-full uhttpd libiwinfo-lua luci-theme-bootstrap nano iptables-mod-conntrack-extra firewall luci-app-firewall nodogsplash" 2 | -------------------------------------------------------------------------------- /traits/network/captive/README: -------------------------------------------------------------------------------- 1 | Captive portal 2 | 3 | NOTE: The IP address of the Ethernet interface is hardcoded to 192.168.0.14 in /etc/configuration/network. 4 | You need to change it if you would like to use another address. 5 | 6 | Run 7 | ndsctl status 8 | to see the configuration and the authenticated clients. 9 | 10 | Run 11 | ndsctl deauth 192.168.0.12 12 | to make the user with IP 192.168.0.12 authenticate again (can also use MAC address) 13 | 14 | Start 15 | nodogsplash -f -d 7 16 | to see verbose output 17 | -------------------------------------------------------------------------------- /traits/network/captive/files/etc/config/dhcp: -------------------------------------------------------------------------------- 1 | config dnsmasq 2 | option domainneeded 1 3 | option boguspriv 1 4 | option filterwin2k 0 # enable for dial on demand 5 | option localise_queries 1 6 | option rebind_protection 1 # disable if upstream must serve RFC1918 addresses 7 | option rebind_localhost 1 # enable for RBL checking and similar services 8 | #list rebind_domain example.lan # whitelist RFC1918 responses for domains 9 | option local '/lan/' 10 | option domain 'lan' 11 | option expandhosts 1 12 | option nonegcache 0 13 | # option authoritative 1 14 | option readethers 1 15 | option leasefile '/tmp/dhcp.leases' 16 | option resolvfile '/tmp/resolv.conf.auto' 17 | #list server '/mycompany.local/1.2.3.4' 18 | #option nonwildcard 1 19 | #list interface br-lan 20 | #list notinterface lo 21 | #list bogusnxdomain '64.94.110.11' 22 | list 'server' '8.8.8.8' 23 | list 'server' '8.8.4.4' 24 | 25 | config dhcp lan 26 | # option interface lan 27 | # option start 100 28 | # option limit 150 29 | # option leasetime 12h 30 | option 'ignore' '1' 31 | 32 | config dhcp wan 33 | option interface wan 34 | option ignore 1 35 | 36 | config 'dhcp' 'hotspot' 37 | option 'interface' 'hotspot' 38 | option 'start' '100' 39 | option 'limit' '150' 40 | option 'leasetime' '12h' 41 | 42 | -------------------------------------------------------------------------------- /traits/network/captive/files/etc/config/firewall: -------------------------------------------------------------------------------- 1 | 2 | config defaults 3 | option syn_flood '1' 4 | option input 'ACCEPT' 5 | option output 'ACCEPT' 6 | option forward 'REJECT' 7 | 8 | config zone 9 | option name 'lan' 10 | option input 'ACCEPT' 11 | option output 'ACCEPT' 12 | option forward 'ACCEPT' 13 | option network 'lan' 14 | 15 | config zone 16 | option name 'wan' 17 | option input 'REJECT' 18 | option output 'ACCEPT' 19 | option forward 'REJECT' 20 | option masq '1' 21 | option mtu_fix '1' 22 | option network 'wan wan6' 23 | 24 | config forwarding 25 | option src 'lan' 26 | option dest 'wan' 27 | 28 | config rule 29 | option name 'Allow-DHCP-Renew' 30 | option src 'wan' 31 | option proto 'udp' 32 | option dest_port '68' 33 | option target 'ACCEPT' 34 | option family 'ipv4' 35 | 36 | config rule 37 | option name 'Allow-Ping' 38 | option src 'wan' 39 | option proto 'icmp' 40 | option icmp_type 'echo-request' 41 | option family 'ipv4' 42 | option target 'ACCEPT' 43 | 44 | config rule 45 | option name 'Allow-DHCPv6' 46 | option src 'wan' 47 | option proto 'udp' 48 | option src_ip 'fe80::/10' 49 | option src_port '547' 50 | option dest_ip 'fe80::/10' 51 | option dest_port '546' 52 | option family 'ipv6' 53 | option target 'ACCEPT' 54 | 55 | config rule 56 | option name 'Allow-ICMPv6-Input' 57 | option src 'wan' 58 | option proto 'icmp' 59 | list icmp_type 'echo-request' 60 | list icmp_type 'echo-reply' 61 | list icmp_type 'destination-unreachable' 62 | list icmp_type 'packet-too-big' 63 | list icmp_type 'time-exceeded' 64 | list icmp_type 'bad-header' 65 | list icmp_type 'unknown-header-type' 66 | list icmp_type 'router-solicitation' 67 | list icmp_type 'neighbour-solicitation' 68 | list icmp_type 'router-advertisement' 69 | list icmp_type 'neighbour-advertisement' 70 | option limit '1000/sec' 71 | option family 'ipv6' 72 | option target 'ACCEPT' 73 | 74 | config rule 75 | option name 'Allow-ICMPv6-Forward' 76 | option src 'wan' 77 | option dest '*' 78 | option proto 'icmp' 79 | list icmp_type 'echo-request' 80 | list icmp_type 'echo-reply' 81 | list icmp_type 'destination-unreachable' 82 | list icmp_type 'packet-too-big' 83 | list icmp_type 'time-exceeded' 84 | list icmp_type 'bad-header' 85 | list icmp_type 'unknown-header-type' 86 | option limit '1000/sec' 87 | option family 'ipv6' 88 | option target 'ACCEPT' 89 | 90 | config include 91 | option path '/etc/firewall.user' 92 | 93 | -------------------------------------------------------------------------------- /traits/network/captive/files/etc/config/network: -------------------------------------------------------------------------------- 1 | 2 | config interface 'loopback' 3 | option ifname 'lo' 4 | option proto 'static' 5 | option ipaddr '127.0.0.1' 6 | option netmask '255.0.0.0' 7 | 8 | config interface 'lan0' 9 | option ifname 'eth0' 10 | option proto 'dhcp' 11 | 12 | config interface 'lan1' 13 | option ifname 'eth1' 14 | option proto 'static' 15 | option ipaddr '192.168.0.14' 16 | option netmask '255.255.255.0' 17 | option gateway '192.168.0.1' 18 | 19 | config interface 'hotspot' 20 | option ifname 'wlan0' 21 | option proto 'static' 22 | option ipaddr '192.168.5.1' 23 | option netmask '255.255.255.0' 24 | -------------------------------------------------------------------------------- /traits/network/captive/files/etc/config/wireless: -------------------------------------------------------------------------------- 1 | 2 | config wifi-device 'radio0' 3 | option type 'mac80211' 4 | option channel '11' 5 | option hwmode '11ng' 6 | option path 'platform/ar933x_wmac' 7 | list ht_capab 'SHORT-GI-20' 8 | list ht_capab 'SHORT-GI-40' 9 | list ht_capab 'RX-STBC1' 10 | list ht_capab 'DSSS_CCK-40' 11 | option htmode 'HT20' 12 | 13 | config wifi-iface 14 | option device 'radio0' 15 | option mode 'ap' 16 | option ssid 'hotspot' 17 | option encryption 'none' 18 | # option network 'lan hotspot' 19 | option network 'hotspot' 20 | 21 | -------------------------------------------------------------------------------- /traits/network/captive/files/etc/nodogsplash/nodogsplash.conf: -------------------------------------------------------------------------------- 1 | GatewayInterface wlan0 2 | 3 | FirewallRuleSet authenticated-users { 4 | FirewallRule block to 192.168.0.0/16 5 | FirewallRule block to 10.0.0.0/8 6 | FirewallRule allow tcp port 53 7 | FirewallRule allow udp port 53 8 | FirewallRule allow tcp port 80 9 | FirewallRule allow tcp port 443 10 | FirewallRule allow tcp port 22 11 | } 12 | 13 | FirewallRuleSet preauthenticated-users { 14 | } 15 | 16 | FirewallRuleSet users-to-router { 17 | } 18 | 19 | -------------------------------------------------------------------------------- /traits/network/client-mode/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="announce" 2 | -------------------------------------------------------------------------------- /traits/network/client-mode/files/etc/config/network: -------------------------------------------------------------------------------- 1 | config interface 'loopback' 2 | option ifname 'lo' 3 | option proto 'static' 4 | option ipaddr '127.0.0.1' 5 | option netmask '255.0.0.0' 6 | 7 | config interface 'lan0' 8 | option ifname 'eth0' 9 | option proto 'dhcp' 10 | 11 | config interface 'lan1' 12 | option ifname 'eth1' 13 | option proto 'dhcp' 14 | 15 | config interface 'lan2' 16 | option ifname 'eth0.1' 17 | option proto 'dhcp' 18 | -------------------------------------------------------------------------------- /traits/network/eth-dhcp/README: -------------------------------------------------------------------------------- 1 | Configures DHCP on eth0 2 | -------------------------------------------------------------------------------- /traits/network/eth-dhcp/files/etc/uci-defaults/02_configure_eth_dhcp: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -euf 3 | . /usr/lib/firstrun.sh 4 | itf=eth0 5 | 6 | clear_interface_config $itf 7 | 8 | uci batch < /etc/config/wireless 2 | uci set wireless.@wifi-iface[0].network='lan' 3 | uci set wireless.@wifi-iface[0].mode='ap' 4 | uci set wireless.@wifi-iface[0].encryption='none' 5 | uci set wireless.@wifi-iface[0].ssid='default' 6 | 7 | uci set wireless.@wifi-device[0].disabled=0 8 | uci commit wireless 9 | wifi 10 | -------------------------------------------------------------------------------- /traits/network/tinc/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="tinc" 2 | -------------------------------------------------------------------------------- /traits/network/tor/secondary-eth-static-tor/MANIFEST: -------------------------------------------------------------------------------- 1 | DEPENDS="core/firstrun" 2 | -------------------------------------------------------------------------------- /traits/network/tor/secondary-eth-static-tor/README: -------------------------------------------------------------------------------- 1 | Configures the second ethernet interface to become the new TOR routed network. 2 | All traffic arriving at this network will be routed through tor 3 | -------------------------------------------------------------------------------- /traits/network/tor/secondary-eth-static-tor/files/etc/uci-defaults/02_configure_secondary: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . /usr/lib/firstrun.sh 3 | set -euf 4 | itf=eth1 5 | 6 | clear_interface_config $itf 7 | 8 | uci batch <>/etc/tor/torrc < /etc/config/wireless 2 | uci set wireless.@wifi-iface[0].network='lan' 3 | uci set wireless.@wifi-iface[0].mode='sta' 4 | uci set wireless.@wifi-iface[0].encryption='none' 5 | uci set wireless.@wifi-iface[0].ssid='default' 6 | 7 | uci set wireless.@wifi-device[0].disabled=0 8 | uci commit wireless 9 | wifi 10 | -------------------------------------------------------------------------------- /traits/network/wifi-dhcp/files/etc/firstrun.d/01_configure_bridge: -------------------------------------------------------------------------------- 1 | uci set network.loopback=interface 2 | uci set network.loopback.ifname=lo 3 | uci set network.loopback.proto=static 4 | uci set network.loopback.ipaddr=127.0.0.1 5 | uci set network.loopback.netmask=255.0.0.0 6 | 7 | uci set network.wan=interface 8 | uci set network.wan.ifname=eth0 9 | uci set network.wan.proto=dhcp 10 | 11 | uci set network.lan=interface 12 | uci set network.lan.ifname=wlan0 13 | uci set network.lan.proto=static 14 | uci set network.lan.ipaddr=192.168.211.1 15 | uci set network.lan.netmask=255.255.255.0 16 | 17 | uci commit network 18 | /etc/init.d/network restart 19 | -------------------------------------------------------------------------------- /traits/network/wifibridge/files/etc/config/firewall: -------------------------------------------------------------------------------- 1 | config defaults 2 | option syn_flood 1 3 | option input ACCEPT 4 | option output ACCEPT 5 | option forward REJECT 6 | # Uncomment this line to disable ipv6 rules 7 | # option disable_ipv6 1 8 | 9 | config zone 10 | option name lan 11 | option network 'lan' 12 | option input ACCEPT 13 | option output ACCEPT 14 | option forward REJECT 15 | 16 | config zone 17 | option name wan 18 | option network 'wan' 19 | option input REJECT 20 | option output ACCEPT 21 | option forward REJECT 22 | option masq 1 23 | option mtu_fix 1 24 | 25 | config forwarding 26 | option src lan 27 | option dest wlan 28 | 29 | config forwarding 30 | option src wlan 31 | option dest lan 32 | 33 | # We need to accept udp packets on port 68, 34 | # see https://dev.openwrt.org/ticket/4108 35 | config rule 36 | option name Allow-DHCP-Renew 37 | option src wan 38 | option proto udp 39 | option dest_port 68 40 | option target ACCEPT 41 | option family ipv4 42 | 43 | # Allow IPv4 ping 44 | config rule 45 | option name Allow-Ping 46 | option src wan 47 | option proto icmp 48 | option icmp_type echo-request 49 | option family ipv4 50 | option target ACCEPT 51 | 52 | # Allow DHCPv6 replies 53 | # see https://dev.openwrt.org/ticket/10381 54 | config rule 55 | option name Allow-DHCPv6 56 | option src wan 57 | option proto udp 58 | option src_ip fe80::/10 59 | option src_port 547 60 | option dest_ip fe80::/10 61 | option dest_port 546 62 | option family ipv6 63 | option target ACCEPT 64 | 65 | # Allow essential incoming IPv6 ICMP traffic 66 | config rule 67 | option name Allow-ICMPv6-Input 68 | option src wan 69 | option proto icmp 70 | list icmp_type echo-request 71 | list icmp_type echo-reply 72 | list icmp_type destination-unreachable 73 | list icmp_type packet-too-big 74 | list icmp_type time-exceeded 75 | list icmp_type bad-header 76 | list icmp_type unknown-header-type 77 | list icmp_type router-solicitation 78 | list icmp_type neighbour-solicitation 79 | list icmp_type router-advertisement 80 | list icmp_type neighbour-advertisement 81 | option limit 1000/sec 82 | option family ipv6 83 | option target ACCEPT 84 | 85 | # Allow essential forwarded IPv6 ICMP traffic 86 | config rule 87 | option name Allow-ICMPv6-Forward 88 | option src wan 89 | option dest * 90 | option proto icmp 91 | list icmp_type echo-request 92 | list icmp_type echo-reply 93 | list icmp_type destination-unreachable 94 | list icmp_type packet-too-big 95 | list icmp_type time-exceeded 96 | list icmp_type bad-header 97 | list icmp_type unknown-header-type 98 | option limit 1000/sec 99 | option family ipv6 100 | option target ACCEPT 101 | 102 | # include a file with users custom iptables rules 103 | config include 104 | option path /etc/firewall.user 105 | -------------------------------------------------------------------------------- /traits/network/wifibridge/files/etc/config/network: -------------------------------------------------------------------------------- 1 | config interface 'loopback' 2 | option ifname 'lo' 3 | option proto 'static' 4 | option ipaddr '127.0.0.1' 5 | option netmask '255.0.0.0' 6 | 7 | config interface 'lan' 8 | option ifname 'eth0' 9 | option type 'bridge' 10 | option proto 'dhcp' 11 | -------------------------------------------------------------------------------- /traits/platforms/README: -------------------------------------------------------------------------------- 1 | Folders which contain configuration like LEDs certain routers 2 | -------------------------------------------------------------------------------- /traits/special_purpose/arduino/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="ser2net coreutils-stty kmod-usb-hid kmod-usb-acm avrdude" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/arduino/README: -------------------------------------------------------------------------------- 1 | Makes an attached Arduino Uno or Mega available to the Arduino 1.5 IDE for programming and accessing the serial console over the network 2 | -------------------------------------------------------------------------------- /traits/special_purpose/arduino/files/etc/avahi/services/arduino.service: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %h 5 | 6 | _arduino._tcp 7 | 80 8 | distro_version=0.1 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /traits/special_purpose/arduino/files/etc/ser2net.conf: -------------------------------------------------------------------------------- 1 | 1234:raw:0:/dev/ttyATH0:57600 2 | -------------------------------------------------------------------------------- /traits/special_purpose/arduino/files/root/communicate-arduino.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # Read the output of an Arduino which may be printing sensor output, 4 | # and at the same time, monitor the user's input and send it to the Arduino. 5 | # See also 6 | # http://www.arcfn.com/2009/06/arduino-sheevaplug-cool-hardware.html 7 | 8 | import sys, serial, select 9 | 10 | class Arduino() : 11 | def run(self, baud=9600) : 12 | # Port may vary, so look for it: 13 | baseports = ['/dev/ttyUSB', '/dev/ttyACM'] 14 | self.ser = None 15 | for baseport in baseports : 16 | if self.ser : break 17 | for i in xrange(0, 8) : 18 | try : 19 | port = baseport + str(i) 20 | self.ser = serial.Serial(port, baud, timeout=1) 21 | print "Opened", port 22 | break 23 | except : 24 | self.ser = None 25 | pass 26 | 27 | if not self.ser : 28 | print "Couldn't open a serial port" 29 | sys.exit(1) 30 | 31 | self.ser.flushInput() 32 | while True : 33 | # Check whether the user has typed anything: 34 | inp, outp, err = select.select([sys.stdin, self.ser], [], [], .2) 35 | # Check for user input: 36 | if sys.stdin in inp : 37 | line = sys.stdin.readline() 38 | self.ser.write(line) 39 | # check for Arduino output: 40 | if self.ser in inp : 41 | line = self.ser.readline().strip() 42 | print "Arduino:", line 43 | 44 | arduino = Arduino() 45 | try : 46 | if len(sys.argv) > 1 : 47 | print "Using", sys.argv[1], "baud" 48 | arduino.run(baud=sys.argv[1]) 49 | else : 50 | arduino.run() 51 | except serial.SerialException : 52 | print "Disconnected (Serial exception)" 53 | except IOError : 54 | print "Disconnected (I/O Error)" 55 | except KeyboardInterrupt : 56 | print "Interrupt" 57 | 58 | -------------------------------------------------------------------------------- /traits/special_purpose/arduino/files/usr/bin/merge-bootloader.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/arduino/files/usr/bin/merge-bootloader.lua -------------------------------------------------------------------------------- /traits/special_purpose/arduino/files/usr/bin/run-avrdude: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #echo 1 > /sys/class/gpio/gpio21/value 4 | #avrdude -c linuxgpio -C /etc/avrdude.conf -p m32u4 -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xFB:m -Uflash:w:$1:i $2 5 | #echo 0 > /sys/class/gpio/gpio21/value 6 | #echo "$2" > /s2 7 | echo "" > /dev/ttyACM0 8 | 9 | lsusb|grep 0036 10 | if [ "$?"x == "0"x ];then 11 | echo LEONARDO 12 | reset-arduino /dev/ttyACM0 13 | avrdude -V -p atmega32u4 -c avr109 -b 57600 -P /dev/ttyACM0 -C /etc/avrdude.conf -U flash:w:$1 $2 14 | fi 15 | 16 | lsusb|grep 0043 17 | if [ "$?"x == "0"x ];then 18 | echo UNO 19 | avrdude -V -p m328p -c arduino -b 115200 -P /dev/ttyACM0 -C /etc/avrdude.conf -U flash:w:$1 $2 20 | fi 21 | 22 | lsusb|grep 0042 23 | if [ "$?"x == "0"x ];then 24 | echo MEGA 25 | avrdude -V -C/etc/avrdude.conf -patmega2560 -cstk500v2 -P/dev/ttyACM0 -b115200 -D -Uflash:w:$1 $2 26 | fi 27 | 28 | echo "" > /dev/ttyACM0 29 | 30 | # Enable every sketch to communicate with IDE (without the Bridge) 31 | ser2net -C 6571:raw:0:/dev/ttyACM0:9600 32 | -------------------------------------------------------------------------------- /traits/special_purpose/dali/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="coreutils-stty screen" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/dali/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | /usr/bin/lcd-write "arc 0 40" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/dali/files/usr/bin/ACK: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | -------------------------------------------------------------------------------- /traits/special_purpose/dali/files/usr/bin/NACK: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | -------------------------------------------------------------------------------- /traits/special_purpose/dali/files/usr/bin/UNKNOWN_MODE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/dali/files/usr/bin/UNKNOWN_MODE -------------------------------------------------------------------------------- /traits/special_purpose/dali/files/usr/bin/daliwrite: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PORT=/dev/ttyATH0 4 | echo "$@" | delaywrite > $PORT 5 | -------------------------------------------------------------------------------- /traits/special_purpose/dali/files/usr/bin/delaywrite: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | awk 'BEGIN{FS=""}{for(i=1;i<=NF;i++){ printf $i;system("for i in $(seq 3000); do : ;done ") }}' 4 | echo 5 | -------------------------------------------------------------------------------- /traits/special_purpose/dali_web/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="uhttpd" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/dali_web/files/www/cgi-bin/index.cgi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Content-type: text/html" 4 | echo "" 5 | echo '' 6 | echo '' 7 | echo 'Form Example' 8 | echo '' 9 | echo '' 10 | 11 | echo "
"\ 12 | ''\ 13 | ''\ 14 | ''\ 15 | ''\ 16 | '
Address
Command
Parameter
' 17 | 18 | echo 'Device
'\ 19 | 'Group
'\ 20 | 'Broadcast
' 21 | 22 | echo '
'\ 23 | '
' 24 | 25 | # Make sure we have been invoked properly. 26 | 27 | if [ "$REQUEST_METHOD" != "GET" ]; then 28 | echo "
Script Error:"\ 29 | "
Usage error, cannot complete request, REQUEST_METHOD!=GET."\ 30 | "
Check your FORM declaration and be sure to use METHOD=\"GET\".
" 31 | exit 1 32 | fi 33 | 34 | # If no search arguments, exit gracefully now. 35 | 36 | if [ -z "$QUERY_STRING" ]; then 37 | exit 0 38 | else 39 | # No looping this time, just extract the data you are looking for with sed: 40 | ADDRESS=`echo "$QUERY_STRING" | sed -n 's/^.*address=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` 41 | COMMAND=`echo "$QUERY_STRING" | sed -n 's/^.*command=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` 42 | PARAM=`echo "$QUERY_STRING" | sed -n 's/^.*param=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` 43 | ADDRESS_MODE=`echo "$QUERY_STRING" | sed -n 's/^.*address_mode=\([^&]*\).*$/\1/p' | sed "s/%20/ /g"` 44 | echo "address: " $ADDRESS 45 | echo '
' 46 | echo "command: " $COMMAND 47 | echo '
' 48 | echo "paraemeter: " $PARAM 49 | echo '
' 50 | echo "address_mode: " $ADDRESS_MODE 51 | echo '
' 52 | echo $COMMAND " " $ADDRESS " " $PARAM | daliwrite 53 | fi 54 | echo '' 55 | echo '' 56 | 57 | exit 0 58 | -------------------------------------------------------------------------------- /traits/special_purpose/easybox_simulator/MANIFEST: -------------------------------------------------------------------------------- 1 | REQUIRES="core/firstrun" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/easybox_simulator/README: -------------------------------------------------------------------------------- 1 | Easybox simulator calculates the easybox key for our MAC address and sets it as 2 | wpa key 3 | -------------------------------------------------------------------------------- /traits/special_purpose/easybox_simulator/files/etc/firstrun.d/11_easybox-wifi-ap: -------------------------------------------------------------------------------- 1 | wifi detect > /etc/config/wireless 2 | uci set wireless.@wifi-iface[0].network='lan' 3 | uci set wireless.@wifi-iface[0].mode='ap' 4 | uci set wireless.@wifi-iface[0].encryption='psk' 5 | uci set wireless.@wifi-iface[0].ssid='Easybox-ABCDEF' 6 | uci set wireless.@wifi-iface[0].key="$(/usr/bin/easybox_keygen $(uci get wireless.radio0.macaddr))" 7 | uci set wireless.@wifi-device[0].disabled=0 8 | uci commit wireless 9 | wifi 10 | -------------------------------------------------------------------------------- /traits/special_purpose/easybox_simulator/files/usr/bin/easybox_keygen: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # easybox_keygen.sh (c) 2012 GPLv3 4 | # 5 | # www.wotan.cc 6 | # 7 | 8 | MAC=${1?\$1 must be MAC} 9 | 10 | # Take the last 2 Bytes of the MAC-Address (0B:EC), and convert it to decimal. 11 | 12 | take5=${MAC:12} 13 | last4=${take5/:/} 14 | 15 | # Fill up to 4 places with zeros, if necessary: 16 | deci=$(printf "%04d" "0x$last4" | sed 's/.*\(....\)/\1/;s/./& /g') 17 | #echo M4: ${deci[@]} 18 | # 19 | # The digits M9 to M12 are just the last digits (9.-12.) of the MAC: 20 | hexi=$(echo ${MAC:12:5} | sed 's/://;s/./& /g') 21 | #echo 'M4 (Hex): ' ${hexi[@]} 22 | # K1 = last byte of (d0 + d1 + h2 + h3) 23 | # K2 = last byte of (h0 + h1 + d2 + d3) 24 | c1=$(printf "%d + %d + %d + %d" ${deci:0:1} ${deci:2:1} 0x${hexi:4:1} 0x${hexi:6:1}) 25 | c2=$(printf "%d + %d + %d + %d" 0x${hexi:0:1} 0x${hexi:2:1} ${deci:4:1} ${deci:6:1}) 26 | K1=$((($c1)%16)) 27 | K2=$((($c2)%16)) 28 | #printf "K1: %x\n" $K1 29 | #printf "K2: %x\n" $K2 30 | X1=$((K1^${deci:6:1})) 31 | X2=$((K1^${deci:4:1})) 32 | X3=$((K1^${deci:2:1})) 33 | Y1=$((K2^0x${hexi:2:1})) 34 | Y2=$((K2^0x${hexi:4:1})) 35 | Y3=$((K2^0x${hexi:6:1})) 36 | Z1=$((0x${hexi:4:1}^${deci:6:1})) 37 | Z2=$((0x${hexi:6:1}^${deci:4:1})) 38 | Z3=$((K1^K2)) 39 | printf "%x%x%x%x%x%x%x%x%x\n" $X1 $Y1 $Z1 $X2 $Y2 $Z2 $X3 $Y3 $Z3 | tr a-f A-F 40 | 41 | -------------------------------------------------------------------------------- /traits/special_purpose/ffmpeg/MANIFEST: -------------------------------------------------------------------------------- 1 | OVERLAY_PACKAGES="zlib libbz2 alsa-lib ffmpeg libpthread libffmpeg-full kmod-sound-core librt kmod-input-core" 2 | DEPENDS="core/firstrun" 3 | -------------------------------------------------------------------------------- /traits/special_purpose/ffmpeg/files/etc/rc.local: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/ffmpeg/files/etc/rc.local -------------------------------------------------------------------------------- /traits/special_purpose/instacam/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="mjpg-streamer" 2 | DEPENDS="usb" 3 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/files/etc/config/mjpg-streamer: -------------------------------------------------------------------------------- 1 | config mjpg-streamer core 2 | option enabled "1" 3 | option device "/dev/video0" 4 | option resolution "1280x720" 5 | option fps "15" 6 | option www "/www/webcam" 7 | option port "80" 8 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/files/etc/config/system: -------------------------------------------------------------------------------- 1 | config system 2 | option hostname camkrebs 3 | option timezone UTC 4 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/uvc/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="kmod-video-uvc" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/uvc/files/etc/config/mjpg-streamer: -------------------------------------------------------------------------------- 1 | config mjpg-streamer core 2 | option enabled "1" 3 | option input "uvc" 4 | option device "/dev/video0" 5 | option resolution "1280x720" 6 | option fps "15" 7 | option output "http" 8 | option www "/www/webcam" 9 | option port "80" 10 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/uvc/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | insmod uvcvideo 2 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/uvc/yuv/files/etc/config/mjpg-streamer: -------------------------------------------------------------------------------- 1 | config mjpg-streamer core 2 | option enabled "1" 3 | option device "/dev/video0" 4 | option resolution "640x480" 5 | option fps "10" 6 | option www "/www/webcam" 7 | option port "80" 8 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/uvc/yuv/files/init.d/mjpg-streamer: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2009-2012 OpenWrt.org 3 | 4 | START=50 5 | 6 | SERVICE_DAEMONIZE=1 7 | SERVICE_WRITE_PID=1 8 | 9 | PROG=/usr/bin/mjpg_streamer 10 | 11 | error() { 12 | echo "${initscript}:" "$@" 1>&2 13 | } 14 | 15 | section_enabled() { 16 | config_get_bool enabled "$1" 'enabled' 0 17 | [ $enabled -gt 0 ] 18 | } 19 | 20 | start_instance() { 21 | local s="$1" 22 | 23 | section_enabled "$s" || return 1 24 | 25 | config_get device "$s" 'device' 26 | config_get resolution "$s" 'resolution' 27 | config_get fps "$s" 'fps' 28 | config_get www "$s" 'www' 29 | config_get port "$s" 'port' 30 | 31 | [ -c "$device" ] || { 32 | error "device '$device' does not exist" 33 | return 1 34 | } 35 | 36 | # run in yuv (legacy) mode, impacts performance but at least something is happening 37 | service_start /usr/bin/mjpg_streamer --input "input_uvc.so \ 38 | --device $device --fps $fps --resolution $resolution -yuv" \ 39 | --output "output_http.so --www $www --port $port" 40 | } 41 | 42 | stop_instance() { 43 | local s="$1" 44 | 45 | section_enabled "$s" || return 1 46 | 47 | service_stop /usr/bin/mjpg_streamer 48 | } 49 | 50 | start() { 51 | config_load 'mjpg-streamer' 52 | config_foreach start_instance 'mjpg-streamer' 53 | } 54 | 55 | stop() { 56 | config_load 'mjpg-streamer' 57 | config_foreach stop_instance 'mjpg-streamer' 58 | } 59 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/zc3xx/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="kmod-video-gspca-zc3xx" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/instacam/zc3xx/files/etc/config/mjpg-streamer: -------------------------------------------------------------------------------- 1 | config mjpg-streamer core 2 | option enabled "1" 3 | option input "uvc" 4 | option device "/dev/video0" 5 | option resolution "640x480" 6 | option fps "15" 7 | option output "http" 8 | option www "/www/webcam" 9 | option port "80" 10 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/MANIFEST: -------------------------------------------------------------------------------- 1 | OVERLAY_PACKAGES="keepalived" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/README: -------------------------------------------------------------------------------- 1 | # Keepalived DC++ Hub for elchos 2 | 3 | TODO: configure the priority on the SLAVE to 100 instead of 150 in /etc/keepalived/keepalived.conf 4 | TODO: do a clean configure of the firewall and network config files 5 | TODO: configure the keepalived password to something more random 6 | TODO: get the packages from somewhere else (a channel maybe?) 7 | origin: https://github.com/makefu/openwrt-custom-builder/releases 8 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/backup/files/etc/keepalived/keepalived.conf: -------------------------------------------------------------------------------- 1 | vrrp_script chk_myscript { 2 | script "/usr/bin/keepalived-check.sh" 3 | interval 2 #seconds 4 | fall 3 5 | rise 3 6 | } 7 | 8 | vrrp_script chk_internet { 9 | script "/usr/bin/keepalived-check-internet.sh" 10 | interval 30 #seconds 11 | fall 3 12 | rise 3 13 | } 14 | 15 | vrrp_instance VI_1 { 16 | state MASTER 17 | interface eth0 18 | virtual_router_id 51 19 | priority 100 20 | advert_int 1 21 | authentication { 22 | auth_type PASS 23 | auth_pass 1111 24 | } 25 | track_script { 26 | chk_myscript 27 | chk_internet 28 | } 29 | notify /usr/bin/keepalived-notify.sh 30 | } 31 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/backup/files/etc/uci-defaults/98-keepalive-backup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # TODO: configure to be backup (prio to 100), maybe even change the color - use green blinky 3 | # for master and red blinky for backup 4 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/backup/files/etc/uhub/motd.txt: -------------------------------------------------------------------------------- 1 | Welcome to hub.nsupdate.info 2 | xx xx xx xx 3 | xxxx xx xxxx xxxx xxxx xx 4 | xxxx xx xxxx xxxx xxxx xx 5 | xxxxxx xx xx xxxxxx 6 | xxxxxx xxxxxxxxxx xxxxxx 7 | xx xxxxxxxxxxxxxx xx 8 | xxxxxxxxxxxxxxxxxxxxxxxxxx 9 | xxxxxxxxxxxxxx 10 | xxxxxxxxxxxxxxxxxxxxxx 11 | xx xxxxxx xx 12 | xx xx xx xx xx xx 13 | xx xx xx xx xx xx 14 | xx xxxx xx xx xxxx xx 15 | 16 | This is elchOS Hub BACKUP 17 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/config/announce: -------------------------------------------------------------------------------- 1 | config announce irc 2 | option server 'irc.freenode.net' 3 | option port '6667' 4 | option channel '#elchos' 5 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/config/dhcp: -------------------------------------------------------------------------------- 1 | 2 | config dnsmasq 3 | option domainneeded '1' 4 | option boguspriv '1' 5 | option filterwin2k '0' 6 | option localise_queries '1' 7 | option rebind_protection '1' 8 | option rebind_localhost '1' 9 | option local '/lan/' 10 | option domain 'lan' 11 | option expandhosts '1' 12 | option rebind_protection '0' 13 | option nonegcache '0' 14 | option authoritative '1' 15 | option readethers '1' 16 | option leasefile '/tmp/dhcp.leases' 17 | option resolvfile '/tmp/resolv.conf.auto' 18 | option localservice '1' 19 | 20 | config dhcp 'lan' 21 | option interface 'lan' 22 | option start '100' 23 | option limit '150' 24 | option leasetime '12h' 25 | option dhcpv6 'server' 26 | option ra 'server' 27 | 28 | config dhcp 'wan' 29 | option interface 'wan' 30 | option ignore '1' 31 | 32 | config dhcp 'keepalive' 33 | option interface 'keepalive' 34 | option ignore '1' 35 | 36 | config odhcpd 'odhcpd' 37 | option maindhcp '0' 38 | option leasefile '/tmp/hosts/odhcpd' 39 | option leasetrigger '/usr/sbin/odhcpd-update' 40 | 41 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/config/network: -------------------------------------------------------------------------------- 1 | 2 | config interface 'loopback' 3 | option ifname 'lo' 4 | option proto 'static' 5 | option ipaddr '127.0.0.1' 6 | option netmask '255.0.0.0' 7 | 8 | config globals 'globals' 9 | option ula_prefix 'fdd1:b78e:9a15::/48' 10 | 11 | config interface 'lan' 12 | option proto 'static' 13 | option ipaddr '192.168.101.1' 14 | option netmask '255.255.255.0' 15 | option ip6assign '60' 16 | 17 | config interface 'keepalive' 18 | option ifname 'eth1' 19 | option force_link '1' 20 | option proto 'static' 21 | option ipaddr '192.168.102.1' 22 | option netmask '255.255.255.0' 23 | option ip6assign '60' 24 | 25 | config interface 'wan' 26 | option ifname 'eth0' 27 | option proto 'dhcp' 28 | 29 | config interface 'wan6' 30 | option ifname 'eth0' 31 | option proto 'dhcpv6' 32 | 33 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/init.d/uhub: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # uhub launcher 3 | 4 | START=50 5 | STOP=10 6 | USE_PROCD=1 7 | UHUB=/usr/bin/uhub 8 | 9 | start_service() { 10 | procd_open_instance 11 | procd_set_param command $UHUB -l /var/log/uhub.log -vvv 12 | procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} 13 | procd_set_param file /etc/uhub/uhub.conf 14 | procd_set_param stdout 1 15 | procd_close_instance 16 | 17 | } 18 | 19 | stop() { 20 | killall $UHUB 21 | } 22 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | # Put your custom commands here that should be executed once 2 | # the system init finished. By default this file does nothing. 3 | (startup-notify.sh 2>&1 | logger) & 4 | exit 0 5 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/uci-defaults/89-keepalive-hub.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd /pkgs 3 | for i in *.ipk;do 4 | opkg install $i && rm $i 5 | done 6 | 7 | /etc/init.d/uhub enable 8 | /etc/init.d/keepalived enable 9 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/uhub/motd.txt: -------------------------------------------------------------------------------- 1 | 2 | xx xx xx xx 3 | xxxx xx xxxx xxxx xxxx xx 4 | xxxx xx xxxx xxxx xxxx xx 5 | xxxxxx xx xx xxxxxx 6 | xxxxxx xxxxxxxxxx xxxxxx 7 | xx xxxxxxxxxxxxxx xx 8 | xxxxxxxxxxxxxxxxxxxxxxxxxx 9 | xxxxxxxxxxxxxx 10 | xxxxxxxxxxxxxxxxxxxxxx 11 | xx xxxxxx xx 12 | xx xx xx xx xx xx 13 | xx xx xx xx xx xx 14 | xx xxxx xx xx xxxx xx 15 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/uhub/plugins.conf: -------------------------------------------------------------------------------- 1 | # ATTENTION! 2 | # Plugins are invoked in the order of listing in the plugin config file. 3 | 4 | 5 | # Sqlite based user authentication. 6 | # 7 | # This plugin provides a Sqlite based authentication database for 8 | # registered users. 9 | # Use the uhub-passwd utility to create the database and add/remove users. 10 | # 11 | # Parameters: 12 | # file: path/filename for database. 13 | # 14 | # plugin /usr/lib/uhub/mod_auth_sqlite.so "file=/etc/uhub/users.db" 15 | 16 | # Topic commands. 17 | # Note: "topic" == "hub description" (as configured in uhub.conf) 18 | # 19 | # !topic - change the topic (op required) 20 | # !showtopic - show the topic 21 | # !resettopic - reset the topic to the default (op required) 22 | # 23 | # This plugins takes no parameters. 24 | plugin /usr/lib/uhub/mod_topic.so 25 | 26 | # Log file writer 27 | # 28 | # Parameters: 29 | # file: path/filename for log file. 30 | # syslog: if true then syslog is used instead of writing to a file (Unix only) 31 | plugin /usr/lib/uhub/mod_logging.so "file=/var/log/uhub.log" 32 | 33 | # A simple example plugin 34 | #plugin /usr/lib/uhub/mod_example.so 35 | 36 | # A plugin sending a welcome message. 37 | # 38 | # This plugin provides the following commands: 39 | # !motd - Message of the day 40 | # !rules - Show hub rules. 41 | # 42 | # Parameters: 43 | # motd: path/filename for the welcome message (message of the day) 44 | # rules: path/filenam for the rules file 45 | # 46 | # NOTE: The files MUST exist, however if you do not wish to provide one then these parameters can be omitted. 47 | # 48 | # The motd/rules files can do the following substitutions: 49 | # %n - Nickname of the user who entered the hub or issued the command. 50 | # %a - IP address of the user 51 | # %c - The credentials of the user (guest, user, op, super, admin). 52 | # %% - Becomes '%' 53 | # %H - Hour 24-hour format (00-23) (Hub local time) 54 | # %I - Hour 12-hour format (01-12) (Hub local time) 55 | # %P - 'AM' or 'PM' 56 | # %p - 'am' or 'pm' 57 | # %M - Minutes (00-59) (Hub local time) 58 | # %S - Seconds (00-60) (Hub local time) 59 | plugin /usr/lib/uhub/mod_welcome.so "motd=/etc/uhub/motd.txt rules=/etc/uhub/rules.txt" 60 | 61 | # Load the chat history plugin. 62 | # 63 | # This plugin provides chat history when users are connecting, or 64 | # when users invoke the !history command. 65 | # The history command can optionally take a parameter to indicate how many lines of history is requested. 66 | # 67 | # Parameters: 68 | # history_max: the maximum number of messages to keep in history 69 | # history_default: when !history is provided without arguments, then this default number of messages are returned. 70 | # history_connect: the number of chat history messages to send when users connect (0 = do not send any history) 71 | plugin /usr/lib/uhub/mod_chat_history.so "history_max=200 history_default=10 history_connect=5" 72 | 73 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/etc/uhub/rules.txt: -------------------------------------------------------------------------------- 1 | Rule #1: Do not talk about the 33c3 Hub 2 | Rule #2: Piracy is bad, mkay? 3 | Rule #3: FILL THOSE PIPES 4 | Rule #34: crab people porn -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/pkgs/libevent_1.4.15-1_ar71xx.Chaos_Calmer.ipk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/keepalive-hub/files/pkgs/libevent_1.4.15-1_ar71xx.Chaos_Calmer.ipk -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/pkgs/libsqlite3_3081101-1_ar71xx.Chaos_Calmer.ipk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/keepalive-hub/files/pkgs/libsqlite3_3081101-1_ar71xx.Chaos_Calmer.ipk -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/pkgs/sed_4.2.1-1_ar71xx.Chaos_Calmer.ipk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/keepalive-hub/files/pkgs/sed_4.2.1-1_ar71xx.Chaos_Calmer.ipk -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/pkgs/uhub_0.5.0-4_ar71xx.Chaos_Calmer.ipk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/keepalive-hub/files/pkgs/uhub_0.5.0-4_ar71xx.Chaos_Calmer.ipk -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/usr/bin/irc-announce: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # based on http://gum.krebsco.de/stockholm/tree/krebs/5pkgs/git-hooks/default.nix#n111 3 | 4 | # requires `sed -u` - which is part of the sed package in openwrt 5 | # requires nc 6 | # requires awk 7 | 8 | set -euf 9 | LOGNAME=${LOGNAME:-irc_announce} 10 | HOSTNAME=$(uci get system.@system[0].hostname) 11 | IRC_SERVER=$(uci get announce.irc.server) 12 | IRC_PORT=$(uci get announce.irc.port) 13 | IRC_NICK=${HOSTNAME}-$$ 14 | IRC_CHANNEL=$(uci get announce.irc.channel) 15 | message="$@" 16 | 17 | export IRC_CHANNEL # for privmsg_cat 18 | 19 | echo2() { echo "$*"; echo "$*" >&2; } 20 | cat2() { tee /dev/stderr; } 21 | 22 | privmsg_cat() { awk '{ print "PRIVMSG "ENVIRON["IRC_CHANNEL"]" :"$0 }'; } 23 | 24 | tmpdir="$(mktemp -d irc-announce_XXXXXXXX)" 25 | cd "$tmpdir" 26 | mkfifo ircin 27 | trap " 28 | rm ircin 29 | cd '$OLDPWD' 30 | rmdir '$tmpdir' 31 | trap - EXIT INT QUIT 32 | " EXIT INT QUIT 33 | 34 | { 35 | echo2 "USER $LOGNAME 0 * :$LOGNAME@${HOSTNAME}" 36 | echo2 "NICK $IRC_NICK" 37 | 38 | # wait for MODE message 39 | sed -un '/^:[^ ]* MODE /q' 40 | 41 | echo2 "JOIN $IRC_CHANNEL" 42 | 43 | printf '%s' "$message" \ 44 | | privmsg_cat \ 45 | | cat2 46 | 47 | echo2 "PART $IRC_CHANNEL" 48 | 49 | # wait for PART confirmation 50 | sed -un '/:'"$IRC_NICK"'![^ ]* PART /q' 51 | 52 | echo2 'QUIT :Gone to have lunch' 53 | } < ircin \ 54 | | nc "$IRC_SERVER" "$IRC_PORT" |tee -a ircin 55 | 56 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/usr/bin/keepalived-check-internet.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # only run every 30 seconds 3 | set -ef 4 | 5 | if test -z "$(wget -qO- http://ipv4.nsupdate.info/myip)";then 6 | echo "unable to retrieve external ip from nsupdate.info" 7 | exit 1 8 | fi 9 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/usr/bin/keepalived-check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -ef 4 | 5 | HUB=uhub 6 | if ! pidof $HUB >/dev/null; then 7 | echo "$HUB is dead" 8 | exit 1 9 | fi 10 | 11 | . /lib/functions/network.sh 12 | network_get_ipaddr ip wan 13 | if test -z "$ip"; then 14 | echo "WAN has no ip address assigned" 15 | exit 1 16 | fi 17 | 18 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/usr/bin/keepalived-notify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | logger "$@" 3 | # TODO: timeout from configuration 4 | TIMEOUT=120 5 | STATUS= 6 | case $3 in 7 | FAULT) 8 | # TODO: maybe restart system 9 | ;; 10 | BACKUP) 11 | STATUS=": Scheduling uhub restart to force user reconnection (in $TIMEOUT seconds)" 12 | (sleep $TIMEOUT; /etc/init.d/uhub stop;/etc/init.d/uhub start)& 13 | ;; 14 | MASTER) 15 | STATUS=": updated hub.nsupdate.info - $(update-hub-dns.sh)" 16 | ;; 17 | esac 18 | 19 | irc-announce "switched to $3 state $STATUS" >/dev/null 2>&1 20 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/usr/bin/startup-notify.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . /lib/functions/network.sh 3 | set -ef 4 | sleep 10 5 | network_get_ipaddr ip wan 6 | 7 | while test -z "$ip"; do 8 | sleep 1 9 | network_flush_cache 10 | network_get_ipaddr ip wan 11 | done 12 | 13 | ext_ip=$(wget -qO- http://ipv4.nsupdate.info/myip) 14 | irc-announce "Why hello there, this is $HOSTNAME. My WAN ip is $ip, my external ip is $ext_ip. Uptime $(uptime | cut -d\ -f4- |cut -d, -f1 )" 15 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/files/usr/bin/update-hub-dns.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . /lib/functions/network.sh 3 | set -ef 4 | 5 | network_get_ipaddr ip wan 6 | wget -qO- $(uci get announce.nsupdate.url)$ip 7 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/master/files/etc/keepalived/keepalived.conf: -------------------------------------------------------------------------------- 1 | ! Configuration File for keepalived 2 | 3 | vrrp_script chk_myscript { 4 | script "/usr/bin/keepalived-check.sh" 5 | interval 2 #seconds 6 | fall 3 7 | rise 3 8 | } 9 | 10 | vrrp_script chk_internet { 11 | script "/usr/bin/keepalived-check-internet.sh" 12 | interval 30 #seconds 13 | fall 3 14 | rise 3 15 | } 16 | 17 | vrrp_instance VI_1 { 18 | state MASTER 19 | interface eth0 20 | virtual_router_id 51 21 | priority 150 22 | advert_int 1 23 | authentication { 24 | auth_type PASS 25 | auth_pass 1111 26 | } 27 | track_script { 28 | chk_myscript 29 | chk_internet 30 | } 31 | notify /usr/bin/keepalived-notify.sh 32 | } 33 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/master/files/etc/uci-defaults/98-keepalive-master.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # TODO: configure to be master, maybe even change the color - use green blinky 3 | # for master and red blinky for backup 4 | -------------------------------------------------------------------------------- /traits/special_purpose/keepalive-hub/master/files/etc/uhub/motd.txt: -------------------------------------------------------------------------------- 1 | Welcome to hub.nsupdate.info 2 | xx xx xx xx 3 | xxxx xx xxxx xxxx xxxx xx 4 | xxxx xx xxxx xxxx xxxx xx 5 | xxxxxx xx xx xxxxxx 6 | xxxxxx xxxxxxxxxx xxxxxx 7 | xx xxxxxxxxxxxxxx xx 8 | xxxxxxxxxxxxxxxxxxxxxxxxxx 9 | xxxxxxxxxxxxxx 10 | xxxxxxxxxxxxxxxxxxxxxx 11 | xx xxxxxx xx 12 | xx xx xx xx xx xx 13 | xx xx xx xx xx xx 14 | xx xxxx xx xx xxxx xx 15 | 16 | This is elchOS Hub MASTER 17 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="libnfc-bin" 2 | REQUIRE="usb mods/vfd_lcd core" 3 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/README: -------------------------------------------------------------------------------- 1 | # NFC-Login 2 | The nfc-login manager provides a gateway to log into shackspace with an 3 | rfid-card. 4 | 5 | # hardware 6 | The current version uses a vfd-lcd and a mr3020 but it should work with all 7 | openwrt-enabled routers with usb. 8 | 9 | The NFC-Reader attached is: 10 | - SCM 3711 11 | 12 | # software 13 | - the router uses the rest-interface of user_suppository to check for users and 14 | logs them either in or out. 15 | 16 | pu- shing the button on the wrt-router turns on "refresh" mode which will not 17 | toggle the state of the user, but refresh the login. 18 | 19 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/etc/hotplug.d/button/buttons: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # sets nfc_refresh if button is pressed 3 | # nfc_refresh changes behavior of login-manager to not 'toggle' status but to log in again 4 | if [ "$ACTION" = "pressed" ];then 5 | all_led timer 6 | touch /tmp/nfc_refresh 7 | else 8 | all_led none 9 | rm -f /tmp/nfc_refresh 10 | fi 11 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/etc/hotplug2-common.rules: -------------------------------------------------------------------------------- 1 | $include /etc/hotplug2-common.rules 2 | 3 | SUBSYSTEM ~~ (^net$|^input$|button$|^usb$|^ieee1394$|^block$|^atm$|^zaptel$|^tty$) { 4 | exec /sbin/hotplug-call %SUBSYSTEM% 5 | } 6 | 7 | DEVICENAME == watchdog { 8 | exec /sbin/watchdog -t 5 /dev/watchdog 9 | next-event 10 | } 11 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | /usr/bin/login-13mhz & 2 | /usr/bin/login-125khz & 3 | /usr/bin/lcd-fortune & 4 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/usr/bin/lcd-fortune: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TIME=300 3 | LCD_SIZE=40 4 | set -euf 5 | get_fortune(){ 6 | fortune | sed ':a;N;$!ba;s/\n/ /g' 7 | } 8 | 9 | while sleep 1; do 10 | txt=`get_fortune` 11 | while [ ${#txt} -gt $LCD_SIZE ];do 12 | txt=`get_fortune` 13 | done 14 | lcd-write "$txt" 15 | sleep $TIME 16 | done 17 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/usr/bin/login-125khz: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LOGIN_HOST=heidi.shack:5000 3 | # initial sleep, wait for usbfs and shit to initialize 4 | #sleep 10 5 | . /usr/bin/login-lib 6 | while : ;do 7 | cat /dev/ttyUSB0 | while read uid ; do 8 | echo "'$uid'" 9 | do_nfc_login "$uid" 10 | exit 11 | done 12 | done 13 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/usr/bin/login-13mhz: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LOGIN_HOST=heidi.shack:5000 3 | # initial sleep, wait for usbfs and shit to initialize 4 | sleep 10 5 | . /usr/bin/login-lib 6 | while sleep 1; do 7 | uid=$(nfc-list | grep UID | cut -d: -f 2 | sed 's/ //g') 8 | do_nfc_login "$uid" 9 | done 10 | 11 | -------------------------------------------------------------------------------- /traits/special_purpose/nfc_login/files/usr/bin/login-lib: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | LOGIN_HOST=heidi.shack:5000 3 | # initial sleep, wait for usbfs and shit to initialize 4 | sleep 10 5 | do_nfc_login(){ 6 | [ -z "$uid" ] && return 7 | lcd-write "Logging in ..." 8 | online=$(wget -O- http://$LOGIN_HOST/user/$uid/online 2>/dev/null) 9 | name=$(wget -O- http://$LOGIN_HOST/user/$uid/name 2>/dev/null) 10 | 11 | if [ -z "$online" ];then 12 | led tp-link:green:lan timer 13 | lcd-write "$uid - No Such User..." 14 | elif [ -e /tmp/nfc_refresh ];then 15 | action="login" 16 | lcd-write "Refreshing $name" 17 | elif [ "$online" = "false" ];then 18 | action="login" 19 | lcd-write "Welcome $name" 20 | led tp-link:green:3g timer 21 | else 22 | lcd-write "Good Bye $name" 23 | action="logout" 24 | led tp-link:green:wlan timer 25 | fi 26 | wget -O- http://$LOGIN_HOST/user/$uid/$action &>/dev/null 27 | echo $uid $action 28 | sleep 5 29 | all_led none 30 | lcd-write "Welcome to shack, please log in!" 31 | } 32 | 33 | -------------------------------------------------------------------------------- /traits/special_purpose/pyserial/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="luci-mod-admin-full uhttpd libiwinfo-lua luci-theme-bootstrap ser2net alsa-utils madplay coreutils-stty kmod-usb-hid kmod-input-evdev triggerhappy kmod-usb-acm python pyserial nano" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/pyserial/README: -------------------------------------------------------------------------------- 1 | Provides access to the serial port over the network. "Serial port" can mean a USB-to-serial converter. 2 | Contains an /root/communicate-arduino.py script that can "talk" to e.g., an Arduino. 3 | Use this as the basis for talking to your own gadgets over the serial line. 4 | -------------------------------------------------------------------------------- /traits/special_purpose/pyserial/files/etc/ser2net.conf: -------------------------------------------------------------------------------- 1 | 1234:raw:0:/dev/ttyATH0:57600 2 | -------------------------------------------------------------------------------- /traits/special_purpose/pyserial/files/root/communicate-arduino.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | # Read the output of an Arduino which may be printing sensor output, 4 | # and at the same time, monitor the user's input and send it to the Arduino. 5 | # See also 6 | # http://www.arcfn.com/2009/06/arduino-sheevaplug-cool-hardware.html 7 | 8 | import sys, serial, select 9 | 10 | class Arduino() : 11 | def run(self, baud=9600) : 12 | # Port may vary, so look for it: 13 | baseports = ['/dev/ttyUSB', '/dev/ttyACM'] 14 | self.ser = None 15 | for baseport in baseports : 16 | if self.ser : break 17 | for i in xrange(0, 8) : 18 | try : 19 | port = baseport + str(i) 20 | self.ser = serial.Serial(port, baud, timeout=1) 21 | print "Opened", port 22 | break 23 | except : 24 | self.ser = None 25 | pass 26 | 27 | if not self.ser : 28 | print "Couldn't open a serial port" 29 | sys.exit(1) 30 | 31 | self.ser.flushInput() 32 | while True : 33 | # Check whether the user has typed anything: 34 | inp, outp, err = select.select([sys.stdin, self.ser], [], [], .2) 35 | # Check for user input: 36 | if sys.stdin in inp : 37 | line = sys.stdin.readline() 38 | self.ser.write(line) 39 | # check for Arduino output: 40 | if self.ser in inp : 41 | line = self.ser.readline().strip() 42 | print "Arduino:", line 43 | 44 | arduino = Arduino() 45 | try : 46 | if len(sys.argv) > 1 : 47 | print "Using", sys.argv[1], "baud" 48 | arduino.run(baud=sys.argv[1]) 49 | else : 50 | arduino.run() 51 | except serial.SerialException : 52 | print "Disconnected (Serial exception)" 53 | except IOError : 54 | print "Disconnected (I/O Error)" 55 | except KeyboardInterrupt : 56 | print "Interrupt" 57 | 58 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/MANIFEST: -------------------------------------------------------------------------------- 1 | REQUIRE="network/open-wifi-ap" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/advanced/MANIFEST: -------------------------------------------------------------------------------- 1 | OVERLAY_PACKAGES="lighttpd lighttpd-mod-cgi libopenssl zlib libpcre libpthread" 2 | DEPENDS="core/firstrun network/aircrack-overlay network/interactive-tools" 3 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/advanced/files/etc/firstrun.d/12_aircrack_monitor: -------------------------------------------------------------------------------- 1 | uci set wireless.@wifi-iface[0].mode='monitor' 2 | uci commit wireless 3 | wifi 4 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/advanced/files/etc/firstrun.d/84_enable_lighttpd: -------------------------------------------------------------------------------- 1 | /etc/init.d/lighttpd enable 2 | /etc/init.d/lighttpd start 3 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/advanced/files/etc/lighttpd/lighttpd.conf: -------------------------------------------------------------------------------- 1 | server.modules = ( 2 | "mod_cgi", 3 | ) 4 | server.error-handler-404 = "/index.html" 5 | server.network-backend = "write" 6 | server.document-root = "/www/" 7 | mimetype.assign = ( 8 | ".ogg" => "audio/ogg", 9 | ".gif" => "image/gif", 10 | ".jpg" => "image/jpeg", 11 | ".jpeg" => "image/jpeg", 12 | ".png" => "image/png", 13 | ".css" => "text/css", 14 | ".html" => "text/html", 15 | ".htm" => "text/html", 16 | ".js" => "text/javascript", 17 | ) 18 | static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" ) 19 | server.pid-file = "/var/run/lighttpd.pid" 20 | server.upload-dirs = ( "/tmp" ) 21 | $HTTP["url"] =~ "/cgi-bin/" { 22 | cgi.assign = ( "" => "/bin/sh" ) } 23 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/advanced/files/etc/rc.local: -------------------------------------------------------------------------------- 1 | if command -v airbase-ng >/dev/null ;then 2 | # channel 6 3 | # Rebroadcast every 30 seconds 4 | # Respond to all Probes 5 | # essid to linksys 6 | # be verbose 7 | # interface wlan0 8 | ifconfig wlan0 0.0.0.0 9 | airbase-ng -c 6 -C 30 -P wlan0 > /var/log/airbase.log & 10 | sleep 3 11 | ifconfig at0 192.168.23.1 12 | ifconfig at0 up 13 | fi 14 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/etc/config/dhcp: -------------------------------------------------------------------------------- 1 | config dnsmasq 2 | option domainneeded 1 3 | option boguspriv 1 4 | option filterwin2k 0 # enable for dial on demand 5 | option localise_queries 1 6 | option rebind_protection 1 # disable if upstream must serve RFC191 7 | 8 addresses 8 | option rebind_localhost 1 # enable for RBL checking and similar se 9 | rvices 10 | #list rebind_domain example.lan # whitelist RFC1918 responses for 11 | domains 12 | #option local '/lan/' 13 | #option domain 'lan' 14 | option expandhosts 1 15 | option nonegcache 0 16 | option authoritative 1 17 | option readethers 1 18 | option leasefile '/tmp/dhcp.leases' 19 | option resolvfile '/tmp/resolv.conf.auto' 20 | 21 | config dhcp wlan 22 | option interface lan 23 | option start 100 24 | option limit 150 25 | option leasetime 12h 26 | config 'domain' 27 | option name '#' 28 | option ip '192.168.23.1' 29 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/etc/config/firewall: -------------------------------------------------------------------------------- 1 | config defaults 2 | option syn_flood 1 3 | option input ACCEPT 4 | option output ACCEPT 5 | option forward REJECT 6 | 7 | config zone 8 | option name lan 9 | option network 'lan' 10 | option input ACCEPT 11 | option output ACCEPT 12 | option forward REJECT 13 | 14 | config zone 15 | option name wan 16 | option network 'wan' 17 | option input ACCEPT 18 | option output ACCEPT 19 | option forward REJECT 20 | option masq 1 21 | option mtu_fix 1 22 | 23 | config forwarding 24 | option src lan 25 | option dest wan 26 | 27 | # We need to accept udp packets on port 68, 28 | # see https://dev.openwrt.org/ticket/4108 29 | config rule 30 | option name Allow-DHCP-Renew 31 | option src wan 32 | option proto udp 33 | option dest_port 68 34 | option target ACCEPT 35 | option family ipv4 36 | 37 | # Allow IPv4 ping 38 | config rule 39 | option name Allow-Ping 40 | option src wan 41 | option proto icmp 42 | option icmp_type echo-request 43 | option family ipv4 44 | option target ACCEPT 45 | 46 | # Allow DHCPv6 replies 47 | # see https://dev.openwrt.org/ticket/10381 48 | config rule 49 | option name Allow-DHCPv6 50 | option src wan 51 | option proto udp 52 | option src_ip fe80::/10 53 | option src_port 547 54 | option dest_ip fe80::/10 55 | option dest_port 546 56 | option family ipv6 57 | option target ACCEPT 58 | 59 | # Allow essential incoming IPv6 ICMP traffic 60 | config rule 61 | option name Allow-ICMPv6-Input 62 | option src wan 63 | option proto icmp 64 | list icmp_type echo-request 65 | list icmp_type echo-reply 66 | list icmp_type destination-unreachable 67 | list icmp_type packet-too-big 68 | list icmp_type time-exceeded 69 | list icmp_type bad-header 70 | list icmp_type unknown-header-type 71 | list icmp_type router-solicitation 72 | list icmp_type neighbour-solicitation 73 | list icmp_type router-advertisement 74 | list icmp_type neighbour-advertisement 75 | option limit 1000/sec 76 | option family ipv6 77 | option target ACCEPT 78 | 79 | # Allow essential forwarded IPv6 ICMP traffic 80 | config rule 81 | option name Allow-ICMPv6-Forward 82 | option src wan 83 | option dest * 84 | option proto icmp 85 | list icmp_type echo-request 86 | list icmp_type echo-reply 87 | list icmp_type destination-unreachable 88 | list icmp_type packet-too-big 89 | list icmp_type time-exceeded 90 | list icmp_type bad-header 91 | list icmp_type unknown-header-type 92 | option limit 1000/sec 93 | option family ipv6 94 | option target ACCEPT 95 | 96 | config redirect 97 | option src lan 98 | option proto tcp 99 | option src_dport 80 100 | option src_ip !192.168.23.1 101 | option dest_port 80 102 | option dest_ip 192.168.23.1 103 | option target DNAT 104 | 105 | config redirect 106 | option src lan 107 | option proto tcp 108 | option src_dport 443 109 | option src_ip !192.168.23.1 110 | option dest_port 443 111 | option dest_ip 192.168.23.1 112 | option target DNAT 113 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/etc/config/network: -------------------------------------------------------------------------------- 1 | config interface 'loopback' 2 | option ifname 'lo' 3 | option proto 'static' 4 | option ipaddr '127.0.0.1' 5 | option netmask '255.0.0.0' 6 | 7 | config interface 'wan' 8 | option ifname 'eth0' 9 | option proto 'dhcp' 10 | 11 | config interface 'lan' 12 | option ifname 'wlan0' 13 | option proto 'static' 14 | option ipaddr 192.168.23.1 15 | option netmask 255.255.255.0 16 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/www/1x1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/rickroller/files/www/1x1.gif -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/www/cgi-bin/rrhelper: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | RRLOG="/tmp/rrlog" 4 | 5 | if [ -n "$RRLOG" ]; then 6 | echo `awk '{print $1}' /proc/uptime` $REMOTE_ADDR:$REMOTE_PORT \'$HTTP_REFERER\' \'$HTTP_USER_AGENT\' >>"$RRLOG" 7 | fi 8 | 9 | if grep -q '\[none\]' /sys/class/leds/tp-link\:blue\:system/trigger ;then 10 | /usr/bin/led tp-link:blue:system default-on 11 | else 12 | /usr/bin/led tp-link:blue:system none 13 | 14 | fi 15 | 16 | echo "Content-type: image/gif" 17 | echo "" 18 | cat /www/1x1.gif 19 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/www/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | RickRoll'D 4 | 5 | 6 |
7 |

RickRoll'D

8 |
9 | 12 |
13 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/www/library/test/success.html: -------------------------------------------------------------------------------- 1 | SuccessSuccess 2 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/www/rick.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/rickroller/files/www/rick.gif -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/files/www/rick.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/rickroller/files/www/rick.ogg -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/uhttpd/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="uhttpd uhttpd-mod-tls" 2 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/uhttpd/files/etc/config/uhttpd: -------------------------------------------------------------------------------- 1 | config uhttpd main 2 | list listen_http 0.0.0.0:80 3 | list listen_https 0.0.0.0:443 4 | option home /www 5 | option rfc1918_filter 1 6 | option max_requests 3 7 | option cert /etc/uhttpd.crt 8 | option key /etc/uhttpd.key 9 | option cgi_prefix /cgi-bin 10 | option script_timeout 60 11 | option network_timeout 30 12 | option tcp_keepalive 1 13 | option error_page /index.html 14 | -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/uhttpd/files/etc/uhttpd.crt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/rickroller/uhttpd/files/etc/uhttpd.crt -------------------------------------------------------------------------------- /traits/special_purpose/rickroller/uhttpd/files/etc/uhttpd.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krebs/minikrebs/c96f81aa3d1337a615424aa32b2a1dab361268ea/traits/special_purpose/rickroller/uhttpd/files/etc/uhttpd.key -------------------------------------------------------------------------------- /traits/usb/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="kmod-usb-core kmod-usb2" 2 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/BUGS: -------------------------------------------------------------------------------- 1 | - if the usb-stick is not inserted BEFORE flashing the stick will not be 2 | initialized ( race condition) 3 | - if there is no 'real' overlay (e.g. only tmpfs overlay) inserting the stick 4 | will result in an endless reboot loop 5 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/MANIFEST: -------------------------------------------------------------------------------- 1 | PACKAGES="block-mount kmod-fs-ext4 kmod-usb-storage" 2 | DEPENDS="core/firstrun" 3 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/files/etc/config/fstab: -------------------------------------------------------------------------------- 1 | config global automount 2 | option from_fstab 1 3 | option anon_mount 1 4 | 5 | config global autoswap 6 | option from_fstab 1 7 | option anon_swap 0 8 | 9 | config mount 10 | option target /overlay 11 | option device /dev/sda1 12 | option fstype ext4 13 | option options rw,sync 14 | option enabled 1 15 | option enabled_fsck 0 16 | 17 | config swap 18 | option device /dev/sda2 19 | option enabled 1 20 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/files/etc/firstrun.d/01_init-root-overlay: -------------------------------------------------------------------------------- 1 | if [ -e /tmp/overlay-disabled ];then 2 | #umount /overlay 3 | #/etc/init.d/fstab restart 4 | tar -C /overlay -cvf - . | tar -C /tmp/overlay-disabled -xf - 5 | /etc/init.d/fstab overlay_enable 6 | reboot # make sure that we have overlay 7 | exit 255 8 | fi 9 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/install_overlay_packages/MANIFEST: -------------------------------------------------------------------------------- 1 | DEPENDS="core/firstrun" 2 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/install_overlay_packages/README: -------------------------------------------------------------------------------- 1 | # install overlay packages 2 | Installs all packages provided in the overlay folder /packages 3 | 4 | Packages can be installed by other traits with an `OVERLAY_PACKAGES` entry in 5 | their manifest file (e.g. `network/aircrack-overlay/MANIFEST` ). 6 | 7 | See the top-level README on how to prepare an overlay. 8 | -------------------------------------------------------------------------------- /traits/usb/root_overlay/install_overlay_packages/files/etc/firstrun.d/02_install-overlay-packages: -------------------------------------------------------------------------------- 1 | [ ! -e /packages/ ] || opkg install /packages/* 2 | -------------------------------------------------------------------------------- /try-qemu: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -euf 3 | test -e "$1" || gunzip "$1" 4 | 5 | qemu-system-x86_64 -M q35 \ 6 | -drive "file=$1,id=d0,if=none,bus=0,unit=0" \ 7 | -device ide-hd,drive=d0,bus=ide.0 \ 8 | -netdev user,id=mynet0 -device e1000,netdev=mynet0 \ 9 | -netdev user,id=mynet1,restrict=y -device e1000,netdev=mynet1 \ 10 | -nographic 11 | 12 | -------------------------------------------------------------------------------- /upgrade: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | IMAGE=${IMAGE:-openwrt-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin} 3 | cd $(dirname $(readlink -f $0)) 4 | if [ -z "${1:-}" ];then 5 | echo "usage: $0 ADDRESS" 6 | echo 7 | echo "ENVIRONMENT:" 8 | echo " IMAGE (currently $IMAGE)" 9 | 10 | exit 1 11 | fi 12 | 13 | IP=$1 14 | cd builder/bin/ar71xx/ 15 | 16 | if [ -e "$IMAGE" ];then 17 | scp $IMAGE root@$IP:/tmp/firmware.bin 18 | ssh root@$IP "/sbin/mtd write /tmp/firmware.bin firmware \ 19 | && /sbin/reboot" 20 | else 21 | echo "cannot find ar71xx build, aborting" 22 | exit 1 23 | fi 24 | --------------------------------------------------------------------------------