126 lines
4.0 KiB
Plaintext
126 lines
4.0 KiB
Plaintext
== SaferSharing ==
|
|
|
|
To avoid legal steps because you are hosting to everyone:
|
|
|
|
* get nginx with auth_base
|
|
* proxy around
|
|
* modify your fw a bit
|
|
|
|
==== config nginx ====
|
|
as root
|
|
|
|
<source lang="bash">vi /etc/nginx/sites-available/default</source>
|
|
<source lang="bash">cat /etc/nginx/sites-available/default</source>
|
|
<pre>
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server ipv6only=on;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html index.htm;
|
|
|
|
# Make site accessible from http://localhost/
|
|
server_name localhost;
|
|
|
|
location / {
|
|
auth_basic "Sharing is Caring";
|
|
auth_basic_user_file /etc/nginx/htpasswd;
|
|
proxy_pass http://localhost:8000;
|
|
proxy_buffering off;
|
|
}
|
|
}
|
|
</pre>
|
|
|
|
<source lang="bash">vi /etc/nginx/htpasswd</source>
|
|
<source lang="bash">cat /etc/nginx/htpasswd</source>
|
|
<pre>
|
|
user:yoursavepassword
|
|
</pre>
|
|
|
|
In addition we used <source lang="bash">openssl passwd -crypt yoursupersafepassword</source> instead of plaintext password.
|
|
|
|
==== sharing2 conf ====
|
|
as user
|
|
<source lang="bash">vi /path/to/sharing2/main.hs</source>
|
|
<source lang="bash">cat /path/to/sharing2/main.hs</source>
|
|
<pre>
|
|
main :: IO ()
|
|
main = app >>=
|
|
runSettings (defaultSettings
|
|
{ settingsHost = HostIPv6
|
|
, settingsPort = 8000
|
|
, ...
|
|
})
|
|
</pre>
|
|
|
|
==== modify iptables ====
|
|
as root
|
|
<source lang="bash">iptables -t filter -A INPUT ! -s 127.0.0.1 -p tcp --dport 8000 -j DROP</source>
|
|
<source lang="bash">ip6tables -t filter -A INPUT ! -s ::1 -p tcp --dport 8000 -j DROP</source>
|
|
|
|
== Musik für das [[HQ]] ==
|
|
|
|
=== Quellen für Musik ===
|
|
|
|
==== [[feile]] als Quelle ====
|
|
Als Quelle für Musik ist das [[feile]] als Verzeichnis eingebundene (SMB).
|
|
<source lang="bash">cat /etc/fstab</source>
|
|
<pre>
|
|
</pre>
|
|
<pre>
|
|
//feile/space /feile_space cifs credentials=/.feile_space_smbcredentials,uid=1002,gid=1002,iocharset=utf8 0 0
|
|
</pre>
|
|
<pre>
|
|
</pre>
|
|
|
|
=== Musik abspielen ===
|
|
|
|
==== [[wikipedia:de:Music Player Daemon|MPD]] ====
|
|
|
|
; [http://www.musicpd.org/ Music Player Daemon] (MPD) mit ncmpcpp auf [[cider]] nutzen
|
|
|
|
mit [[cider]] verbinden
|
|
: <source lang="bash">ssh k-ot@cider</source>
|
|
|
|
[[w:Music Player Daemon#Clients|ncmpcpp]] ausführen
|
|
: <source lang="bash">ncmpcpp</source>
|
|
:* Hilfe, falls benötigt, zur Benutzung gibt es direkt mit ''F1''.
|
|
|
|
==== [[w:de:PulseAudio|PulseAudio]] ====
|
|
|
|
[http://www.freedesktop.org/wiki/Software/PulseAudio/ PulseAudio]
|
|
|
|
Mit [http://freedesktop.org/software/pulseaudio/pavucontrol/ pavucontrol] kann bequem die Lautstärke geregelt werden.
|
|
<source lang="bash">PULSE_SERVER=cider pavucontrol</source>
|
|
|
|
===== weiteres zu PulseAudio =====
|
|
{{Vorlage:beinhaltet Abweichungen von der Realität}}
|
|
|
|
====== Standard Audio Ausgabe auf PA-Sink legen ======
|
|
|
|
mit <code>[http://manpages.debian.org/cgi-bin/man.cgi?query=pacmd pacmd]</code> wird eine neue Audiosenke [[cider]] angelegt und anschließend dieses als Standard für die Ausgabe gesetzt:
|
|
<source lang="bash">pacmd load-module module-tunnel-sink server=cider</source>
|
|
<source lang="bash">pacmd set-default-sink 1</source>
|
|
|
|
====== PulseAudio über eigene grafische Oberfläche verwalten ======
|
|
|
|
Wenn ''[[w:de:Avahi (Software)|Avahi]]'' installiert ist und ''[http://manpages.debian.org/cgi-bin/man.cgi?query=avahi-daemon avahi-daemon]'' läuft, dann ''padevchooser'' (veraltet?!) starten. Dann erscheint das Trayicon [[Bild:padevchooser-aromaster.png|right]]<ref>https://wiki.c3d2.de/w/index.php?title=Pulseaudio&diff=10342&oldid=10340</ref>, wo man ''cider'' auswählen kann.
|
|
|
|
Mit einem Klick geht jede Pulseaudio-Soundausgabe der X-Session dann über ''cider''.
|
|
|
|
====== mplayer mit Umgebungsvariable ======
|
|
|
|
<source lang="bash">export PULSE_SERVER=cider.hq.c3d2.de</source>
|
|
<source lang="bash">pactl list</source>
|
|
|
|
<source lang="bash">mplayer -ao pulse warez/*.mp3</source>
|
|
|
|
====== mplayer ohne Umgebungsvariable ======
|
|
|
|
<source lang="bash">mplayer -ao pulse:cider warez/*.mp3</source>
|
|
|
|
== Einzelnachweise ==
|
|
<references />
|
|
|
|
[[Kategorie:Infrastruktur]]
|