Skip to content

Commit

Permalink
Add source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Perdu committed Mar 23, 2018
1 parent 6af9393 commit 9b59372
Show file tree
Hide file tree
Showing 69 changed files with 26,286 additions and 0 deletions.
39 changes: 39 additions & 0 deletions ansible/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
# Add in /etc/ansible/ansible.cfg: remote_tmp = /tmp/ansible/
# user wombat must be already created:
# - boot the raspberry pi with a fresh image (alarm:alarm), then
# su - (root), then
# useradd -m -G wheel -s /bin/bash wombat
# passwd wombat
# pacman -Syu
# - Note the raspi's ip
# - Execute this script with:
# ansible-playbook -i <ip>, --ask-sudo-pass -k bootstrap.yml --extra-vars "user=wombat"
# use wombat's pass to log in, root password (root) for su
- hosts: all
gather_facts: False
# user: wombat
user: "{{ user }}"
tasks:
- name : install python to use ansible modules
become: true
become_method: su
raw: test -e /usr/bin/python || pacman --noconfirm -S python

- hosts: all
user: "{{ user }}"
become: true
become_method: su
tasks:
- name : install sudo
pacman: name=sudo state=present
- name : check that the wheel group exists
group: name=wheel state=present
- name : edit sudoer file
lineinfile:
dest: /etc/sudoers
state: present
regexp: '^%wheel'
line: '%wheel ALL=(ALL) ALL'
- name : Disable root user passwd
shell: passwd -l root
1 change: 1 addition & 0 deletions ansible/files/90-monitor.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ACTION=="add", KERNEL=="wlan*", RUN+="/usr/bin/iwconfig %k mode monitor"
1 change: 1 addition & 0 deletions ansible/files/cmdline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
root=/dev/mmcblk0p2 rw rootwait console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop fastboot noswap ro
9 changes: 9 additions & 0 deletions ansible/files/frontend/.bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi

