Script to create Public/Private-key SSH login without password

SSH_Communications_Security_logo.svgTo increment your servers security one position might by to disable ssh login with password and use certificated login instead. But if you are not familiar withe the given tools, creating the requested certificates and how to install them on the server and your client the following script will help you. Just run it on your Mac or *nix system.  Weiterlesen

Veröffentlicht unter Datenbanken, Mac, Netzwerk, Unix / Linux | Verschlagwortet mit , | Hinterlasse einen Kommentar

Versioned Nightly 100% Virtual Machine Backup (VMWare Workstation)

vmware_logo3If you want to Backup your virtual machine every night and need to keep more than one version the following batch / script is what you’re looking for.

 

 

Weiterlesen

Veröffentlicht unter Datensicherheit, Windows | Hinterlasse einen Kommentar

Check if device is mobile (iOS, iPhone iPad, iPod, Android, WebOS, Windows Mobile, Blackberry) inside PHP

<?php
$isAndroid 			= (bool) stripos($_SERVER['HTTP_USER_AGENT'],"Android");
$isiPad 			= (bool) stripos($_SERVER['HTTP_USER_AGENT'],'iPad');
$isiPhone 			= (bool) stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
$isiPod 			= (bool) stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
$iswebOS 			= (bool) stripos($_SERVER['HTTP_USER_AGENT'],"webOS");
$isBlackBerry 		= (bool) stristr($_SERVER['HTTP_USER_AGENT'],'blackberry');
$isWindowsMobile 	= (bool) stristr($_SERVER['HTTP_USER_AGENT'],"Windows Mobile");
$isMobile 	= ($isAndroid || $isiPad || $isiPhone || $isiPod || $iswebOS || $isBlackBerry || $isWindowsMobile)
?>

Veröffentlicht unter PHP, Programmierung | Verschlagwortet mit | Hinterlasse einen Kommentar

How to set dd (disc dump) verbose (mac / bsd / linux)

Because of the missing verbose mode in GNU dd there is an other application with verbose mode by default. It’s dcfldd.

dcfldd is an enhanced version of GNU dd written by Nicholas Harbour

I especially used it for duplicating Raspberry Pi SD Cards. Without dcfldd you don’t know what time it will take to create the backup or SD Card.

Running Example:

Mac:Downloads andreas$ sudo dcfldd if=RaspberryPi.img of=/dev/disk1 bs=512
1798144 blocks (878Mb) written.

How to install dcfldd:

  1. Download dcfldd-1.3.4-1 :
    (wget http://andreasprang.de/?attachment_id=534)
  2. tar -xvf dcfldd-1.3.4-1.tar
  3. cd dcfldd-1.3.4-1
  4. ./configure
  5. sudo make install clean

Veröffentlicht unter Unix / Linux | Verschlagwortet mit , , | Hinterlasse einen Kommentar

Raspberry Pi – set sound interface shell script

Raspberry Pi

Raspberry Pi B © GijsbertPeijs/Flickr (CC BY 2.0)

 

For selecting the audio output I wrote a little script.

 

 

 

 

#!/bin/bash

if test $1  #check if parameter 1 / 0=auto, 1=analog, 2=hdmi is set
then

        echo "Try to select sound Interface:" $1
        sudo amixer cset numid=3  $1

else
        echo " select interface :" 
        echo "0=auto"
        echo "1=analog"
        echo "2=hdmi"
        read -p "Which interface should be used? " interfaceID
        echo "Try to select sound Interface:"  $interfaceID
        sudo amixer cset numid=3 interfaceID
fi

Veröffentlicht unter Unix / Linux | Verschlagwortet mit | Hinterlasse einen Kommentar

FreeBSD 9.0 – Statische IP-Adresse mit default Gateway konfigurieren

Um unter FreeBSD eine statische IP-Adresse samt Gateway zu konfigurieren sind die folgenden schritte notwendig. Alle Änderungen werde in der Datei /etc/rc.conf durchgeführt.

Weiterlesen

Veröffentlicht unter Unix / Linux | Verschlagwortet mit , | Hinterlasse einen Kommentar

FreeBSD 9.0 – SSL (HTTPS) für apache / WebDAV aktivieren

Um SSL unter FreeBSD zu aktivieren ist folgendes notwendig:

Weiterlesen

Veröffentlicht unter Unix / Linux | Verschlagwortet mit , | Hinterlasse einen Kommentar

FreeBSD mit XFCE unter VMWare

Für einen unserer Server musste eine Unix / Linux Distribution aufgesetzt werden. Die Wahl hierfür fiel auf FreeBSD. Wir setzen unsere Server gern zunächst in einer VM unter VMWare Fusion auf.

FreeBSD hat sich von durchweg als eine gute Wahl herausgestellt!

Einzige Probleme ergaben sich nach der ausnahmsweise benötigten Installation von X.Org und XFCE. Weder Maus noch Tastatur funktionierten unter dem X-Windows-Server. Weiterlesen

Veröffentlicht unter Unix / Linux | Verschlagwortet mit , | Hinterlasse einen Kommentar

Mac OSX – Die Terminal Grundinstallation

Nachdem das neue MacBook Pro Retina angekommen ist hieß es nun wieder einmal: Neuinstallation aller Modifikationen auf der Konsole / im Terminal. Im letzten Jahr habe ich hier einige Änderungen an meiner Konfiguration vorgenommen, um schneller voran zu kommen.  Weiterlesen

Veröffentlicht unter Mac, Unix / Linux | Verschlagwortet mit , , | Hinterlasse einen Kommentar

Get number of CPU’s available

If you need to know how many CPU’s are available this code will help you:

 

 

Weiterlesen

Veröffentlicht unter iPhone & co., Programmierung | Verschlagwortet mit , | Hinterlasse einen Kommentar