Compare commits
36 Commits
77fb952161
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
ea4760a81e
|
|||
|
35dd865b80
|
|||
|
fea4680642
|
|||
|
9ca4126e8a
|
|||
|
19af6dbce4
|
|||
|
b85f1d2e83
|
|||
|
95f349fd85
|
|||
|
58c82fa9fc
|
|||
|
216e698f4e
|
|||
|
6cb3c5eeb4
|
|||
|
6efac21a22
|
|||
|
6a1591030d
|
|||
|
daf71a9fed
|
|||
|
09d35810c0
|
|||
|
f9ac98d829
|
|||
|
e2151345d7
|
|||
|
8dbc8c6605
|
|||
|
e675a78b10
|
|||
|
333d5c9e3c
|
|||
|
7bb30f09f5
|
|||
|
36eb4564a3
|
|||
|
4468db389f
|
|||
|
414ff4a546
|
|||
|
f1b804d0ee
|
|||
|
cad7fb1649
|
|||
|
1d71a42d3c
|
|||
|
4a637a9b39
|
|||
|
9599d9370c
|
|||
|
24979969b6
|
|||
|
80e0d2ee9c
|
|||
|
dfd9cda104
|
|||
|
d2a2c43386
|
|||
|
f98164f8e6
|
|||
|
822d58734c
|
|||
|
da8dcc7222
|
|||
|
6c27e4ee9d
|
4
.pw/README.md
Normal file
4
.pw/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# IRO's insecure passwords
|
||||
|
||||
- Filename: username
|
||||
- File's content: password, plain text!
|
||||
61
README.md
61
README.md
@@ -1,10 +1,63 @@
|
||||
# Galactic Registration Office
|
||||
# c3gov
|
||||
Fill out your hacker passport using a professional dot matrix printer.
|
||||
|
||||
## Supported Passports
|
||||
## How to use the official® setup
|
||||
|
||||
### Start up
|
||||
1. Plugin the Raspberry Pi.
|
||||
2. Mind the following order:
|
||||
1. Insert the RS232 adapter for the client(s) and connect them.
|
||||
2. As the last device insert the RS232 adapter for the printer.
|
||||
3. Turn on the printer.
|
||||
|
||||
### If the interface freezes
|
||||
1. Turn off the printer.
|
||||
2. Unplug the RS232 adapter from the Raspberry Pi.
|
||||
3. Replug all RS232 in the order like described above.
|
||||
|
||||
### Turning off
|
||||
1. Turn off the computer.
|
||||
2. Unplug the RS232 adapter from the Raspberry Pi.
|
||||
3. Turn off the Raspberry Pi.
|
||||
|
||||
## General information
|
||||
|
||||
### Configuration
|
||||
|
||||
See the `./config` file to set the client number and the event name.
|
||||
|
||||
### Hardware Requirements
|
||||
- Wincor Nixdorf HighPrint 4915
|
||||
- Raspberry Pi
|
||||
- 3x - 5x USB RS232 adapter (male -> USB)
|
||||
- 1x for printer
|
||||
- 4x for two clients (2x each client)
|
||||
- 2x RS232 connector (female -> female)
|
||||
- 2x old laptops with some debian without GUI, only tty.
|
||||
|
||||
### Software Requirements
|
||||
For the clients:
|
||||
- screen
|
||||
|
||||
For the Raspberry Pi
|
||||
- dialog
|
||||
|
||||
### Supported Passports
|
||||
The following passports are supported atm:
|
||||
- CmS Junghackerpass
|
||||
- Bound Diplomatic passport by Mitch Altman (TVBGone) Matthew Borgatti (har.ms)
|
||||
- Stapled Diplomatic passport Mitch/Matthew and Nils-Arne Pohlandt (devtal.de)
|
||||
|
||||
Do you want yours to be supported, too?
|
||||
Talk to me and send me 3 example pieces. :)
|
||||
|
||||
## Set event name
|
||||
To set the event name, just change the `EVENT` variable in `./start` at the top.
|
||||
### Installation
|
||||
|
||||
1. Be root.
|
||||
2. `cd /root`
|
||||
3. `git clone https://git.chaospott.de/Bandie/c3gov`
|
||||
4. `cd c3gov`
|
||||
5. `cp -r etc/systemd/system/* /etc/systemd/system`
|
||||
6. `systemctl enable --now getty@ttyUSB0`
|
||||
7. `systemctl enable --now getty@ttyUSB1` (if there's will be a second client)
|
||||
8. Add a user in .pw: `echo "password" > .pw/username`
|
||||
|
||||
108
bounddipl/c3gov
Executable file
108
bounddipl/c3gov
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=1
|
||||
LEFT=5
|
||||
|
||||
# Additional heading space
|
||||
HEADINGNEXTPAGE=19
|
||||
HEADINGLEFT=1
|
||||
HEADINGRIGHT=10
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=34
|
||||
NEXTPAGESMALL=60
|
||||
NEXTFIELDBOTTOM=13
|
||||
NEXTFIELDRIGHT=18
|
||||
NEXTFIELDRIGHTSMALL=30
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -e "$0: Syntax:\n$0 FIELD\n\nExample:\n$0 7\n\n\nFields:
|
||||
==================
|
||||
| VISAS || VISAS |
|
||||
==================
|
||||
| 0 | 1 || 4 | 5 |
|
||||
|---|---||---|---|
|
||||
| 2 | 3 || 6 | 7 |
|
||||
==================
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PAGE=$(($1 / 4))
|
||||
FIELD=$(($1 % 4))
|
||||
|
||||
shift 1
|
||||
|
||||
|
||||
echo "PAGE: $PAGE, FIELD: $FIELD"
|
||||
|
||||
|
||||
|
||||
function moveDown() {
|
||||
for((i=0; i<$(($FIELD / 2)); i++)); do
|
||||
for((j=0; j<$NEXTFIELDBOTTOM; j++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
|
||||
|
||||
if [ $(($FIELD % 2)) -eq 0 ]; then
|
||||
HSPACE=$HEADINGLEFT
|
||||
SPACE=0
|
||||
else
|
||||
HSPACE=$HEADINGRIGHT
|
||||
SPACE=$NEXTFIELDRIGHT
|
||||
fi
|
||||
|
||||
|
||||
bigLetters $FILE
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
if [ $(($FIELD % 2)) -eq 1 ]; then
|
||||
makeLeft $(($HSPACE - 1)) $FILE
|
||||
fi
|
||||
else
|
||||
makeLeft 1 $FILE
|
||||
makeLeft $HSPACE $FILE
|
||||
fi
|
||||
printf "c3gov\n" >> $FILE
|
||||
resetLetters $FILE
|
||||
|
||||
}
|
||||
|
||||
function insertDate() {
|
||||
if [ $(($FIELD % 2 )) -eq 0 ]; then
|
||||
SPACE=0
|
||||
else
|
||||
SPACE=$NEXTFIELDRIGHTSMALL
|
||||
fi
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGESMALL $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
printf "$(date -I)" >> $FILE
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertDate
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
134
bounddipl/gpgkey
Executable file
134
bounddipl/gpgkey
Executable file
@@ -0,0 +1,134 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=1
|
||||
LEFT=3
|
||||
|
||||
# Additional heading space
|
||||
HEADINGNEXTPAGE=36
|
||||
HEADINGLEFT=1
|
||||
HEADINGRIGHT=20
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=62
|
||||
NEXTFIELDBOTTOM=11
|
||||
NEXTFIELDRIGHT=31
|
||||
MAXLENGTH=22
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -e "$0: Syntax:\n$0 FIELD GPG FINGERPRINT WITH SPACES\n\nExample:\n$0 7 1234 5678 1234 1234 1234 1234 1234 1234 1234 ABCD\n\n\nFields:
|
||||
==================
|
||||
| VISAS || VISAS |
|
||||
==================
|
||||
| 0 | 1 || 4 | 5 |
|
||||
|---|---||---|---|
|
||||
| 2 | 3 || 6 | 7 |
|
||||
==================
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PAGE=$(($1 / 4))
|
||||
FIELD=$(($1 % 4))
|
||||
|
||||
shift 1
|
||||
|
||||
|
||||
echo "PAGE: $PAGE, FIELD: $FIELD"
|
||||
|
||||
|
||||
|
||||
function moveDown() {
|
||||
for((i=0; i<$(($FIELD / 2)); i++)); do
|
||||
for((j=0; j<$NEXTFIELDBOTTOM; j++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
|
||||
|
||||
if [ $(($FIELD % 2)) -eq 0 ]; then
|
||||
SPACE=$HEADINGLEFT
|
||||
else
|
||||
SPACE=$HEADINGRIGHT
|
||||
fi
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
fi
|
||||
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $SPACE $FILE
|
||||
|
||||
bigLetters $FILE
|
||||
printf "GPG" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
}
|
||||
|
||||
function insertFP() {
|
||||
if [ $(($FIELD % 2 )) -eq 0 ]; then
|
||||
SPACE=0
|
||||
else
|
||||
SPACE=$NEXTFIELDRIGHT
|
||||
fi
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
shift 4
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
shift 4
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
shift 2
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
printf "$(date -I)" >> $FILE
|
||||
fi
|
||||
}
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertFP $@
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
52
bounddipl/reg
Executable file
52
bounddipl/reg
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=56
|
||||
NEXTFIELD=5
|
||||
LEFT=22
|
||||
AUTHLEFT=66
|
||||
DATELEFT=37
|
||||
MAXLENGTH=17
|
||||
|
||||
GIVENNAME=$1
|
||||
SURNAME=$2
|
||||
HOME=$3
|
||||
|
||||
|
||||
if [ ${#GIVENNAME} -gt $MAXLENGTH ] || [ ${#SURNAME} -gt $MAXLENGTH ] || [ ${#HOME} -gt $MAXLENGTH ]; then
|
||||
echo "MAXLENGTH EXCEEDED."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
smallLetters $FILE
|
||||
printf "\x1b\x33\x0e" >> $FILE
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$GIVENNAME" >> $FILE
|
||||
|
||||
# Authority field
|
||||
makeNewline 2 $FILE
|
||||
makeLeft $AUTHLEFT $FILE
|
||||
printf "c3gov" >> $FILE
|
||||
|
||||
makeNewline 3 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$SURNAME" >> $FILE
|
||||
|
||||
makeNewline $NEXTFIELD $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$HOME" >> $FILE
|
||||
|
||||
makeNewline 4 $FILE
|
||||
makeLeft $DATELEFT $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "/ $EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
printf "/ $(date -I)" >> $FILE
|
||||
fi
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
2
clients/README.md
Normal file
2
clients/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# Clients
|
||||
For the clients using RS232 u need to configure the /etc/passwd to use the officerload script
|
||||
3
clients/officerload
Normal file
3
clients/officerload
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
clear
|
||||
screen /dev/ttyUSB0
|
||||
8
config
Normal file
8
config
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Number of clients, maximum 2
|
||||
CLIENTS=1
|
||||
|
||||
# Event name.
|
||||
# Please leave the export be.
|
||||
export EVENT="Chaospott"
|
||||
144
dialogrc
Normal file
144
dialogrc
Normal file
@@ -0,0 +1,144 @@
|
||||
#
|
||||
# Run-time configuration file for dialog
|
||||
#
|
||||
# Automatically generated by "dialog --create-rc <file>"
|
||||
#
|
||||
#
|
||||
# Types of values:
|
||||
#
|
||||
# Number - <number>
|
||||
# String - "string"
|
||||
# Boolean - <ON|OFF>
|
||||
# Attribute - (foreground,background,highlight?,underline?,reverse?)
|
||||
|
||||
# Set aspect-ration.
|
||||
aspect = 0
|
||||
|
||||
# Set separator (for multiple widgets output).
|
||||
separate_widget = ""
|
||||
|
||||
# Set tab-length (for textbox tab-conversion).
|
||||
tab_len = 0
|
||||
|
||||
# Make tab-traversal for checklist, etc., include the list.
|
||||
visit_items = OFF
|
||||
|
||||
# Shadow dialog boxes? This also turns on color.
|
||||
use_shadow = OFF
|
||||
|
||||
# Turn color support ON or OFF
|
||||
use_colors = OFF
|
||||
|
||||
# Screen color
|
||||
screen_color = (CYAN,BLUE,OFF)
|
||||
|
||||
# Shadow color
|
||||
shadow_color = (BLACK,BLACK,ON)
|
||||
|
||||
# Dialog box color
|
||||
dialog_color = (BLACK,WHITE,OFF)
|
||||
|
||||
# Dialog box title color
|
||||
title_color = (BLUE,WHITE,OFF)
|
||||
|
||||
# Dialog box border color
|
||||
border_color = (WHITE,WHITE,ON)
|
||||
|
||||
# Active button color
|
||||
button_active_color = (WHITE,BLACK,ON)
|
||||
|
||||
# Inactive button color
|
||||
button_inactive_color = dialog_color
|
||||
|
||||
# Active button key color
|
||||
button_key_active_color = button_active_color
|
||||
|
||||
# Inactive button key color
|
||||
button_key_inactive_color = (RED,WHITE,OFF)
|
||||
|
||||
# Active button label color
|
||||
button_label_active_color = (YELLOW,BLUE,OFF)
|
||||
|
||||
# Inactive button label color
|
||||
button_label_inactive_color = (BLACK,WHITE,ON)
|
||||
|
||||
# Input box color
|
||||
inputbox_color = dialog_color
|
||||
|
||||
# Input box border color
|
||||
inputbox_border_color = dialog_color
|
||||
|
||||
# Search box color
|
||||
searchbox_color = dialog_color
|
||||
|
||||
# Search box title color
|
||||
searchbox_title_color = title_color
|
||||
|
||||
# Search box border color
|
||||
searchbox_border_color = border_color
|
||||
|
||||
# File position indicator color
|
||||
position_indicator_color = title_color
|
||||
|
||||
# Menu box color
|
||||
menubox_color = dialog_color
|
||||
|
||||
# Menu box border color
|
||||
menubox_border_color = border_color
|
||||
|
||||
# Item color
|
||||
item_color = dialog_color
|
||||
|
||||
# Selected item color
|
||||
item_selected_color = button_active_color
|
||||
|
||||
# Tag color
|
||||
tag_color = title_color
|
||||
|
||||
# Selected tag color
|
||||
tag_selected_color = button_label_active_color
|
||||
|
||||
# Tag key color
|
||||
tag_key_color = button_key_inactive_color
|
||||
|
||||
# Selected tag key color
|
||||
tag_key_selected_color = (RED,BLUE,ON)
|
||||
|
||||
# Check box color
|
||||
check_color = dialog_color
|
||||
|
||||
# Selected check box color
|
||||
check_selected_color = button_active_color
|
||||
|
||||
# Up arrow color
|
||||
uarrow_color = (GREEN,WHITE,ON)
|
||||
|
||||
# Down arrow color
|
||||
darrow_color = uarrow_color
|
||||
|
||||
# Item help-text color
|
||||
itemhelp_color = (WHITE,BLACK,OFF)
|
||||
|
||||
# Active form text color
|
||||
form_active_text_color = button_active_color
|
||||
|
||||
# Form text color
|
||||
form_text_color = (WHITE,CYAN,OFF)
|
||||
|
||||
# Readonly form item color
|
||||
form_item_readonly_color = (CYAN,WHITE,OFF)
|
||||
|
||||
# Dialog box gauge color
|
||||
gauge_color = title_color
|
||||
|
||||
# Dialog box border2 color
|
||||
border2_color = dialog_color
|
||||
|
||||
# Input box border2 color
|
||||
inputbox_border2_color = dialog_color
|
||||
|
||||
# Search box border2 color
|
||||
searchbox_border2_color = dialog_color
|
||||
|
||||
# Menu box border2 color
|
||||
menubox_border2_color = dialog_color
|
||||
BIN
docs/A23.pdf
Normal file
BIN
docs/A23.pdf
Normal file
Binary file not shown.
80
docs/A23.tex
Normal file
80
docs/A23.tex
Normal file
@@ -0,0 +1,80 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,257mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
|
||||
\usepackage{pgf}
|
||||
|
||||
\pgfmathsetseed{\number\pdfrandomseed} % to ensure that it is randomized
|
||||
% use \randomseed for xelatex
|
||||
|
||||
\newcommand{\randomnum}[1]{%
|
||||
\pgfmathsetmacro{\thenum}{int(random(ceil(#1-#1/4),floor(#1+#1/4)))}%
|
||||
\thenum%
|
||||
}%
|
||||
|
||||
|
||||
\newcommand{\answerbox}[1]{%%
|
||||
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
|
||||
|
||||
\title{\textbf{Application Form A23}}
|
||||
\author{c3gov}
|
||||
\date{Control no. \randomnum{1000}}
|
||||
|
||||
\addtolength{\topmargin}{-2cm}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
\section*{}
|
||||
I hereby applicate for the registration of being a hacker.
|
||||
\\
|
||||
The passport document has been \ \ \ \answerbox{0.1} already issued in a blank state \ \ \ \answerbox{0.1} not yet issued
|
||||
|
||||
|
||||
\section*{Personal data}
|
||||
\
|
||||
|
||||
Forename/Nick (max. 17 characters)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Surname (max. 17 characters) [optional]
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Home(-hackerspace) (max. 17 characters)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
\section*{Current situation}
|
||||
\subsection*{Chaos events}
|
||||
This is my \ \ \ \ \answerbox{0.1} first \ \ \ \ \answerbox{0.1} second \ \ \ \ \answerbox{0.1} $\{\exists x \in \mathbb{N} \ |\ x > 2 \}$ \ \ \ Chaos event I've ever visited.
|
||||
|
||||
\subsection*{The Chaos}
|
||||
I know \ \ \ \answerbox{0.1} nothing$^{1)}$ \ \ \ \answerbox{0.1} somewhat \ \ \ \answerbox{0.1} the secret \ \ \ \ about the Chaos.
|
||||
\\
|
||||
$^{1)}$Please fill out form R22
|
||||
\section*{Additional hints}
|
||||
\begin{itemize}
|
||||
\item To register your \textbf{GPG fingerprint} on your passport, please fill out \textbf{Form PKSR20}.
|
||||
\end{itemize}
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
docs/PKSR20.pdf
Normal file
BIN
docs/PKSR20.pdf
Normal file
Binary file not shown.
95
docs/PKSR20.tex
Normal file
95
docs/PKSR20.tex
Normal file
@@ -0,0 +1,95 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,257mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
|
||||
\usepackage{pgf}
|
||||
|
||||
\pgfmathsetseed{\number\pdfrandomseed} % to ensure that it is randomized
|
||||
% use \randomseed for xelatex
|
||||
|
||||
\newcommand{\randomnum}[1]{%
|
||||
\pgfmathsetmacro{\thenum}{int(random(ceil(#1-#1/4),floor(#1+#1/4)))}%
|
||||
\thenum%
|
||||
}%
|
||||
|
||||
|
||||
\newcommand{\answerbox}[1]{%%
|
||||
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
|
||||
|
||||
\title{\textbf{Additional Form PKSR20}}
|
||||
\author{c3gov}
|
||||
\date{Control no. \answerbox{1}}
|
||||
|
||||
\addtolength{\topmargin}{-2cm}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
\section*{}
|
||||
I hereby applicate to register my GPG fingerprint on my passport.
|
||||
I fullfil the requirement that I have either
|
||||
\begin{itemize}
|
||||
\item[1.] uploaded the public key to the \textbf{keys.openpgp.org} keyserver \textbf{using the following mail address} or
|
||||
\item[2.] I can state the \textbf{full GPG fingerprint}, which is
|
||||
\end{itemize}
|
||||
\
|
||||
Mail address or full GPG fingerprint (e.g. 1234-2234-3234-4234-5234-6234-7234-8234-9234-0234)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
I state that I am certain about the requirements given above and checked that these requirements are given during the registration process.
|
||||
|
||||
|
||||
\section*{Additional information}
|
||||
The following colour is applicable on this fingerprint:
|
||||
\\
|
||||
Colour of fingerprint
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
Please reason the chosen color in a small sentence.
|
||||
\\
|
||||
Reason
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
From a scale from 1 (definitely not) to 5 (definitely), how private is your public key?
|
||||
\\
|
||||
\\
|
||||
\answerbox{0.1} 1 \ \ \ \answerbox{0.1} 2 \ \ \ \answerbox{0.1} 3 \ \ \ \answerbox{0.1} 4 \ \ \ \answerbox{0.1} 5 \ \ \
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
From a scale from 1 (definitely not) to 5 (definitely), how private is your private key?
|
||||
\\
|
||||
\\
|
||||
\answerbox{0.1} 1 \ \ \ \answerbox{0.1} 2 \ \ \ \answerbox{0.1} 3 \ \ \ \answerbox{0.1} 4 \ \ \ \answerbox{0.1} 5 \ \ \
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
From a scale from 1 (definitely not) to 5 (definitely), how public is your public key?
|
||||
\\
|
||||
\\
|
||||
\answerbox{0.1} 1 \ \ \ \answerbox{0.1} 2 \ \ \ \answerbox{0.1} 3 \ \ \ \answerbox{0.1} 4 \ \ \ \answerbox{0.1} 5 \ \ \
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
docs/PrivacyPolicy.pdf
Normal file
BIN
docs/PrivacyPolicy.pdf
Normal file
Binary file not shown.
46
docs/PrivacyPolicy.tex
Normal file
46
docs/PrivacyPolicy.tex
Normal file
@@ -0,0 +1,46 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,257mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
\title{\textbf{Privacy Policy}}
|
||||
\author{c3gov}
|
||||
\date{}
|
||||
|
||||
\addtolength{\topmargin}{-2cm}
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
\section*{Statement}
|
||||
This office is compliant with the GDPR.
|
||||
\\
|
||||
|
||||
\section*{Reasoning}
|
||||
\begin{itemize}
|
||||
\item The gathered information will not kept in the office after finishing the process. They will be always hand over to the applicant. If, how ever, the applicant fails to pick up their documents after the end of the running event, it
|
||||
\begin{itemize}
|
||||
\item will be kept save until the next event,
|
||||
\item can be requested via the Chaos Computer Club Essen
|
||||
\end{itemize}
|
||||
\item The information requiring the usage of the computer are always saved volatilely for issuing the passport document.
|
||||
\end{itemize}
|
||||
|
||||
\section*{Contact}
|
||||
Contact information:
|
||||
\begin{itemize}
|
||||
\item Bandie \textless bandie at chaospott.de\textgreater, DECT: 2263
|
||||
\end{itemize}
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
docs/Y42.pdf
Normal file
BIN
docs/Y42.pdf
Normal file
Binary file not shown.
81
docs/Y42.tex
Normal file
81
docs/Y42.tex
Normal file
@@ -0,0 +1,81 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,257mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
|
||||
\usepackage{pgf}
|
||||
|
||||
\pgfmathsetseed{\number\pdfrandomseed} % to ensure that it is randomized
|
||||
% use \randomseed for xelatex
|
||||
|
||||
\newcommand{\randomnum}[1]{%
|
||||
\pgfmathsetmacro{\thenum}{int(random(ceil(#1-#1/4),floor(#1+#1/4)))}%
|
||||
\thenum%
|
||||
}%
|
||||
|
||||
|
||||
\newcommand{\answerbox}[1]{%%
|
||||
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
|
||||
|
||||
\title{\textbf{Application Form Y42}}
|
||||
\author{c3gov}
|
||||
\date{Control no. \randomnum{1000}}
|
||||
|
||||
\addtolength{\topmargin}{-1cm}
|
||||
\addtolength{\textheight}{1cm}
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
|
||||
\section*{}
|
||||
I hereby applicate for the registration of being a hacker.
|
||||
\\
|
||||
The passport document has been \ \ \ \answerbox{0.1} already issued in a blank state \ \ \ \answerbox{0.1} not yet issued
|
||||
|
||||
|
||||
\section*{Personal data}
|
||||
\
|
||||
|
||||
Forename/Nick (max. 25 characters)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Surname (max. 25 characters) [optional]
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Home(-hackerspace) (max. 25 characters)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
\section*{Current situation}
|
||||
\subsection*{Chaos events}
|
||||
This is my \ \ \ \ \answerbox{0.1} first \ \ \ \ \answerbox{0.1} second \ \ \ \ \answerbox{0.1} $\{\exists x \in \mathbb{N} \ |\ x > 2 \}$ \ \ \ Chaos event I've ever visited.
|
||||
|
||||
\subsection*{The Chaos}
|
||||
I know \ \ \ \answerbox{0.1} nothing \ \ \ \answerbox{0.1} somewhat \ \ \ \answerbox{0.1} the secret \ \ \ \ about the Chaos.
|
||||
\\
|
||||
|
||||
\section*{Additional hints}
|
||||
\begin{itemize}
|
||||
\item To register your \textbf{GPG fingerprint} on your passport, please fill out \textbf{Form PKSR20}.
|
||||
\end{itemize}
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
docs/c3govsticker.png
Normal file
BIN
docs/c3govsticker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 178 KiB |
BIN
docs/de/A23_de.pdf
Normal file
BIN
docs/de/A23_de.pdf
Normal file
Binary file not shown.
94
docs/de/A23_de.tex
Normal file
94
docs/de/A23_de.tex
Normal file
@@ -0,0 +1,94 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,287mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
|
||||
\usepackage{pgf}
|
||||
|
||||
\pgfmathsetseed{\number\pdfrandomseed} % to ensure that it is randomized
|
||||
% use \randomseed for xelatex
|
||||
|
||||
\newcommand{\randomnum}[1]{%
|
||||
\pgfmathsetmacro{\thenum}{int(random(ceil(#1-#1/4),floor(#1+#1/4)))}%
|
||||
\thenum%
|
||||
}%
|
||||
|
||||
|
||||
\newcommand{\answerbox}[1]{%%
|
||||
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
|
||||
|
||||
\title{\textbf{Antragsformular A23}}
|
||||
\author{c3gov}
|
||||
\date{Kontrollnummer \randomnum{1000}}
|
||||
|
||||
\addtolength{\topmargin}{-2cm}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
\section*{}
|
||||
Hiermit beantrage ich mich als Hacker*in / Haeckse zu registrieren.
|
||||
\\
|
||||
Ein Ausweis \ \ \ \answerbox{0.1} ist bereits im Blanko-Zustand vorhanden \ \ \ \answerbox{0.1} wurde noch nicht ausgestellt.
|
||||
|
||||
|
||||
\section*{Persönliche Daten}
|
||||
\
|
||||
|
||||
Vor- oder Nickname (max. 17 Zeichen)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Nachname (max. 17 Zeichen) - optional
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Home(-hackspace) (max. 17 Zeichen)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
\section*{Derzeitige Lebensumstände}
|
||||
\subsection*{Chaos-Events}
|
||||
Ich habe bisher \ \ \ \ \answerbox{0.1} ein \ \ \ \ \answerbox{0.1} zwei \ \ \ \ \answerbox{0.1} $\{\exists x \in \mathbb{N} \ |\ x > 2 \}$ \ \ \ Chaos-Events besucht.
|
||||
|
||||
\subsection*{Das Chaos}
|
||||
Ich weiß \ \ \ \answerbox{0.1} nichts$^{1)}$ \ \ \ \answerbox{0.1} etwas$^{2)}$ \ \ \ \answerbox{0.1} das Geheimnis$^{3)}$ \ \ \ \ vom Chaos.
|
||||
\\
|
||||
\\
|
||||
Wenn $^{1)}$: \\
|
||||
Was fanden Sie bisher am interessantesten?\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
Wenn $^{2)}$: \\
|
||||
Haben Sie schon ein Home-Space gefunden?\\
|
||||
\answerbox{0.1} ja \ \ \ \ \answerbox{0.1} nein
|
||||
\\
|
||||
\\
|
||||
Wenn $^{3)}$: \\
|
||||
Bitte vervollständigen Sie: Das geht nicht in \answerbox{3.5}.
|
||||
\\
|
||||
|
||||
\section*{Hinweis}
|
||||
\begin{itemize}
|
||||
\item Um Ihren \textbf{GPG-Fingerabdruck} auf Ihren Passport mitzuregistrieren, bitte \textbf{Formular PKSR20} ausfüllen.
|
||||
\end{itemize}
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
docs/de/PKSR20_de.pdf
Normal file
BIN
docs/de/PKSR20_de.pdf
Normal file
Binary file not shown.
93
docs/de/PKSR20_de.tex
Normal file
93
docs/de/PKSR20_de.tex
Normal file
@@ -0,0 +1,93 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,257mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
|
||||
\usepackage{pgf}
|
||||
|
||||
\pgfmathsetseed{\number\pdfrandomseed} % to ensure that it is randomized
|
||||
% use \randomseed for xelatex
|
||||
|
||||
\newcommand{\randomnum}[1]{%
|
||||
\pgfmathsetmacro{\thenum}{int(random(ceil(#1-#1/4),floor(#1+#1/4)))}%
|
||||
\thenum%
|
||||
}%
|
||||
|
||||
|
||||
\newcommand{\answerbox}[1]{%%
|
||||
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
|
||||
|
||||
\title{\textbf{Zusatzformular PKSR20}}
|
||||
\author{c3gov}
|
||||
\date{Kontrollnummer \answerbox{1}}
|
||||
|
||||
\addtolength{\topmargin}{-2cm}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
\section*{}
|
||||
Hiermit beantrage ich meinen GPG-Fingerabdruck auf meinem Passport eintragen zu lassen.
|
||||
Ich erfülle die Voraussetzung, dass ich entweder
|
||||
\begin{itemize}
|
||||
\item[1.] den öffentlichen Schlüssel auf den Schlüsselserver von \textbf{keys.openpgp.org} unter \textbf{folgender E-Mail-Adresse hochgeladen habe} oder
|
||||
\item[2.] ich den \textbf{gesamten GPG-Fingerabdruck} angeben kann, und zwar
|
||||
\end{itemize}
|
||||
\
|
||||
E-Mail-Adresse oder gesamter GPG-Fingerabdruck\\
|
||||
(z.B. 1234-2234-3234-4234-5234-6234-7234-8234-9234-0234)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
Ich versichere, dass ich die oben angegebenen Voraussetzungen erfülle und überprüft habe, dass jene Voraussetzung auch während des Registrierungs- und Ausstellungsprozesses gegeben sind.
|
||||
|
||||
|
||||
\section*{Zusätzliche Angaben}
|
||||
Folgende Farbe ist auf den GPG-Fingerabdruck anwendbar:
|
||||
\\
|
||||
Fingerabdruck-Farbe
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
Bitte Auswahl in einem Satz begründen.
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
Von einer Skala von 1 (auf keinen Fall) bis 5 (auf jeden Fall), wie privat ist Ihr öffentlicher Schlüssel?
|
||||
\\
|
||||
\\
|
||||
\answerbox{0.1} 1 \ \ \ \answerbox{0.1} 2 \ \ \ \answerbox{0.1} 3 \ \ \ \answerbox{0.1} 4 \ \ \ \answerbox{0.1} 5 \ \ \
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
Von einer Skala von 1 (auf keinen Fall) bis 5 (auf jeden Fall), wie privat ist Ihr privater Schlüssel?
|
||||
\\
|
||||
\\
|
||||
\answerbox{0.1} 1 \ \ \ \answerbox{0.1} 2 \ \ \ \answerbox{0.1} 3 \ \ \ \answerbox{0.1} 4 \ \ \ \answerbox{0.1} 5 \ \ \
|
||||
\\
|
||||
\\
|
||||
\\
|
||||
Von einer Skala von 1 (auf keinen Fall) bis 5 (auf jeden Fall), wie öffentlich ist Ihr öffentlicher Schlüssel?
|
||||
\\
|
||||
\\
|
||||
\answerbox{0.1} 1 \ \ \ \answerbox{0.1} 2 \ \ \ \answerbox{0.1} 3 \ \ \ \answerbox{0.1} 4 \ \ \ \answerbox{0.1} 5 \ \ \
|
||||
|
||||
\end{document}
|
||||
|
||||
BIN
docs/de/Y42_de.pdf
Normal file
BIN
docs/de/Y42_de.pdf
Normal file
Binary file not shown.
86
docs/de/Y42_de.tex
Normal file
86
docs/de/Y42_de.tex
Normal file
@@ -0,0 +1,86 @@
|
||||
\documentclass[11pt,a4paper]{article}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{geometry}
|
||||
\geometry{
|
||||
a4paper,
|
||||
total={170mm,257mm},
|
||||
left=20mm,
|
||||
top=20mm,
|
||||
}
|
||||
|
||||
|
||||
|
||||
\usepackage{pgf}
|
||||
|
||||
\pgfmathsetseed{\number\pdfrandomseed} % to ensure that it is randomized
|
||||
% use \randomseed for xelatex
|
||||
|
||||
\newcommand{\randomnum}[1]{%
|
||||
\pgfmathsetmacro{\thenum}{int(random(ceil(#1-#1/4),floor(#1+#1/4)))}%
|
||||
\thenum%
|
||||
}%
|
||||
|
||||
|
||||
\newcommand{\answerbox}[1]{%%
|
||||
\fbox{\rule{#1in}{0pt}\rule[-0.5ex]{0pt}{4ex}}}
|
||||
|
||||
\title{\textbf{Antragsformular Y42}}
|
||||
\author{c3gov}
|
||||
\date{Kontrollnummer \randomnum{1000}}
|
||||
|
||||
\addtolength{\topmargin}{-1cm}
|
||||
\addtolength{\textheight}{1cm}
|
||||
|
||||
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
|
||||
\section*{}
|
||||
Hiermit beantrage ich mich als Hacker*in / Haeckse zu registrieren.
|
||||
\\
|
||||
Ein Ausweis \ \ \ \answerbox{0.1} ist bereits im Blanko-Zustand vorhanden \ \ \ \answerbox{0.1} wurde noch nicht ausgestellt.
|
||||
|
||||
|
||||
\section*{Persönliche Daten}
|
||||
\
|
||||
|
||||
Vor- oder Nickname (max. 25 Zeichen)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Nachname (max. 25 characters) [optional]
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
Home(-hackspace) (max. 25 characters)
|
||||
\\
|
||||
\answerbox{6.5}
|
||||
\\
|
||||
|
||||
\section*{Derzeitige Lebensumstände}
|
||||
\subsection*{Chaos-Events}
|
||||
Ich habe bisher \ \ \ \ \answerbox{0.1} ein \ \ \ \ \answerbox{0.1} zwei \ \ \ \ \answerbox{0.1} $\{\exists x \in \mathbb{N} \ |\ x > 2 \}$ \ \ \ Chaos-Events besucht.
|
||||
|
||||
\subsection*{Das Chaos}
|
||||
Ich weiß \ \ \ \answerbox{0.1} nichts$^{1)}$ \ \ \ \answerbox{0.1} etwas$^{2)}$ \ \ \ \answerbox{0.1} das Geheimnis$^{3)}$ \ \ \ \ vom Chaos.
|
||||
\\
|
||||
\\
|
||||
$^{1)}$Bitte Formular R21 ausfüllen \\
|
||||
$^{2)}$Bitte Formular R22 ausfüllen \\
|
||||
$^{3)}$Bitte Formular R23 ausfüllen \\
|
||||
\section*{Hinweis}
|
||||
\begin{itemize}
|
||||
\item Um Ihren \textbf{GPG-Fingerabdruck} auf Ihren Passport mitzuregistrieren, bitte \textbf{Formular PKSR20} ausfüllen.
|
||||
\end{itemize}
|
||||
|
||||
\end{document}
|
||||
|
||||
|
||||
|
||||
8
etc/systemd/system/getty@ttyUSB0.service.d/override.conf
Normal file
8
etc/systemd/system/getty@ttyUSB0.service.d/override.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=
|
||||
ExecStart=-/root/c3gov/start_dialog
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
8
etc/systemd/system/getty@ttyUSB1.service.d/override.conf
Normal file
8
etc/systemd/system/getty@ttyUSB1.service.d/override.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=
|
||||
ExecStart=-/root/c3gov/start_dialog
|
||||
StandardInput=tty
|
||||
StandardOutput=tty
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
@@ -1,12 +1,14 @@
|
||||
#!/bin/bash
|
||||
DEVICE=/dev/ttyUSB0
|
||||
|
||||
function init() {
|
||||
|
||||
stty -F $DEVICE 1:0:80000dbd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
|
||||
|
||||
# \x1b\x47 - Double Strike
|
||||
# \x1b\x78\x01 - Standard Letter Mode
|
||||
# \x1b\x52\x02 - German
|
||||
printf "\x1b\x47\x1b\x78\x01\x1b\x52\x02" >> "$DEVICE"
|
||||
# \x1b\x33\x20 - 20/180 inch line spacing (standard)
|
||||
printf "\x1b\x47\x1b\x78\x01\x1b\x52\x02\x1b\x33\x20" >> "$DEVICE"
|
||||
|
||||
}
|
||||
|
||||
@@ -39,5 +41,17 @@ function italicLetters() {
|
||||
printf "\x1b\x34" >> "$1"
|
||||
}
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> "$2"
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf " " >> "$2"
|
||||
done
|
||||
}
|
||||
|
||||
init
|
||||
resetLetters $DEVICE
|
||||
|
||||
@@ -11,10 +11,9 @@ HEADINGRIGHT=8
|
||||
# GPG Space
|
||||
NEXTPAGE=30
|
||||
NEXTPAGESMALL=48
|
||||
NEXTFIELDBOTTOM=7
|
||||
NEXTFIELDBOTTOM=6
|
||||
NEXTFIELDRIGHT=14
|
||||
NEXTFIELDRIGHTSMALL=25
|
||||
MAXLENGTH=22
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -e "$0: Syntax:\n$0 FIELD\n\nExample:\n$0 7\n\n\nFields:
|
||||
@@ -47,18 +46,6 @@ function moveDown() {
|
||||
done
|
||||
}
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf " " >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
@@ -73,34 +60,20 @@ function heading() {
|
||||
fi
|
||||
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
fi
|
||||
makeLeft 1
|
||||
makeLeft $SPACE
|
||||
italicLetters $FILE
|
||||
printf "GALACTIC\n" >> $FILE
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
fi
|
||||
makeLeft 1
|
||||
makeLeft $SPACE
|
||||
printf "REGISTRATION\n" >> $FILE
|
||||
bigLetters $FILE
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
if [ $(($FIELD % 2)) -eq 1 ]; then
|
||||
makeLeft $(($HSPACE - 1))
|
||||
makeLeft $(($HSPACE - 1)) $FILE
|
||||
fi
|
||||
else
|
||||
if [ $(($FIELD % 2)) -eq 0 ]; then
|
||||
makeLeft 1
|
||||
makeLeft 1 $FILE
|
||||
fi
|
||||
makeLeft $HSPACE
|
||||
makeLeft $HSPACE $FILE
|
||||
fi
|
||||
printf "OFFICE\n" >> $FILE
|
||||
printf "c3gov\n" >> $FILE
|
||||
resetLetters $FILE
|
||||
|
||||
}
|
||||
@@ -114,10 +87,10 @@ function insertDate() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGESMALL
|
||||
makeLeft $NEXTPAGESMALL $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
@@ -129,7 +102,7 @@ function insertDate() {
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertDate
|
||||
|
||||
46
jhp/gpgkey
46
jhp/gpgkey
@@ -10,7 +10,7 @@ HEADINGRIGHT=15
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=48
|
||||
NEXTFIELDBOTTOM=7
|
||||
NEXTFIELDBOTTOM=6
|
||||
NEXTFIELDRIGHT=25
|
||||
MAXLENGTH=22
|
||||
|
||||
@@ -45,18 +45,6 @@ function moveDown() {
|
||||
done
|
||||
}
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf " " >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
@@ -69,11 +57,11 @@ function heading() {
|
||||
fi
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
fi
|
||||
|
||||
makeLeft $LEFT
|
||||
makeLeft $SPACE
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $SPACE $FILE
|
||||
|
||||
bigLetters $FILE
|
||||
printf "GPG" >> $FILE
|
||||
@@ -90,10 +78,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
@@ -101,10 +89,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
@@ -112,10 +100,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
@@ -123,10 +111,10 @@ function insertFP() {
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT
|
||||
makeLeft $(($SPACE + 2))
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
@@ -138,7 +126,7 @@ function insertFP() {
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertFP $@
|
||||
|
||||
|
||||
30
jhp/msg5
30
jhp/msg5
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
echo "1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
0
|
||||
1" > $FILE
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
@@ -8,18 +8,6 @@ GIVENNAME=$1
|
||||
SURNAME=$2
|
||||
HOME=$3
|
||||
|
||||
function makeNewline() {
|
||||
for((i=0; i<$1; i++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
function makeLeft() {
|
||||
for((i=0; i<$LEFT; i++)); do
|
||||
printf " " >> $FILE
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
if [ ${#GIVENNAME} -gt $MAXLENGTH ] || [ ${#SURNAME} -gt $MAXLENGTH ] || [ ${#HOME} -gt $MAXLENGTH ]; then
|
||||
echo "MAXLENGTH EXCEEDED."
|
||||
@@ -30,20 +18,26 @@ fi
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP
|
||||
makeLeft
|
||||
makeNewline 1 $FILE
|
||||
makeLeft $(($LEFT + 12)) $FILE
|
||||
smallLetters $FILE
|
||||
printf "/ c3gov" >> $FILE
|
||||
resetLetters $FILE
|
||||
|
||||
makeNewline $(($TOP - 1)) $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$GIVENNAME" >> $FILE
|
||||
|
||||
makeNewline 4
|
||||
makeLeft
|
||||
makeNewline 3 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$SURNAME" >> $FILE
|
||||
|
||||
makeNewline 3
|
||||
makeLeft
|
||||
makeNewline 3 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$HOME" >> $FILE
|
||||
|
||||
makeNewline 4
|
||||
makeLeft
|
||||
makeNewline 4 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
40
jhp/secure
Executable file
40
jhp/secure
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=5
|
||||
TOP=13
|
||||
TOP2=51
|
||||
LEFT=23
|
||||
|
||||
VISAPAGES=2
|
||||
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Syntax: $0 <SecurityNumber>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sn=$1
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
smallLetters $FILE
|
||||
printf "\x1b\x33\x0e" >> $FILE
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
|
||||
printf "$sn" >> $FILE
|
||||
|
||||
makeNewline $(($TOP2 - $TOP)) $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$sn" >> $FILE
|
||||
resetLetters $FILE
|
||||
|
||||
echo "Only use the pages saying \"VISAs\" on top"
|
||||
for (( i=1; i<=$VISAPAGES; i++)); do
|
||||
read -s -p "Insert page $i of $VISAPAGES and press enter."
|
||||
echo ""
|
||||
printFile $FILE
|
||||
done
|
||||
|
||||
rm $FILE
|
||||
1
jhp/test
1
jhp/test
@@ -1 +0,0 @@
|
||||
./JunghackerPass "Foobert" "van Barbert" "Erde / Earth" "37C3, $(date -I)"
|
||||
108
stapleddipl/c3gov
Executable file
108
stapleddipl/c3gov
Executable file
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=1
|
||||
LEFT=5
|
||||
|
||||
# Additional heading space
|
||||
HEADINGNEXTPAGE=19
|
||||
HEADINGLEFT=1
|
||||
HEADINGRIGHT=10
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=34
|
||||
NEXTPAGESMALL=60
|
||||
NEXTFIELDBOTTOM=13
|
||||
NEXTFIELDRIGHT=18
|
||||
NEXTFIELDRIGHTSMALL=30
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -e "$0: Syntax:\n$0 FIELD\n\nExample:\n$0 7\n\n\nFields:
|
||||
==================
|
||||
| VISAS || VISAS |
|
||||
==================
|
||||
| 0 | 1 || 4 | 5 |
|
||||
|---|---||---|---|
|
||||
| 2 | 3 || 6 | 7 |
|
||||
==================
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PAGE=$(($1 / 4))
|
||||
FIELD=$(($1 % 4))
|
||||
|
||||
shift 1
|
||||
|
||||
|
||||
echo "PAGE: $PAGE, FIELD: $FIELD"
|
||||
|
||||
|
||||
|
||||
function moveDown() {
|
||||
for((i=0; i<$(($FIELD / 2)); i++)); do
|
||||
for((j=0; j<$NEXTFIELDBOTTOM; j++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
|
||||
|
||||
if [ $(($FIELD % 2)) -eq 0 ]; then
|
||||
HSPACE=$HEADINGLEFT
|
||||
SPACE=0
|
||||
else
|
||||
HSPACE=$HEADINGRIGHT
|
||||
SPACE=$NEXTFIELDRIGHT
|
||||
fi
|
||||
|
||||
|
||||
bigLetters $FILE
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
if [ $(($FIELD % 2)) -eq 1 ]; then
|
||||
makeLeft $(($HSPACE - 1)) $FILE
|
||||
fi
|
||||
else
|
||||
makeLeft 1 $FILE
|
||||
makeLeft $HSPACE $FILE
|
||||
fi
|
||||
printf "c3gov\n" >> $FILE
|
||||
resetLetters $FILE
|
||||
|
||||
}
|
||||
|
||||
function insertDate() {
|
||||
if [ $(($FIELD % 2 )) -eq 0 ]; then
|
||||
SPACE=0
|
||||
else
|
||||
SPACE=$NEXTFIELDRIGHTSMALL
|
||||
fi
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGESMALL $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
printf "$(date -I)" >> $FILE
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertDate
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
134
stapleddipl/gpgkey
Executable file
134
stapleddipl/gpgkey
Executable file
@@ -0,0 +1,134 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=1
|
||||
LEFT=3
|
||||
|
||||
# Additional heading space
|
||||
HEADINGNEXTPAGE=36
|
||||
HEADINGLEFT=1
|
||||
HEADINGRIGHT=20
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=58
|
||||
NEXTFIELDBOTTOM=11
|
||||
NEXTFIELDRIGHT=31
|
||||
MAXLENGTH=22
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo -e "$0: Syntax:\n$0 FIELD GPG FINGERPRINT WITH SPACES\n\nExample:\n$0 7 1234 5678 1234 1234 1234 1234 1234 1234 1234 ABCD\n\n\nFields:
|
||||
==================
|
||||
| VISAS || VISAS |
|
||||
==================
|
||||
| 0 | 1 || 4 | 5 |
|
||||
|---|---||---|---|
|
||||
| 2 | 3 || 6 | 7 |
|
||||
==================
|
||||
"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PAGE=$(($1 / 4))
|
||||
FIELD=$(($1 % 4))
|
||||
|
||||
shift 1
|
||||
|
||||
|
||||
echo "PAGE: $PAGE, FIELD: $FIELD"
|
||||
|
||||
|
||||
|
||||
function moveDown() {
|
||||
for((i=0; i<$(($FIELD / 2)); i++)); do
|
||||
for((j=0; j<$NEXTFIELDBOTTOM; j++)); do
|
||||
printf "\n" >> $FILE
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
function heading() {
|
||||
moveDown
|
||||
|
||||
|
||||
if [ $(($FIELD % 2)) -eq 0 ]; then
|
||||
SPACE=$HEADINGLEFT
|
||||
else
|
||||
SPACE=$HEADINGRIGHT
|
||||
fi
|
||||
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $HEADINGNEXTPAGE $FILE
|
||||
fi
|
||||
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $SPACE $FILE
|
||||
|
||||
bigLetters $FILE
|
||||
printf "GPG" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
}
|
||||
|
||||
function insertFP() {
|
||||
if [ $(($FIELD % 2 )) -eq 0 ]; then
|
||||
SPACE=0
|
||||
else
|
||||
SPACE=$NEXTFIELDRIGHT
|
||||
fi
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
shift 4
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2 $3 $4" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
shift 4
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
printf "$1 $2" >> $FILE
|
||||
resetLetters $FILE
|
||||
printf "\n" >> $FILE
|
||||
shift 2
|
||||
|
||||
smallLetters $FILE
|
||||
if [ $PAGE -eq 1 ]; then
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
fi
|
||||
makeLeft $LEFT $FILE
|
||||
makeLeft $(($SPACE + 2)) $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "$EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
printf "$(date -I)" >> $FILE
|
||||
fi
|
||||
}
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP $FILE
|
||||
heading
|
||||
insertFP $@
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
52
stapleddipl/reg
Executable file
52
stapleddipl/reg
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=54
|
||||
NEXTFIELD=5
|
||||
LEFT=23
|
||||
AUTHLEFT=66
|
||||
DATELEFT=35
|
||||
MAXLENGTH=17
|
||||
|
||||
GIVENNAME=$1
|
||||
SURNAME=$2
|
||||
HOME=$3
|
||||
|
||||
|
||||
if [ ${#GIVENNAME} -gt $MAXLENGTH ] || [ ${#SURNAME} -gt $MAXLENGTH ] || [ ${#HOME} -gt $MAXLENGTH ]; then
|
||||
echo "MAXLENGTH EXCEEDED."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
smallLetters $FILE
|
||||
printf "\x1b\x33\x0e" >> $FILE
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$GIVENNAME" >> $FILE
|
||||
|
||||
# Authority field
|
||||
makeNewline 2 $FILE
|
||||
makeLeft $AUTHLEFT $FILE
|
||||
printf "c3gov" >> $FILE
|
||||
|
||||
makeNewline 3 $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$SURNAME" >> $FILE
|
||||
|
||||
makeNewline $NEXTFIELD $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$HOME" >> $FILE
|
||||
|
||||
makeNewline 5 $FILE
|
||||
makeLeft $DATELEFT $FILE
|
||||
|
||||
if [ -n "$EVENT" ]; then
|
||||
printf "/ $EVENT, $(date -I)" >> $FILE
|
||||
else
|
||||
printf "/ $(date -I)" >> $FILE
|
||||
fi
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
41
stapleddipl/secure
Executable file
41
stapleddipl/secure
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=0
|
||||
LEFT=3
|
||||
|
||||
VISAPAGES=6
|
||||
|
||||
# GPG Space
|
||||
NEXTPAGE=28
|
||||
NEXTPAGESMALL=60
|
||||
NEXTFIELDBOTTOM=13
|
||||
NEXTFIELDRIGHT=18
|
||||
NEXTFIELDRIGHTSMALL=30
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Syntax: $0 <SecurityNumber>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sn=$1
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
|
||||
italicLetters $FILE
|
||||
printf "$sn" >> $FILE
|
||||
makeLeft $NEXTPAGE $FILE
|
||||
printf "$sn" >> $FILE
|
||||
resetLetters $FILE
|
||||
|
||||
echo "Only use the pages saying \"VISAs\" on top"
|
||||
for (( i=1; i<=$VISAPAGES; i++)); do
|
||||
read -s -p "Insert page $i of $VISAPAGES and press enter."
|
||||
echo ""
|
||||
printFile $FILE
|
||||
done
|
||||
|
||||
rm $FILE
|
||||
34
stapleddipl/secure_firstpage
Executable file
34
stapleddipl/secure_firstpage
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
TOP=50
|
||||
NEXTFIELD=5
|
||||
LEFT=38
|
||||
MAXLENGTH=6
|
||||
|
||||
GIVENNAME=$1
|
||||
SURNAME=$2
|
||||
HOME=$3
|
||||
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Syntax: $0 <SecurityNumber>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sn=$1
|
||||
|
||||
if [ ${#sn} -gt $MAXLENGTH ]; then
|
||||
echo "Security Number too long"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
smallLetters $FILE
|
||||
printf "\x1b\x33\x0e" >> $FILE
|
||||
makeNewline $TOP $FILE
|
||||
makeLeft $LEFT $FILE
|
||||
printf "$1" >> $FILE
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
367
start
367
start
@@ -1,55 +1,60 @@
|
||||
#!/bin/bash
|
||||
export LANG=C
|
||||
export EVENT=DiVOC
|
||||
|
||||
export DIALOGRC=dialogrc
|
||||
|
||||
LOCKFILE=/tmp/irolock
|
||||
TMP=/tmp/$RANDOM
|
||||
BT="Galactic Registration Office - v0.1"
|
||||
BT="Intergalactic Registration Office - v0.3\n========================================"
|
||||
|
||||
cd $(dirname "$0")
|
||||
|
||||
function clr() {
|
||||
printf "\033H\033J"
|
||||
}
|
||||
|
||||
function infoBox() {
|
||||
clr
|
||||
echo -e "$BT\n\n$1\n\n\n$2"
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
}
|
||||
|
||||
function diaBox() {
|
||||
h=8
|
||||
w=60
|
||||
if [ -n "$3" ]; then
|
||||
h=$3
|
||||
fi
|
||||
if [ -n "$4" ]; then
|
||||
w=$4
|
||||
fi
|
||||
dialog --title "$1" \
|
||||
--backtitle "$BT" \
|
||||
--msgbox "$2" $h $w
|
||||
clr
|
||||
echo -e "$BT\n\n$1\n\n\n$2"
|
||||
read -r -p "Okay? [(o)kay/(a)bort] " resp
|
||||
echo "$resp" > $TMP
|
||||
}
|
||||
|
||||
function ynBox() {
|
||||
h=8
|
||||
w=60
|
||||
if [ -n "$3" ]; then
|
||||
h=$3
|
||||
clr
|
||||
echo -e "$BT\n\n$1\n\n\n$2"
|
||||
read -r -p "Are you sure? [y/N] " resp
|
||||
if [ "$resp" = "" ]; then
|
||||
resp="N"
|
||||
fi
|
||||
if [ -n "$4" ]; then
|
||||
w=$4
|
||||
fi
|
||||
|
||||
dialog --title "$1" \
|
||||
--backtitle "$BT" \
|
||||
--yesno "$2" $h $w
|
||||
|
||||
return $?
|
||||
echo "$resp" > $TMP
|
||||
}
|
||||
|
||||
function askStr() {
|
||||
h=12
|
||||
w=60
|
||||
if [ -n "$5" ]; then
|
||||
h=$5
|
||||
fi
|
||||
if [ -n "$6" ]; then
|
||||
w=$6
|
||||
fi
|
||||
clr
|
||||
echo -e "$BT\n\n$2\n\n\n$3"
|
||||
read resp
|
||||
|
||||
dialog --title "$2" \
|
||||
--backtitle "$BT" \
|
||||
--max-input $1 \
|
||||
--inputbox "$3" $h $w "$4" 2> $TMP
|
||||
return $?
|
||||
echo "$resp" > $TMP
|
||||
|
||||
}
|
||||
|
||||
function askPw() {
|
||||
clr
|
||||
echo -e "$BT\n\n$2\n\n"
|
||||
|
||||
stty -echo
|
||||
|
||||
read -r -p "$3 " resp
|
||||
|
||||
echo "$resp" > $TMP
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
@@ -68,8 +73,142 @@ function confirm() {
|
||||
return $?
|
||||
}
|
||||
|
||||
function jhpAskForField() {
|
||||
text="$1: Please choose a free field on the passport.\n
|
||||
function askStrThird() {
|
||||
h=12
|
||||
w=60
|
||||
if [ -n "$6" ]; then
|
||||
h=$5
|
||||
fi
|
||||
if [ -n "$7" ]; then
|
||||
w=$6
|
||||
fi
|
||||
|
||||
dialog --backtitle "$BT" \
|
||||
--max-input $1 \
|
||||
--title "$2" \
|
||||
--extra-button --extra-label "$4" \
|
||||
--inputbox "$3" $h $w "$5" 2> $TMP
|
||||
return $?
|
||||
}
|
||||
|
||||
function gpgSearch() {
|
||||
askStr 255 "GPG Search" "Type in the mail address you'd like to look up on keys.openpgp.org."
|
||||
if [ $? -eq 0 ]; then
|
||||
if [[ "$(cat $TMP)" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]]; then
|
||||
clear
|
||||
echo "Searching for GPG key..."
|
||||
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
||||
if [ $? -eq 0 ]; then
|
||||
FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
|
||||
gpg --batch --delete-key "$FFP"
|
||||
if [ "$FFP" = "" ]; then
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
diaBox "GPG Search" "This is on vaild mail address."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
function enterGPG() {
|
||||
askStrThird 49 "GPG Fingerprint" "Enter GPG fingerprint WITH SPACES. E.g.:\n 1234 5678 9ABC DEF0 1234 5678 9ABC DEF0 1234 5678" "Search..." "$1"
|
||||
|
||||
ret=$?
|
||||
case $ret in
|
||||
0)
|
||||
FP=$(cat $TMP)
|
||||
rm $TMP
|
||||
if ! [[ $FP =~ ^([[:xdigit:]]{4} ){9}[[:xdigit:]]{4}$ ]]; then
|
||||
diaBox "GPG Fingerprint" "This does not match the RegEx of a GPG fingerprint.\nPlease type in the whole fingerprint."
|
||||
enterGPG
|
||||
fi
|
||||
FP=$(echo "$FP" | tr [a-f] [A-F])
|
||||
;;
|
||||
1)
|
||||
return 1
|
||||
;;
|
||||
3)
|
||||
gpgSearch
|
||||
if [ $? -eq 0 ]; then
|
||||
enterGPG "$FFP" "no-confirm"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$2" == "no-confirm" ]; then
|
||||
return 0
|
||||
else
|
||||
confirm "GPG Fingerprint" " GPG:\n $FP"
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
|
||||
function checkLockFile() {
|
||||
while [ -f $LOCKFILE ]; do
|
||||
infoBox "Printer is in use..." "Printer is in use. Please wait."
|
||||
sleep 1
|
||||
done
|
||||
touch $LOCKFILE
|
||||
}
|
||||
|
||||
function printGPG() {
|
||||
askForField "GPG fingerprint" "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer."
|
||||
cd "$1"
|
||||
./gpgkey $FIELD $FP
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function printReg() {
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (First page, name, place) into the printer."
|
||||
cd "$1"
|
||||
./reg "$FNAME" "$SNAME" "$PLANET"
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
}
|
||||
|
||||
function printIROStamp() {
|
||||
askForField "IRO stamp" "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer."
|
||||
cd "$1"
|
||||
./iro $FIELD
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function askForField() {
|
||||
declare -A layout
|
||||
declare -A maxfield
|
||||
text="$1: Please choose a free field on the passport.\n"
|
||||
|
||||
layout[jhp]="
|
||||
------------------\n
|
||||
| Archievements |\n
|
||||
==================\n
|
||||
@@ -80,96 +219,60 @@ function jhpAskForField() {
|
||||
| 4 | 5 || 10| 11|\n
|
||||
==================\n
|
||||
"
|
||||
askStr 2 "Select a field" "$text" "" 18
|
||||
|
||||
layout[adafruit]="
|
||||
------------------\n
|
||||
| VISAS || VISAS |\n
|
||||
==================\n
|
||||
| 0 | 1 || 4 | 5 |\n
|
||||
|---|---||---|---|\n
|
||||
| 2 | 3 || 6 | 7 |\n
|
||||
==================\n
|
||||
"
|
||||
|
||||
maxfield[jhp]=11
|
||||
maxfield[adafruit]=7
|
||||
|
||||
askStr 2 "Select a field" "$text ${layout[$2]}" "" 18
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
FIELD=$(cat $TMP)
|
||||
if ! [[ "$FIELD" =~ ^[0-9]+$ ]] || [ -z "$FIELD" ] || [ $FIELD -lt 0 ] || [ $FIELD -gt 11 ]; then
|
||||
jhpAskForField
|
||||
if ! [[ "$FIELD" =~ ^[0-9]+$ ]] || [ -z "$FIELD" ] || [ $FIELD -lt 0 ] || [ $FIELD -gt ${maxfield[$2]} ]; then
|
||||
askForField "$1" "$2"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function jhpPrintGPG() {
|
||||
jhpAskForField "GPG fingerprint"
|
||||
if [ $? -eq 0 ]; then
|
||||
diaBox "Insert Passport" "Please insert passport (Archivements) into the printer."
|
||||
cd jhp
|
||||
./gpgkey $FIELD $FP
|
||||
cd ..
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function jhpPrintReg() {
|
||||
diaBox "Insert Passport" "Please insert passport (First page, name, planet, date) into the printer."
|
||||
cd jhp
|
||||
./JunghackerPass "$FNAME" "$SNAME" "$PLANET"
|
||||
cd ..
|
||||
return 0
|
||||
}
|
||||
function askReg() {
|
||||
# Max length of passport fields
|
||||
declare -A MAXLENGTH
|
||||
MAXLENGTH[jhp]=25
|
||||
MAXLENGTH[adafruit]=17
|
||||
|
||||
function jhpGROStamp() {
|
||||
jhpAskForField "GRO stamp"
|
||||
if [ $? -eq 0 ]; then
|
||||
diaBox "Insert Passport" "Please insert passport (Archivements) into the printer."
|
||||
cd jhp
|
||||
./gro $FIELD
|
||||
cd ..
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function jhpGPG() {
|
||||
askStr 49 "GPG Fingerprint" "Enter GPG fingerprint WITH SPACES. E.g.:\n 1234 5678 9ABC DEF0 1234 5678 9ABC DEF0 1234 5678"
|
||||
if [ $? -eq 0 ]; then
|
||||
FP=$(cat $TMP)
|
||||
rm $TMP
|
||||
if ! [[ $FP =~ ^([[:xdigit:]]{4} ){9}[[:xdigit:]]{4}$ ]]; then
|
||||
diaBox "GPG Fingerprint" "This does not match the RegEx of a GPG fingerprint.\nPlease type in the whole fingerprint."
|
||||
jhpGPG
|
||||
fi
|
||||
FP=$(echo "$FP" | tr [a-f] [A-F])
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
if [ "$1" == "no-confirm" ]; then
|
||||
return 0
|
||||
else
|
||||
confirm "GPG Fingerprint" " GPG:\n $FP"
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function jhpReg() {
|
||||
askStr 25 "Forename/Nickname" "Enter forename/nickname"
|
||||
askStr ${MAXLENGTH[$1]} "Forename/Nickname" "Enter forename/nickname"
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
FNAME=$(cat $TMP)
|
||||
|
||||
askStr 25 "Surename" "Enter surename"
|
||||
askStr ${MAXLENGTH[$1]} "Surname" "Enter surname"
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
SNAME=$(cat $TMP)
|
||||
|
||||
askStr 25 "Planet" "Enter planet" "Earth, Chaospott"
|
||||
askStr ${MAXLENGTH[$1]} "Place" "Enter place"
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
PLANET=$(cat $TMP)
|
||||
|
||||
confirm=" Forename: $FNAME\n Surename: $SNAME\n Planet: $PLANET"
|
||||
confirm=" Forename: $FNAME\n Surname: $SNAME\n Place: $PLANET"
|
||||
|
||||
ynBox "GRO Stamp" "Does this being wants to have a GRO stamp?"
|
||||
ynBox "IRO Stamp" "Does this being want to have a IRO stamp?"
|
||||
if [ $? -eq 0 ]; then
|
||||
STAMP=true
|
||||
else
|
||||
@@ -178,7 +281,7 @@ function jhpReg() {
|
||||
|
||||
ynBox "GPG" "Does the being have a GPG key to register?"
|
||||
if [ $? -eq 0 ]; then
|
||||
jhpGPG no-confirm
|
||||
enterGPG "" no-confirm
|
||||
if [ $? -eq 0 ]; then
|
||||
confirm="$confirm\n GPG:\n $FP"
|
||||
fi
|
||||
@@ -189,33 +292,33 @@ function jhpReg() {
|
||||
|
||||
}
|
||||
|
||||
function jhpmenu() {
|
||||
function menuFor() {
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select ID type:" 14 40 3 \
|
||||
1 "Registration" \
|
||||
2 "GRO Stamp" \
|
||||
2 "IRO Stamp" \
|
||||
3 "GPG" \
|
||||
9 "Back" 2> $TMP
|
||||
|
||||
choice=$(cat $TMP)
|
||||
|
||||
case $choice in
|
||||
1) jhpReg
|
||||
1) askReg "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
jhpPrintReg
|
||||
printReg "$1"
|
||||
if [ "$STAMP" == "true" ]; then
|
||||
jhpGROStamp
|
||||
printIROStamp "$1"
|
||||
fi
|
||||
if [ -n "$FP" ]; then
|
||||
jhpPrintGPG
|
||||
printGPG "$1"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
2) jhpGROStamp
|
||||
2) printIROStamp "$1"
|
||||
;;
|
||||
3) jhpGPG
|
||||
3) enterGPG
|
||||
if [ $? -eq 0 ]; then
|
||||
jhpPrintGPG
|
||||
printGPG "$1"
|
||||
fi
|
||||
;;
|
||||
|
||||
@@ -225,16 +328,44 @@ function jhpmenu() {
|
||||
unset PLANET
|
||||
unset FP
|
||||
unset FIELD
|
||||
unset FFP
|
||||
}
|
||||
|
||||
function askForFunnyUserCreds() {
|
||||
clr
|
||||
echo "Press Enter to start."
|
||||
read -s
|
||||
|
||||
askStr 12 "Login" "Username:" ""
|
||||
username=$(cat $TMP)
|
||||
askPw 12 "Login" "Password:" ""
|
||||
password=$(cat $TMP)
|
||||
|
||||
if [ -f .pw/$username ]; then
|
||||
if [ "$password" != $(cat .pw/$username) ]; then
|
||||
clr
|
||||
echo "Wrong credentials."
|
||||
sleep 3
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Wrong credentials."
|
||||
sleep 3
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
askForFunnyUserCreds
|
||||
|
||||
while [ true ]; do
|
||||
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select ID type:" 10 40 3 \
|
||||
1 "Junghackerpass" \
|
||||
2 "Usual" 2> $TMP
|
||||
2 "New Adafruit passport" \
|
||||
9 "Logout" 2> $TMP
|
||||
|
||||
if [ $? -eq 1 ]; then
|
||||
if [ $? -eq 9 ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
@@ -242,9 +373,11 @@ while [ true ]; do
|
||||
|
||||
|
||||
case $TYPE in
|
||||
1) jhpmenu
|
||||
1) menuFor jhp
|
||||
;;
|
||||
2) exit 0
|
||||
2) menuFor adafruit
|
||||
;;
|
||||
9) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
509
start_dialog
Executable file
509
start_dialog
Executable file
@@ -0,0 +1,509 @@
|
||||
#!/bin/bash
|
||||
export LANG=C
|
||||
export TERM=vt220
|
||||
|
||||
export DIALOGRC=dialogrc
|
||||
|
||||
source $(dirname $0)/config
|
||||
|
||||
export PRINTDEVICE="/dev/ttyUSB$CLIENTS"
|
||||
export DEVICE="$PRINTDEVICE"
|
||||
|
||||
LOCKFILE=/tmp/c3govlock
|
||||
TMP=/tmp/$RANDOM
|
||||
BT="c3gov - v0.5"
|
||||
|
||||
cd $(dirname "$0")
|
||||
|
||||
function infoBox() {
|
||||
h=8
|
||||
w=60
|
||||
if [ -n "$3" ]; then
|
||||
h=$3
|
||||
fi
|
||||
if [ -n "$4" ]; then
|
||||
w=$4
|
||||
fi
|
||||
dialog --title "$1" \
|
||||
--backtitle "$BT" \
|
||||
--infobox "$2" $h $w
|
||||
}
|
||||
|
||||
function diaBox() {
|
||||
h=8
|
||||
w=60
|
||||
if [ -n "$3" ]; then
|
||||
h=$3
|
||||
fi
|
||||
if [ -n "$4" ]; then
|
||||
w=$4
|
||||
fi
|
||||
dialog --title "$1" \
|
||||
--backtitle "$BT" \
|
||||
--msgbox "$2" $h $w
|
||||
}
|
||||
|
||||
function ynBox() {
|
||||
h=8
|
||||
w=60
|
||||
if [ -n "$3" ]; then
|
||||
h=$3
|
||||
fi
|
||||
if [ -n "$4" ]; then
|
||||
w=$4
|
||||
fi
|
||||
|
||||
dialog --title "$1" \
|
||||
--backtitle "$BT" \
|
||||
--yesno "$2" $h $w
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
function askStr() {
|
||||
h=12
|
||||
w=60
|
||||
if [ -n "$5" ]; then
|
||||
h=$5
|
||||
fi
|
||||
if [ -n "$6" ]; then
|
||||
w=$6
|
||||
fi
|
||||
|
||||
dialog --title "$2" \
|
||||
--backtitle "$BT" \
|
||||
--max-input $1 \
|
||||
--inputbox "$3" $h $w "$4" 2> $TMP
|
||||
return $?
|
||||
}
|
||||
|
||||
function askPw() {
|
||||
h=12
|
||||
w=60
|
||||
if [ -n "$5" ]; then
|
||||
h=$5
|
||||
fi
|
||||
if [ -n "$6" ]; then
|
||||
w=$6
|
||||
fi
|
||||
|
||||
dialog --title "$2" \
|
||||
--backtitle "$BT" \
|
||||
--max-input $1 \
|
||||
--insecure \
|
||||
--passwordbox "$3" $h $w "$4" 2> $TMP
|
||||
return $?
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
h=12
|
||||
w=60
|
||||
if [ -n "$3" ]; then
|
||||
h=$3
|
||||
fi
|
||||
if [ -n "$4" ]; then
|
||||
w=$4
|
||||
fi
|
||||
|
||||
dialog --title "Confirm: $1" \
|
||||
--backtitle "$BT" \
|
||||
--yesno "Please confirm those information:\n$2" $h $w
|
||||
return $?
|
||||
}
|
||||
|
||||
function askStrThird() {
|
||||
h=12
|
||||
w=60
|
||||
if [ -n "$6" ]; then
|
||||
h=$5
|
||||
fi
|
||||
if [ -n "$7" ]; then
|
||||
w=$6
|
||||
fi
|
||||
|
||||
dialog --backtitle "$BT" \
|
||||
--max-input $1 \
|
||||
--title "$2" \
|
||||
--extra-button --extra-label "$4" \
|
||||
--inputbox "$3" $h $w "$5" 2> $TMP
|
||||
return $?
|
||||
}
|
||||
|
||||
function gpgSearch() {
|
||||
askStr 255 "GPG Search" "Type in the mail address you'd like to look up on keys.openpgp.org."
|
||||
if [ $? -eq 0 ]; then
|
||||
if [[ "$(cat $TMP)" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]]; then
|
||||
clear
|
||||
echo "Searching for GPG key..."
|
||||
gpg --keyserver "hkps://keys.openpgp.org" --search "$(cat $TMP)"
|
||||
if [ $? -eq 0 ]; then
|
||||
FFP=$(gpg -k "$(cat $TMP)" | head -n 2 | tail -n 1 | awk '{print $1}' | sed 's/.\{4\}/& /g;s/^\(.*\) $/\1/g')
|
||||
gpg --batch --delete-key "$FFP"
|
||||
if [ "$FFP" = "" ]; then
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
else
|
||||
diaBox "GPG Search" "No fingerprint has been found for $(cat $TMP)"
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
diaBox "GPG Search" "This is on vaild mail address."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
function enterGPG() {
|
||||
askStrThird 49 "GPG Fingerprint" "Enter GPG fingerprint WITH SPACES. E.g.:\n 1234 5678 9ABC DEF0 1234 5678 9ABC DEF0 1234 5678" "Search..." "$1"
|
||||
|
||||
ret=$?
|
||||
case $ret in
|
||||
0)
|
||||
FP=$(cat $TMP)
|
||||
rm $TMP
|
||||
if ! [[ $FP =~ ^([[:xdigit:]]{4} ){9}[[:xdigit:]]{4}$ ]]; then
|
||||
diaBox "GPG Fingerprint" "This does not match the RegEx of a GPG fingerprint.\nPlease type in the whole fingerprint."
|
||||
enterGPG
|
||||
fi
|
||||
FP=$(echo "$FP" | tr [a-f] [A-F])
|
||||
;;
|
||||
1)
|
||||
return 1
|
||||
;;
|
||||
3)
|
||||
gpgSearch
|
||||
if [ $? -eq 0 ]; then
|
||||
enterGPG "$FFP" "no-confirm"
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$2" == "no-confirm" ]; then
|
||||
return 0
|
||||
else
|
||||
confirm "GPG Fingerprint" " GPG:\n $FP"
|
||||
return $?
|
||||
fi
|
||||
}
|
||||
|
||||
function checkLockFile() {
|
||||
while [ -f $LOCKFILE ]; do
|
||||
infoBox "Printer is in use..." "Printer is in use. Please wait."
|
||||
sleep 1
|
||||
done
|
||||
touch $LOCKFILE
|
||||
}
|
||||
|
||||
function printGPG() {
|
||||
askForField "GPG fingerprint" "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer."
|
||||
cd "$1"
|
||||
./gpgkey $FIELD $FP
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function printReg() {
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (First page, name, place) into the printer."
|
||||
cd "$1"
|
||||
./reg "$FNAME" "$SNAME" "$PLANET"
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
}
|
||||
|
||||
function printc3govStamp() {
|
||||
askForField "c3gov stamp" "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer."
|
||||
cd "$1"
|
||||
./c3gov $FIELD
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function askForField() {
|
||||
declare -A layout
|
||||
declare -A maxfield
|
||||
text="$1: Please choose a free field on the passport.\n"
|
||||
|
||||
layout[jhp]="
|
||||
------------------\n
|
||||
| Archievements |\n
|
||||
==================\n
|
||||
| 0 | 1 || 6 | 7 |\n
|
||||
|---|---||---|---|\n
|
||||
| 2 | 3 || 8 | 9 |\n
|
||||
|---|---||---|---|\n
|
||||
| 4 | 5 || 10| 11|\n
|
||||
==================\n
|
||||
"
|
||||
|
||||
layout[bounddipl]="
|
||||
------------------\n
|
||||
| VISAS || VISAS |\n
|
||||
==================\n
|
||||
| 0 | 1 || 4 | 5 |\n
|
||||
|---|---||---|---|\n
|
||||
| 2 | 3 || 6 | 7 |\n
|
||||
==================\n
|
||||
"
|
||||
|
||||
layout[stapleddipl]="
|
||||
------------------\n
|
||||
| VISAS || VISAS |\n
|
||||
==================\n
|
||||
| 0 | 1 || 4 | 5 |\n
|
||||
|---|---||---|---|\n
|
||||
| 2 | 3 || 6 | 7 |\n
|
||||
==================\n
|
||||
"
|
||||
|
||||
|
||||
maxfield[jhp]=11
|
||||
maxfield[bounddipl]=7
|
||||
maxfield[stapleddipl]=7
|
||||
|
||||
askStr 2 "Select a field" "$text ${layout[$2]}" "" 18
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
FIELD=$(cat $TMP)
|
||||
if ! [[ "$FIELD" =~ ^[0-9]+$ ]] || [ -z "$FIELD" ] || [ $FIELD -lt 0 ] || [ $FIELD -gt ${maxfield[$2]} ]; then
|
||||
askForField "$1" "$2"
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function askReg() {
|
||||
# Max length of passport fields
|
||||
declare -A MAXLENGTH
|
||||
MAXLENGTH[jhp]=25
|
||||
MAXLENGTH[bounddipl]=17
|
||||
MAXLENGTH[stapleddipl]=17
|
||||
|
||||
askStr ${MAXLENGTH[$1]} "Forename/Nickname" "Enter forename/nickname"
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
FNAME=$(cat $TMP)
|
||||
|
||||
askStr ${MAXLENGTH[$1]} "Surname" "Enter surname"
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
SNAME=$(cat $TMP)
|
||||
|
||||
askStr ${MAXLENGTH[$1]} "Place" "Enter place"
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
PLANET=$(cat $TMP)
|
||||
|
||||
confirm=" Forename: $FNAME\n Surname: $SNAME\n Place: $PLANET"
|
||||
|
||||
ynBox "Security" "Secure this passport using security stickers?"
|
||||
if [ $? -eq 0 ]; then
|
||||
SECURE=true
|
||||
else
|
||||
SECURE=false
|
||||
fi
|
||||
|
||||
ynBox "c3gov Stamp" "Does this entity want to have a c3gov stamp?"
|
||||
if [ $? -eq 0 ]; then
|
||||
STAMP=true
|
||||
else
|
||||
STAMP=false
|
||||
fi
|
||||
|
||||
ynBox "GPG" "Does the entity have a GPG key to register?"
|
||||
if [ $? -eq 0 ]; then
|
||||
enterGPG "" no-confirm
|
||||
if [ $? -eq 0 ]; then
|
||||
confirm="$confirm\n GPG:\n $FP"
|
||||
fi
|
||||
fi
|
||||
|
||||
confirm "Everything" "$confirm"
|
||||
return $?
|
||||
|
||||
}
|
||||
|
||||
function enterSecurityCode() {
|
||||
MAXLENGTH=6
|
||||
|
||||
askStr ${MAXLENGTH} "Security code" "Enter security code from the security sticker (e.g. S12345)."
|
||||
if [ $? -eq 1 ]; then
|
||||
return 1
|
||||
fi
|
||||
SECURITYCODE=$(cat $TMP)
|
||||
confirm "Security code" "Security code: $SECURITYCODE"
|
||||
return $?
|
||||
|
||||
}
|
||||
|
||||
function printSecurePassportFirstPage(){
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Pleast insert the FIRST PAGE (Identity) into the printer."
|
||||
|
||||
cd "$1"
|
||||
./secure_firstpage "$SECURITYCODE"
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
}
|
||||
|
||||
function printSecurePassport(){
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer.\nA print on EVERY Visa page is necessary."
|
||||
|
||||
cd "$1"
|
||||
./secure "$SECURITYCODE"
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
}
|
||||
|
||||
function enableSecurity() {
|
||||
if [ "$1" = "bounddipl" ]; then
|
||||
diaBox "Error" "Passport security: Passport not supported."
|
||||
else
|
||||
enterSecurityCode
|
||||
if [ $? -eq 0 ]; then
|
||||
case $1 in
|
||||
"bounddipl")
|
||||
;;
|
||||
"jhp")
|
||||
printSecurePassport "$1"
|
||||
;;
|
||||
*)
|
||||
printSecurePassportFirstPage "$1"
|
||||
printSecurePassport "$1"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function menuFor() {
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select purpose:" 14 40 3 \
|
||||
1 "Registration" \
|
||||
2 "c3gov Stamp" \
|
||||
3 "GPG" \
|
||||
8 "Secure Passport" \
|
||||
9 "Back" 2> $TMP
|
||||
|
||||
choice=$(cat $TMP)
|
||||
|
||||
case $choice in
|
||||
1) askReg "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
printReg "$1"
|
||||
if [ "$SECURE" = "true" ]; then
|
||||
enableSecurity "$1"
|
||||
fi
|
||||
if [ "$STAMP" = "true" ]; then
|
||||
printc3govStamp "$1"
|
||||
fi
|
||||
if [ -n "$FP" ]; then
|
||||
printGPG "$1"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
2) printc3govStamp "$1"
|
||||
;;
|
||||
3) enterGPG
|
||||
if [ $? -eq 0 ]; then
|
||||
printGPG "$1"
|
||||
fi
|
||||
;;
|
||||
8) enableSecurity "$1"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
unset FNAME
|
||||
unset SNAME
|
||||
unset PLANET
|
||||
unset FP
|
||||
unset FIELD
|
||||
unset FFP
|
||||
unset SECURITYCODE
|
||||
}
|
||||
|
||||
function askForFunnyUserCreds() {
|
||||
clear
|
||||
echo "Press Enter to start."
|
||||
read -s
|
||||
|
||||
askStr 12 "Login" "Username:" ""
|
||||
username=$(cat $TMP)
|
||||
askPw 12 "Login" "Password:" ""
|
||||
password=$(cat $TMP)
|
||||
|
||||
if [ -f ".pw/$username" ]; then
|
||||
if [ "$password" != $(cat .pw/$username) ]; then
|
||||
clear
|
||||
echo "Wrong credentials."
|
||||
sleep 3
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Wrong credentials."
|
||||
sleep 3
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
askForFunnyUserCreds
|
||||
|
||||
while [ true ]; do
|
||||
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select ID type:" 12 40 3 \
|
||||
1 "Stapled diplomatic passport" \
|
||||
2 "Junghackerpass" \
|
||||
3 "Bound diplomatic passport" \
|
||||
9 "Logout" 2> $TMP
|
||||
|
||||
if [ $? -eq 9 ]; then
|
||||
break
|
||||
fi
|
||||
|
||||
TYPE=$(cat $TMP)
|
||||
|
||||
|
||||
case $TYPE in
|
||||
1) menuFor stapleddipl
|
||||
;;
|
||||
2) menuFor jhp
|
||||
;;
|
||||
3) menuFor bounddipl
|
||||
;;
|
||||
9) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm $TMP
|
||||
clear
|
||||
18
test/msg5
Executable file
18
test/msg5
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
FILE=/tmp/$RANDOM
|
||||
|
||||
source ../include/nixdorf
|
||||
init
|
||||
smallLetters $FILE
|
||||
|
||||
#printf "\x1b\x33\x0a" >> $FILE
|
||||
printf "\x1b\x33\x0e" >> $FILE
|
||||
|
||||
#for j in $(seq 0 10); do
|
||||
for i in $(seq 0 100); do
|
||||
printf " $i\n" >> $FILE
|
||||
done
|
||||
#done
|
||||
|
||||
printFile $FILE
|
||||
rm $FILE
|
||||
Reference in New Issue
Block a user