VNC raspberry pi

apt-get install netatalk avahi-daemon tightvncserver

/etc/avahi/services/afpd.service:

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
   <name replace-wildcards="yes">%h</name>
   <service>
      <type>_afpovertcp._tcp</type>
      <port>548</port>
   </service>
</service-group>

/etc/init.d/tightvncserver:

#!/bin/bash
# /etc/init.d/tightvncserver
#

# Carry out specific functions when asked to by the system
case "$1" in
start)
    su pi -c '/usr/bin/vncserver -geometry 1440x900'
    echo "Starting VNC server "
    ;;
stop)
    pkill vncserver
    echo "VNC Server has been stopped (didn't double check though)"
    ;;
*)
    echo "Usage: /etc/init.d/blah {start|stop}"
    exit 1
    ;;
esac

exit 0
update-rc.d avahi-daemon defaults
/etc/init.d/avahi-daemon restart
chmod +x /etc/init.d/tightvncserver
pkill Xtightvnc
/etc/init.d/tightvncserver start
cd /etc/init.d
sudo update-rc.d tightvncserver defaults

VNC on OS X

Publié dans Geek, Non classé, Raspberry | Commentaires fermés sur VNC raspberry pi

Wifi sur linux (raspberry pi)

/etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

/etc/wpa_supplicant/wpa_supplicant.conf
country=FR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="maison"
psk="xxx"
}

network={
ssid="mamoon"
psk="yyy"
}

Publié dans Geek, Non classé, Raspberry | Commentaires fermés sur Wifi sur linux (raspberry pi)

Debian router

/etc/network/interfaces

auto eth0:0
iface eth0:0 inet static
address 192.168.170.86
netmask 255.255.255.0
broadcast 192.168.170.255

#!/bin/sh

PATH=/usr/sbin:/sbin:/bin:/usr/bin

#
# delete all existing rules.
#
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X

# Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT

# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT
iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT

# Masquerade.
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE

# Don't forward from the outside to the inside.
iptables -A FORWARD -i eth1 -o eth1 -j REJECT

# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward

https://www.debian-administration.org/article/23/Setting_up_a_simple_Debian_gateway

Publié dans Non classé | Commentaires fermés sur Debian router

ACL

find servers -type d -exec setfacl -m g:minecraft:full_set:fd:allow {} \;
find servers -type f -exec setfacl -m g:minecraft:full_set::allow {} \;
zfs set aclmode=passthrough storage/filesystem
zfs set aclinherit=passthrough storage/filesystem

Publié dans FreeBSD | Commentaires fermés sur ACL

SPI et Beaglebone white

J’ai installé debian 7.5 2014-05-14 provenant : http://beagleboard.org/latest-images

La description du port SPI se fait dans /lib/firmware/*SPI* Pour activer BB-SPIDEV1-00A0.dtbo, echo BB-SPIDEV1 > /sys/devices/bone_capemgr.*/slots

Pour l’activer :
echo « optargs=quiet drm.debug=7 capemgr.enable_partno=BB-SPIDEV1 » >> /boot/uboot/uEnv.txt

http://elinux.org/BeagleBone_Black_Enable_SPIDEV
http://hipstercircuits.com/enable-spi-with-device-tree-on-beaglebone-black-copy-paste/

Publié dans Geek | Commentaires fermés sur SPI et Beaglebone white

Augmenter une partition raspberrypi/beaglebone

fdisk -l

Puis :
fdisk /dev/mmcblk0
p pour afficher les partitions
d pour supprimer la partition à redimensionner
n pour rajouter la partition à redimensionner (la partition doit se commencer au même endroit qu’avant)
w pour valider

resize2fs /dev/mmcblk0p3

https://projects.drogon.net/raspberry-pi/initial-setup1/

Publié dans Non classé | Commentaires fermés sur Augmenter une partition raspberrypi/beaglebone

mdns avec ssh

#!/bin/sh
dns-sd -P « Phosphore Synology » _daap._tcp local 3689 localhost.local. \
127.0.0.1 « Arbitrary text record » &
trap « kill $! » 0 1 2 15
ssh -C -N -L 3689:localhost:3689 root@phosphore

Publié dans Non classé | Commentaires fermés sur mdns avec ssh

Quartre quart au chocolat blanc

4 oeufs
200g de farine
100g de beurre
250g de chocolat blanc
1/2 sachet de levure chimique
1 banane
pépites de chocolat

210ºC, 20mn.

Publié dans Non classé | Commentaires fermés sur Quartre quart au chocolat blanc

minidlna rc.d


#!/bin/sh

# $FreeBSD: net/minidlna/files/minidlna.in 302141 2012-08-05 23:19:36Z dougb $
#
# PROVIDE: minidlna
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable minidlna:
#
# minidlna_enable="YES"

. /etc/rc.subr

name=minidlna
rcvar=minidlna_enable
command=/usr/local/sbin/minidlna

load_rc_config $name

minidlna_enable=${minidlna_enable-"NO"}
minidlna_uid=${minidlna_uid-"dlna"}

pidfile="/var/db/minidlna/minidlna.pid"

start_precmd="rm -f $pidfile"
stop_postcmd=$start_precmd

command_args="-P $pidfile -u $minidlna_uid"
extra_commands=rescan
rescan_cmd="$command -P $pidfile -R -u $minidlna_uid"
required_dirs="/var/db/minidlna"

run_rc_command $1

Publié dans Non classé | Commentaires fermés sur minidlna rc.d

Certificate ssl

openssl genrsa -des3 -out server.key 1024

openssl req -new -key server.key -out server.csr

Country Name (2 letter code) [GB]:CH
State or Province Name (full name) [Berkshire]:Bern
Locality Name (eg, city) [Newbury]:Oberdiessbach
Organization Name (eg, company) [My Company Ltd]:Akadia AG
Organizational Unit Name (eg, section) []:Information Technology
Common Name (eg, your name or your server’s hostname) []:public.akadia.com
Email Address []:martin dot zahn at akadia dot ch
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

Certificate

Publié dans FreeBSD | Commentaires fermés sur Certificate ssl