admirableadminhttp://admirableadmin.de
Andreas PeichertSun, 27 May 2018 11:38:41 +0000en-UShourly1https://wordpress.org/?v=4.9.8Webradio with Raspbian Stretchhttp://admirableadmin.de/295/webradio-with-raspbian-stretch
http://admirableadmin.de/295/webradio-with-raspbian-stretch#respondTue, 29 Aug 2017 14:10:26 +0000http://admirableadmin.de/?p=295After updating a Raspberry Pi to Debian Stretch, I noticed that the older article with Jessie does not work anymore. It will be described how to listen to a webradio with Raspbian Stretch.

The Raspbian Lite version is very slim, compared to the full Desktop version, but the latter is not necessary for headless running. Instructions for other operating systems are described at: Writing an image to the SD card.

Initial Setup

Insert the SD card into your Raspberry Pi, connect the Power and Ethernet cable. You could either configure Rasbian remote by enabling ssh or local with a keyboard. In any case using default user pi and password raspberry to make the base configuration:

sudo raspi-config
Now expand the filesystem, set a new password, run internationalization options, change the hostname in the advanced settings and enable ssh if not already done. Then finally do a reboot.

In case the webradio stream disconnects or you got a forced disconnect by your ISP, the network timeout is set to 5 seconds. If the program crashes or exits by a network timeout, it will always restart after a 10 second wait. So in a worst case scenario, you have 15 seconds where the audio output stops.

Now activate the new mpv service

sudo systemctl enable mpv.service

Just reboot or start the service manually

sudo systemctl daemon-reload
sudo systemctl start mpv.service

Later you could inspect that everything works fine

systemctl status mpv
journalctl -u mpv.service

]]>http://admirableadmin.de/295/webradio-with-raspbian-stretch/feed0Securing SSH access in Debianhttp://admirableadmin.de/286/securing-ssh-access-in-debian
http://admirableadmin.de/286/securing-ssh-access-in-debian#respondSat, 22 Apr 2017 16:40:21 +0000http://admirableadmin.de/?p=286By default Debian asks to set a strong root password. But this could be possible guessed by brute force. Here are some hints to secure your remote login.

Your root password will not become obsolete by following this hints. You will still need it for local recovery login.

1. Use a ssh key

To create a new key, run the following command. Be careful not to overwrite an existing key when entering the filename. The passphrase could be empty, if one prefer to login instantly without any interaction.

user@local:~$ ssh-keygen

Without any command line option a key with RSA 2048 will be generated. The key is stored in the directory ~/.ssh, which is only accessible by yourself (0700). Keep the private key secure, while the public part could be read by others. The private part by default is id_rsa (0600) and the public is id_rsa.pub (0644).

Finally the public key will be transfered to your remote system. At this time your your root password will be asked.

user@local:~$ ssh-copy-id root@remote

From now on, every login at your remote system will first try to match the remote public part with the local private part.

2. Disable root login

If the remote system is worldwide accessible by SSH, one will find a lot of password guessing attempts every second in /var/log/syslog/auth.log.

First create a new user, which will be used without a password, but with a key. Replace USER with your user name.

root@remote:~# adduser --ingroup users --disabled-password USER

Next the SSH directory is created. The authorized_keys will contain the public key, wich could be filled manually, or copy it from the root login.

While the terminal with root privileges remains open (and will not be closed by SSH restart), a new additional connection to the remote server has to be established. This way one will not lock yourself out of the remote server.

Next the root login will be disabled in by editing /etc/ssh/sshd_config changing the "yes" in following part to "no"

PermitRootLogin no

Finally the SSH service will be restarted

root@remote:~# service ssh restart

Now the login with user root will be impossible, but the USER can login.

3. Work with sudo

Working with sudo is a nice way to control user access on group or command basis to grant root privileges.

root@remote:~# apt install sudo

By default all users which are part of he sudo group could execute this command, so add the sudo group to the new user.

root@remote:~# adduser USER sudo

But a password is still needed. To remove the password requirement, edit the configuration

root@remote:~# export EDITOR=vim
root@remote:~# visudo

