raspberry pi ftp server (vsftpd)

assuming raspbian
– apt-get install vsftpd
By default vsftpd is configured for anonymous access with read-only permissions. We’re going to change things so that it requires you to authenticate with a local user. Let’s open the configuration file.

sudo nano /etc/vsftpd.conf

We want to change or uncomment the following values.

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES
user_sub_token=$USER
local_root=/home/$USER/ftp

After that restart the vsftpd service. Now we need to create a couple folders in your local user’s home folder. The ftp folder will be the root when you connect. The way vsftpd works, the root is not allowed to have write permissions on it, so we’ll create a sub-folder inside the root called files which our local user will be allowed to write to. This is where you’d upload/download files from with an FTP client.

mkdir /home/andreas/ftp
mkdir /home/andreas/ftp/files
chmod a-w /home/andreas/ftp

Now you should be able to connect to your from any FTP client and start uploading/downloading files.

centOS 7 install log

after my last server install I realized a lot of things were improvised and broken, also there were no new binaries for owncloud on Ubuntu 12.02 and no disk encryption and no systemd and so on and as I want to learn something I wanted to match it with my new love for Fedora so it became a Centos7 server.

basic vmware install using vSphere I found the first bug: using full disk encryption I cannot boot anymore

reason is a known bug

At the GRUB boot menu, press e to edit the boot config and remove rhgb.
then disable it permanently by removing rhgb in /etc/default/grub and execute grub2-mkconfig -o /boot/grub2/grub.cfg to update your boot grub.cfg.

next thing was I could not enter the passphrase using the vSphere console as characters were autorepeated.

Solution via VMware

  1. Power off the virtual machine.
  2. Add a line, similar to this, at the end of your virtual machine’s configuration (.vmx) file:
    keyboard.typematicMinDelay = “2000000”
    The delay is specified in micro-seconds, so the line in the example above increases the repeat time to 2 seconds. This should ensure that you never get auto-repeat unless you intend it.
  3. Power on the virtual machine.

that out of the way I could boot up CentOS and update it and install vmware tools

yum install net-tools perl
mount /dev/cdrom /mnt/cdrom
cd /tmp
tar zxf /mnt/cdrom/VMwareTools-5.0.0-<xxxx>.tar.gz
umount /dev/cdrom
cd vmware-tools-distrib
./vmware-install.pl

Now, let’s get started.
First get EPEL started (Extra Packages for Enterprise Linux)
yum install epel-release

enable UTF-8 support
edit /etc/environment and add this:
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

also use ‘localectl’ to show and set a different locale
like this:
localectl set-locale LANG=en_US.utf8

colorize bash:
add this to .bash_profile
export LS_OPTS='--color=auto'
export GREP_OPTIONS='--color=auto'
export TERM=xterm-color
#export GREP_OPTIONS='--color=auto' GREP_COLOR='1;32'
export CLICOLOR=1

install Mosh
yum install mosh htop
then allow UDP for ports 60001-60010
sudo iptables -I INPUT 1 -p udp --dport 60001:60010 -j ACCEPT
so in systemd this will be:
– create /etc/firewalld/services/mosh.xml

< ?xml version="1.0" encoding="utf-8"?>

MOSH
Mosh (mosh.mit.edu) is a free replacement for SSH that allows roaming and supports intermittent connectivity.

– firewall-cmd –add-service=mosh –permanent
– firewall-cmd –reload
Note: In Fedora21+ this is already present (the xml file for mosh)
this will open 10 ports but that should be more than enough for me.
and start mosh as a server using “mosh-server” – defaults should work fine!
I am not even sure this is needed.. as long as mosh is installed on the server it should connect via SSH and start mosh and hand over the connection!

htop
yum install htop

fail2ban
yum install fail2ban
then make a copy of /etc/fail2ban/jail.conf and save it as jail.local
there set at least this:
[sshd]
enabled = true

enable and start service
systemctl enable fail2ban
systemctl start fail2ban

check journalctl for selinux related issues but this should be fixed now
journalctl -lfu fail2ban

install basic developer tools (build-essentials)
yum groupinstall 'Development Tools'

iPhone under Linux

inspired by this site:
http://blog.xenodesystems.com/2014/03/how-to-managesync-your-ios-7-device.html

yum -y install kernel-headers
yum -y install kernel-devel
yum groupinstall “Development Tools”
yum groupinstall “Development Libraries”

yum install gcc rhythmbox libgpod ifuse gvfs-afc libtool libusb libusb-devel libplist

yum install libimobiledevice

Now reboot without iDevice connected!

it should now be a massive USB device
Shotwell should see the pictures
Rhythmbox should sync and manage music

raspberry pi magic

Raspberry Pi is magic!

So far it does:
– MPD server (using my media center as SMB share) connected to my speakers (the audio is not that great)
– DNS resolver (http://blueeyedcreature.net/blog/?p=901)
– home automation server (using fhem)
– Airport style music receiver (shairport)
– DLNA renderer (for plex?)
– I even used it as a status screen but I didn’t like the giant screen in my home – http://blueeyedcreature.net/blog/?p=811

but I want more!
Continue reading →

steam/plex/htpc box 2015

So I am back with Ubuntu 14.04 LTS for the moment because I figured out what was wrong with audio all this time. (multiple things)
can’t wait for the next ubuntu LTS or will go back to Fedora, I swear… the lack of proprietary driver support is the only thing I dislike there. the rest is awesome.

1) Pulseaudio is just shit without a proper systemd implementation (works like a charm for fedora 23)
2) HDMI passthrough has to be specifically enabled in plex settings
3) Nvidia prorietary driver needs to be used for proper hdmi audio passthrough
4) pulseaudio fix needs to be uncommented in /usr/bin/plexhometheater.sh to disable it
5) alternatively apt-get remove pulseaudio < -- after setup, will try again in April 2016 6) HDMI passthrough on your amplifier is counter-productive / sets itself to the wrong source when you sleep the media center / wake without amplifier enabled 7) HDMI-CEC needs more work, now it is just fuckign things up when enabled so DISABLE for now (once I have playstation 4, chromecast and more HDMI stuffz I can re-enable it. after a lot of testing and playing around with it I can now watch AAC, DTS and Dolby surround 2, 5 and 7 channels - everything works and survives reboots. Continue reading →

DNS caching resolver for home

Preface: the fortigate I am using at home sucks at DNS – in fact it sucks at many things when you are used to a FritzBox – but I am stubborn and I will do this because I work with fortigates and want the learning experience. (and because I am stubborn)

somehow the big models can all do forward DNS services but the FortiWifi40C somehow can’t even act as a DNS gateway / proxy without bringing the internet experience to a grinding halt here.
(I run a small network, about 5 devices and 4 mobiles and if I can feel it I don’t want to know what a small office will experience…)
But: I have this Raspberry that receives audio via zeroconf and is connected to the network and to my amplifier.
Why not have it act as a caching DNS resolver, too?
Continue reading →