if [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
export XAUTHORITY=/tmp/.Xauthority
exec startx
fi
#if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi
3 changes: 3 additions & 0 deletions ansible/files/frontend/.xinitrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

exec i3
257 changes: 257 additions & 0 deletions ansible/files/frontend/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout somewhen, delete
# this file and re-run i3-config-wizard(1).
#

# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

set $mod Mod4

# Execution on startup
exec urxvt -e bash -c "cd /home/wombat/frontend/ && python2 blind_server.py"

#for_window [class="Terminator"] move scratchpad
# for_window [title="terminal_scratchpad"] move scratchpad

#exec urxvt -name scratchpad
#for_window [instance="scratchpad"] move scratchpad, border 1pixel

focus_follows_mouse yes

client.focused #e51414 #e51414 #ffffff #e51414

# color defines for zenburn styled i3
set $bg #2c2c2e
set $bg2 #202023
set $fg #9f9f9f
set $hi #852245
set $tx #040404
set $ac #8F9D6A
set $ac2 #FCBF69
set $ac3 #6392C5
#set $ac #a0afa0
set $ia #8f8f8f
set $be #8faf9f
set $yw #ccdc90
set $gn #9B703F
#set $gn #88b090
set $rd #e89393
set $white #ffffff

# class border backgr. text indicator
#client.focused $tx $tx $white $tx
#client.focused $ac3 $ac3 $tx $ac2
#client.unfocused $bg $bg $ia $ac
#client.focused_inactive $bg $bg $ac2
#client.urgent $rd $rd $tx

#client.focused #ffffff
#client.focused "#4c7899" "#285577" "#ffffff" "#2e9ef4"
#client.focused_inactive #333333 #5f676a #ffffff #484e50
#client.unfocused #333333 #222222 #888888 #292d2e
#client.urgent #2f343a #900000 #ffffff #900000

# font for window titles. ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1

# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod

# start a terminal
# bindsym $mod+Return exec i3-sensible-terminal
bindsym $mod+Return exec urxvt
#gnome-terminal

# kill focused window
bindsym $mod+q kill

# change focus
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right
bindsym $mod+h focus left

# alternatively, you can use the cursor keys:
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# move focused window
bindsym $mod+Shift+J move down
bindsym $mod+Shift+K move up
bindsym $mod+Shift+H move left
bindsym $mod+Shift+L move right

# alternatively, you can use the cursor keys:
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# split in horizontal orientation
# bindsym $mod+h split h
bindsym $mod+Shift+V split h

# split in vertical orientation
bindsym $mod+v split v

# enter fullscreen mode for the focused container
bindsym $mod+space fullscreen

# change container layout (stacked, tabbed, default)
bindsym $mod+s layout stacking
bindsym $mod+z layout tabbed
bindsym $mod+e layout default

# toggle tiling / floating
bindsym $mod+f floating toggle

# change focus between tiling / floating windows
bindsym $mod+Caps_Lock focus mode_toggle
bindsym $mod+twosuperior focus mode_toggle

# focus the parent container
bindsym $mod+Shift+Q focus parent

# focus the child container
#bindcode $mod+d focus child

# switch to workspace
bindsym $mod+ampersand workspace 1
bindsym $mod+eacute workspace 2
bindsym $mod+quotedbl workspace 3
bindsym $mod+apostrophe workspace 4
bindsym $mod+parenleft workspace 5
bindsym $mod+minus workspace 6
bindsym $mod+egrave workspace 7
bindsym $mod+underscore workspace 8
bindsym $mod+ccedilla workspace 9
bindsym $mod+agrave workspace 10

# move focused container to workspace
bindsym $mod+Shift+1 move workspace 1
bindsym $mod+Shift+2 move workspace 2
bindsym $mod+Shift+3 move workspace 3
bindsym $mod+Shift+4 move workspace 4
bindsym $mod+Shift+5 move workspace 5
bindsym $mod+Shift+6 move workspace 6
bindsym $mod+Shift+7 move workspace 7
bindsym $mod+Shift+8 move workspace 8
bindsym $mod+Shift+9 move workspace 9
bindsym $mod+Shift+0 move workspace 10

# move focused container to workspace and move to that workspace
bindsym $mod+Control+1 move workspace 1; workspace 1
bindsym $mod+Control+2 move workspace 2; workspace 2
bindsym $mod+Control+3 move workspace 3; workspace 3
bindsym $mod+Control+4 move workspace 4; workspace 4
bindsym $mod+Control+5 move workspace 5; workspace 5
bindsym $mod+Control+6 move workspace 6; workspace 6
bindsym $mod+Control+7 move workspace 7; workspace 7
bindsym $mod+Control+8 move workspace 8; workspace 8
bindsym $mod+Control+9 move workspace 9; workspace 9
bindsym $mod+Control+0 move workspace 10; workspace 10


# reload the configuration file
bindsym $mod+Shift+C reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+R restart
# exit i3 (logs you out of your X session)
bindsym $mod+Shift+P exit

### biding without mode
bindsym $mod+Control+Left resize grow left 5 px or 5 ppt
bindsym $mod+Control+Shift+Left resize shrink left 5 px or 5 ppt
bindsym $mod+Control+Down resize grow down 5 px or 5 ppt
bindsym $mod+Control+Shift+Down resize shrink down 5 px or 5 ppt
bindsym $mod+Control+Up resize grow up 5 px or 5 ppt
bindsym $mod+Control+Shift+Up resize shrink up 5 px or 5 ppt
bindsym $mod+Control+Right resize grow right 5 px or 5 ppt
bindsym $mod+Control+Shift+Right resize shrink right 5 px or 5 ppt

# same with hjkl
bindsym $mod+Control+h resize grow left 5 px or 5 ppt
bindsym $mod+Control+Shift+H resize shrink left 5 px or 5 ppt
bindsym $mod+Control+j resize grow down 5 px or 5 ppt
bindsym $mod+Control+Shift+J resize shrink down 5 px or 5 ppt
bindsym $mod+Control+k resize grow up 5 px or 5 ppt
bindsym $mod+Control+Shift+K resize shrink up 5 px or 5 ppt
bindsym $mod+Control+l resize grow right 5 px or 5 ppt
bindsym $mod+Control+Shift+L resize shrink right 5 px or 5 ppt

# switch between the current and the previously focused one
bindsym Mod1+Tab workspace next
bindsym Mod1+Shift+Tab workspace prev
#bindsym $mod+Tab workspace back_and_forth
bindsym $mod+Tab focus right
bindsym $mod+Shift+Tab focus left

# Make the currently focused window a scratchpad
bindsym $mod+m move scratchpad
# Show the first scratchpad window
#bindsym $mod+Tab scratchpad show
#bindsym --release $mod+Caps_Lock scratchpad show ; exec xdotool key --clearmodifiers Caps_Lock
#bindsym $mod+Caps_Lock scratchpad show
bindsym $mod+i scratchpad show
bindsym $mod+oe scratchpad show
bindsym Mod1+oe scratchpad show
bindsym Mod1+twosuperior scratchpad show

#new_window none
assign [class="desktop_window"] 9
#assign [class="X-terminal-emulator"] 9
assign [class="Firefox"] 2
assign [class="Iceweasel"] 2
assign [class="Amarok"] 1
assign [class="Clementine"] 1
assign [class="Thunderbird"] 3
assign [class="Icedove"] 3
assign [class="Pidgin"] 1
# hugin
assign [class="PTBatcherGUI"] 10
assign [class="cellulardance"] 9
assign [class="calibration"] 8
assign [class="Calibration"] 8
# Open any other applications in tab 9
assign [class="*"] 9

# Start i3bar to display a workspace bar (plus the system information i3status
# finds out, if available)
#bar {
#status_command i3status | dzen2 -xs 1 -x 200 -y 750 -ta r -tw 1100
# status_command /home/tohwi/scripts/i3status.sh
#status_command top
# tray_output xinerama-0
#position top
#}

#bar { status_command /home/tohwi/scripts/i3status.sh
#}

# Pour le dual screen avec une carte nVidia
force_xinerama no

#workspace 1 output LVDS1
#workspace 5 output VGA1

workspace 1 output eDP-1
workspace 2 output eDP-1
workspace 3 output eDP-1
workspace 4 output eDP-1
workspace 5 output eDP-1
workspace 6 output eDP-1
workspace 7 output eDP-1
workspace 8 output eDP-1
workspace 9 output HDMI-0

# open matplotlib plot in floating windows
for_window [title="^Figure 1$"] floating enable
for_window [class="mupen64plus"] floating enable; [class="mupen64plus"] resize shrink width 10000px; [class="mupen64plus"] resize grow width 1280px; [class="mupen64plus"] resize shrink height 10000px; [class="mupen64plus"] resize grow height 960px; [class="mupen64plus"] move position center;

exec --no-startup-id i3-msg workspace 1
3 changes: 3 additions & 0 deletions ansible/files/frontend/override.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin wombat --noclear %I $TERM
6 changes: 6 additions & 0 deletions ansible/files/fstab
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/dev/mmcblk0p1 /boot vfat defaults,ro,errors=remount-ro 0 0

tmpfs /tmp tmpfs nosuid,nodev 0 0
tmpfs /var/log tmpfs nosuid,nodev 0 0
tmpfs /var/tmp tmpfs nosuid,nodev 0 0
tmpfs /var/db tmpfs nosuid,nodev 0 0
5 changes: 5 additions & 0 deletions ansible/files/node/eth0.network
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Match]
Name=eth0

[Network]
DHCP=yes
10 changes: 10 additions & 0 deletions ansible/files/node/node_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"node_id": 0,
"iface": "{{ iface }}",
"server_ip": "{{ server_ip }}",
"server_port": 4001,
"capture_probes_only": true,
"use_date_sync": true,
"date_sync_port": 4005,
"log_file": "/var/log/wombat_node.log"
}
6 changes: 6 additions & 0 deletions ansible/files/optoutAP/optoutAP_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hostapd_config_file": "/etc/wombat/hostapd_optoutAP.cfg",
"server_ip": "{{ server_ip }}",
"server_port": 4006,
"reduced_signal_strength": {{ reduced_signal_strength }}
}
Empty file.
Loading

0 comments on commit 9b59372

Please sign in to comment.