And change the sudo group line, so no password is required if the new user requests sudo

%sudo ALL=(ALL:ALL) NOPASSWD: ALL

4. Using fail2ban

Install fail2ban, which automatically detects brute force attempts to SSH and blocks its IP addresses with the help of iptables.

]]>http://admirableadmin.de/286/securing-ssh-access-in-debian/feed0Listen webradio with Raspberry Pi Debian Jessiehttp://admirableadmin.de/279/listen-webradio-with-raspberry-pi-debian-jessie
http://admirableadmin.de/279/listen-webradio-with-raspberry-pi-debian-jessie#respondSun, 23 Oct 2016 15:35:21 +0000http://admirableadmin.de/?p=279This is an update for the older post with Debian Wheezy on how to setup a Raspberry Pi with Raspbian Debian Jessie in order listen webradio.

Insert the SD card into your Raspberry Pi, connect the Power and Ethernet cable. Raspian will get a IP through DHCP, so login into your Pi by SSH using the default user pi and password raspberry to make the base configuration and a system update:

sudo raspi-config
Now expand the filesystem, set a new password, run internationalization options, change the hostname in the advanced settings and reboot.

After that install the latest updates:

sudo apt update
sudo apt upgrade

Webradio Setup

Connect the Raspberry Pi using a 3.5 mm cable to your radio through the AUX input and install Mplayer:

]]>http://admirableadmin.de/279/listen-webradio-with-raspberry-pi-debian-jessie/feed0Listen webradio with Raspberry Pihttp://admirableadmin.de/249/listen-webradio-with-raspberry-pi
http://admirableadmin.de/249/listen-webradio-with-raspberry-pi#respondFri, 05 Sep 2014 20:14:02 +0000http://admirableadmin.de/?p=249A Raspberry Pi with Debian can be used without a monitor to listen to your favorite web radio station in a continuous operation.

Using Debian

Download the latest version of Raspbian from raspberrypi.org and extract the zip file. The Debian image is copied to a SD card using the linux command line:

sudo dd bs=4M if=2014-06-20-wheezy-raspbian.img of=/dev/mmcblk0

While the copy process there is no visual feedback of the progress. To see this one can run the following command into an other terminal window:

]]>http://admirableadmin.de/249/listen-webradio-with-raspberry-pi/feed0Install Redmine Backlogs on Debianhttp://admirableadmin.de/240/install-redmine-backlogs-on-debian
http://admirableadmin.de/240/install-redmine-backlogs-on-debian#commentsThu, 24 Apr 2014 19:23:47 +0000http://admirableadmin.de/?p=240Redmine is a web-based project management tool which could be used with the Backlog plugin for software development with Scrum.

Redmine with Debian Backports
On a Debian 7.0 system (currently at the date of this blog entry) Redmine version 1.4.4 is ready for install, while it is available in version 2.5.1 and 2.4.5 for download. Because of its less up-to-date packages, one can argue that Debian is very stable but outdated. Many years ago some manual apt-pinning or mixing with dotdeb packages had helped to get a more recent version. But since 2010 Debian has so called Backports, which brings newer versions!

After a restart of Apache, the Redmine Backlogs plugin is activated.
See Administration > Information:

]]>http://admirableadmin.de/240/install-redmine-backlogs-on-debian/feed4Raspberry Pi as a Media Center with XBMChttp://admirableadmin.de/216/raspberry-pi-as-a-media-center-with-xbmc
http://admirableadmin.de/216/raspberry-pi-as-a-media-center-with-xbmc#commentsSun, 27 Jan 2013 19:06:59 +0000http://admirableadmin.de/?p=216The Raspberry Pi is a single-board computer that plugs into a TV and in combination with OpenELEC it is a DIY Media Center running XBMC which plays videos up to 1080p.

Hardware and Software overview

There are two different types of Raspberry Pi boards (Wikipedia). Both have a 700 MHz CPU based on ARM11. But only Model B has a Ethernet connector and up to 512 MB RAM which is shared with the integrated GPU. You can connect it to your TV through a HDMI or Composite Cable.

If you order only the board, you still need a SD Card for the operating system and a Micro USB power supply. Maybe you already have both from an old mobile phone. In my case it works perfectly with a micro SD card and a SD adapter. If you want a nice case to protect your Raspberry Pi against dust, you should order this also. Or if you prefer a special design search one at ebay later.

There a some prepared Linux images, like Debian, Arch Linux and RISC OS, which you can download from raspberrypi.org but if you want to set up a XBMC continue this guide.

The GPU is optimised to play .mkv files out of the box, because H.264 encode and decoding is included by default. Also .avi files will play by default. Only if you later wish to play MPEG files like .mpg, .mpeg, and .m2v or VC-1 files like .wma and .wmv you need additional license keys which could be ordered separately.

Using OpenELEC

Beside some other XBMC images like Raspbmc and XBian, I always prefer openELEC because after some testing I figured out, that it is most up to date, very fast and easy to use.

First download latest Raspberry Pi Build from openELEC, extract the file and inset the SD Card to be used into you computer. A detailed description is also available, but in fact you only need a single command to copy openELEC (and delete all existing data) at your card:

sudo ./create_sdcard /dev/mmcblk0

If you later want to update it manually just switch into the target sub folder and copy all files to your SD Card:

Now insert the SD Card into your RPi, connect at least the HDMI and the power cable to start the show and have fun!

Remote Control

There are some apps to control your XBMC remotely. But you probably have to enable it first in the options. With a extrenal USB Mouse this is easily possible.

More comfortable is a real hardware remote control and if you already own a Logitech Harmony you also need a RC6 IR receiver and set the profile to Windows Media Center SE. To switch the audio stream add hash (#) and to switch the subtitle add star (*) to your Harmony profile at myharmony.com (see: remote.xml). For more information see the links below, and maybe search for "rc6 ir" or "mce ir" at ebay. In my case a "HP MCE Remote Control" works with the mentioned profile out of the box.

]]>http://admirableadmin.de/216/raspberry-pi-as-a-media-center-with-xbmc/feed3Getting started with Oracle Database 11ghttp://admirableadmin.de/215/getting-started-with-oracle-database-11g
http://admirableadmin.de/215/getting-started-with-oracle-database-11g#commentsSat, 26 Jan 2013 19:13:20 +0000http://admirableadmin.de/?p=215Oracle is an object-relational database management system for various platforms like Windows and Linux. Installing Oracle Express Edition and creating an initial user is straightforward.

1. Download and Install Oracle Database Express Edition

Beside some Enterprise and other commercial licences (Wikipedia) there is Oracle XE as a free version of the Oracle RDBMS, but it is limited to 11 GB of user data and to 1 GB of database storage.

First go to the Oracle Database Express Edition 11 and download it. You have to accept the license agreement and login with an oracle account. It is up to you to create a new one, maybe register with a trashmail, or using an existing account from bugmenot.

Optional: It may be a good way to install Oracle into a virtual machine by using tools like VirtualBox. This prevents your Windows to slow down, because all database data will load at Windows starts up.

After downloading the zip file, extract is and run the setup.exe file inside the DISK1 folder. In the setup progress you will have to enter a password for the SYS and SYSTEM accounts. Pick a not too easy one, because these are the main admin user accounts of your Oracle Database.

2. Download and Install Oracle SQL Developer

For a graphical interface of the Oracle Database I recommend using Oracle SQL Developer, which only has to be extracted and could be placed directly below your Oracle Database installation, inside C:\oraclex\. For easy use you can create a short cut on your Desktop, which will link to the sqldeveloper.exe.

3. Create a new Oracle Database User

If you connect with the SYSTEM user through SQL Developer to your database, you will see a lot of internal and default tables. To setup a new connection just click green "plus" icon and enter the following information:

Expand the "system" tree, search for Other Users and right-click it and select "Create User. Fill in the necessary information. In the Roles tab check the Granted box for CONNECT and RESOURCE. If you will work with table views you also have to check the System Privileges tab and set the Granted check box at CREATE VIEW.

Now you can connect with the new user.

]]>http://admirableadmin.de/215/getting-started-with-oracle-database-11g/feed4Synchronize Thunderbird with Android Phonehttp://admirableadmin.de/204/synchronize-thunderbird-with-android-phone
http://admirableadmin.de/204/synchronize-thunderbird-with-android-phone#commentsThu, 07 Jun 2012 11:42:40 +0000http://admirableadmin.de/?p=204Here I will describe how you could synchronize your Thunderbird and Lightning with Google Calendar for viewing and creating events on your Android Phone.

1. Preparing Thunderbird and Lightning

For working with events and tasks there is a good add-on called Lightning. So first download and install Lightning through the Add-ons Manager or directly from addons.mozilla.org. Please note to choose the correct version, because for each new version of Thunderbird there is a different version of Lightning.

2. Integrate Google Calendar into Lightning

There are some additional add-ons like “Provider for Google Calendar” but you don't need them for adding your Calendar into Lightning. Google provide a step by step guide. Please click at "Enable Google Calendar in Mozilla Sunbird" (Sunbird is a outdated standalone version of Lightning) and follow the instructions. In the simplest case your Calendar CalDAV URL look like: https://www.google.com/calendar/dav/username@gmail.com/events

3. Adding Events from your Android Phone

Now you can test your configuration. Simply create a new event at your Android Phone Calendar. Select your Google Calendar, enter a Event name and save it with the "Done" Button. If everything goes through the new created event appear in your Thunderbird Lightning Calendar. To speed the testing up, right click your Google Calendar in Thunderbird and select "Synchronize Calendars".

It also works the other way around. So if you create an event in Thunderbird it should appear later at your mobile phone.

]]>http://admirableadmin.de/204/synchronize-thunderbird-with-android-phone/feed2Install Nginx with PHP on Ubuntuhttp://admirableadmin.de/195/install-nginx-with-php-on-ubuntu
http://admirableadmin.de/195/install-nginx-with-php-on-ubuntu#commentsSun, 20 May 2012 14:31:19 +0000http://admirableadmin.de/?p=195Developing your own PHP Applications with Netbeans is very easy and require only a few steps to install and configure Nginx with PHP on your local Ubuntu System.

First step is to install the required packages php5-cgi, spawn-fcgi and nginx. While phpunit, php-pear and smarty are optional, one should install at least php5-suhosin for security reasons. However all together uses only 50MB of hard disk space:

Netbeans will work with a public_html directory located in your /home/username folder. But Nginx can't access them because of inadequate rights.

Instead of changing the permission and letting everyone access your home-directory (777 is indeed a bad idea), create a folder below the default Nginx directory with you username and appropriate permission (replace ap with your username/group) and pointing a symbolic link to it:

]]>http://admirableadmin.de/195/install-nginx-with-php-on-ubuntu/feed3Things I did after installing Ubuntu 12.04http://admirableadmin.de/193/things-i-did-after-installing-ubuntu-12-04
http://admirableadmin.de/193/things-i-did-after-installing-ubuntu-12-04#commentsMon, 30 Apr 2012 14:26:41 +0000http://admirableadmin.de/?p=193After a fresh installation of Ubuntu 12.04 there are some things to configure for a perfect system.

3. Configure Unity
I really like Unity, and finally now it is a little bit more configurable than the previous release of Ubuntu. However, many settings are adjustable only through "CompizConfig Settings Manager" (ccsm):

sudo apt-get install compizconfig-settings-manager

Like the previous release of Ubuntu, the fastest way to add new Icons to Unity is to move they manually from the icon folder to the sidebar:

/usr/share/applications

Or, if you want to create own icons then place them into your home folder and move them also with your mouse to the sidebar:

~/.local/share/applications

5. Change font size
Like the previous releases of Ubuntu I need an extra tool to change the font size system wide. With the "Advanced Settings" (gnome-tweak-tool) i can set all fonts to a size of 9.

sudo apt-get install gnome-tweak-tool

6. Using Pidgin
Pidgin integrates itself fine into the identification bar. So you can safely uninstall gwibber and empathy:

8. Thunderbird locales
This time I run my system in a en_US.utf8 locale environment, but i don't like the AM/PM time display in Thunderbird. To get a 24 hour display i add the following line to /etc/default/locale

LC_TIME="en_DK.utf8"

9. Backup
And finally don't forget to setup the "Déjà Dup Backup Tool" to run automatically. It will remind you regularly to make a copy of your data.

]]>http://admirableadmin.de/193/things-i-did-after-installing-ubuntu-12-04/feed1Installing nginx with PHP on Debianhttp://admirableadmin.de/190/installing-nginx-with-php-on-debian
http://admirableadmin.de/190/installing-nginx-with-php-on-debian#commentsSat, 25 Feb 2012 23:06:29 +0000http://admirableadmin.de/?p=190By searching the web how to install nginx with PHP5 on Debian, one can find different tutorials, but many require a lot of manual work.

At first some background information: nginx (wikipedia) is a very fast webserver with efficient use of system resources. Because of debian's security policy you can't install the current up to date version of out of the box, therefore you have to compile it on your own. Or one can use the dotdeb service, which offers a slightly older version of nginx. Furthermore you can use some strange setup scripts if you trust them.

But if you do not need the most up to date version of nginx and don't want to break your systems securety with different thirdparty stuff you can follow this short guide.

Install required packages

apt-get install php5-cgi php5-suhosin spawn-fcgi nginx

Start nginx afterwards:

/etc/init.d/nginx start

Type in your web server's IP address and you should see some error-webpage. On my system the /var/www directory was missing, so i have to create it:

mkdir -p /var/www
chown www-data:www-data /var/www

For testing you can create a index.html file inside /var/www with some "Hello World" or something like that so.

Setting up php parsing

Edit the file /etc/rc.local and put the following line above the "exit 0":

Make sure that there are some spaces between include and fastcgi_params in the default file this is written as one word which is a bug.

For testing you can create a /var/www/info.php with

<?php
phpinfo();
?>

and after a restart of your webserver you should see the php-infopage

/etc/init.d/nginx restart

As you see, PHP5 is working, and it's working through FastCGI, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5, also for security reasons we installed already Suhosin module.

]]>http://admirableadmin.de/190/installing-nginx-with-php-on-debian/feed2Getting started with Arduinohttp://admirableadmin.de/188/getting-started-with-arduino
http://admirableadmin.de/188/getting-started-with-arduino#commentsTue, 24 Jan 2012 19:08:24 +0000http://admirableadmin.de/?p=188Recently I discovered an interesting programming platform called Arduino, which is an complete open source hardware system. You only need the board and IDE. Combined with a USB cable one can start developing an electrical project programmed in C++.

Hardware

The main system is based on a AVR microcontroller from Atmel (Wikipedia). The current model is called Arduino Uno. It has 14 digital pins for input or output and additional 6 analog input pins. The I/O pins are powered by 5V and 40 mA. If you are willing to wait two weeks for delivery, you can buy one from China at eBay. But to realy support the open source project you should get an original version which is labeled ''made in italy".

Arduino IDE

The main reason for the widespread of Arduino is that the developing interface is available for Window, Linux and Mac (Download), while the programming language is C++. With Ubuntu you can easily install the current available package through the ubuntu software manager, which is surely not the most up to date version, but it runs perfectly out of the box.

Quick Start Guide

connect your Arduino via USB with your Computer

run Arduino IDE

check the correct setting at Tools->Board (Arduino Uno) and Tools->Serial Port (/dev/ttyACM0) - may differ on other operating system

run a Example from File->Examples->1.Basic->Blink

press verify button to compile the code (play symbol)

press upload button (right arrow symbol)

After uploading (TX/RX blinking) you will see that the integrated red LED (pin 13) will continuously turn on and off for a second. This is the so called Blink Tutorial. For a more detailed step-by-step and well explained tutorial take a look at ladyada.net/learn/arduino. If you are interested you can watch "Arduino The Documentary (2010)" where you learn something more about the creation and history of Arduino.