qnap check raid

To check the raid run


To manuel set the speed

To manuel set the raid to check

 

Raspberry Pi: Install VNC Server

Who his Raspberry Pi neither on its own display, still want to operate exclusively through a console, for the VNC Server is the right. VNC transmits the image of the graphical interface over the network, or port forwarding via the Internet. Alternatively, install Remote Desktop, and I on the front of- and cons of the two protocols at this point will not go into, as these are discussed elsewhere on the net detail. Below I will describe how to get a VNC server on his Raspberry Pi running.
requirement: installed Raspbian or similar distribution

Step 1
As VNC server for the Raspberry Pi, the Tight VNC package recommends, which can be installed via the package manager APT.

Step 2

Now we install or preload, a small tool, which predicts, what programs and dependencies be opened next and this previously loads into RAM. This has the advantage, that the graphical user interface is much faster. For the operation of Raspberry Pis as pure server is not recommended preload.

Step 3

Subsequently, we adjust a configuration of preload on, thus the use of the RAM is handled effectively.

Step 4

Now we start the VNC server for the first time. We are asked for a password to login. Then you can define, whether you want to define a view-only password, to permit a third party without issuing or changing the own password can, to look at the desktop of Raspberry Pis.

Step 5

Now we stop the VNC server again, to make further facilities.

Step 6

We now create a startup script for the VNC server with the name vnc.sh, in which we enter the commands below. Use can replace 1280 × 720 by the desired resolution. However, I recommend without overclocking / overclocking over 1280 × 720 to go out, as this clearly goes to the Performance.

 

Step 7
Now we give to the newly created file running rights.

If you want to let start VNC automatically booting the Raspberry Pis so we must take the following steps.

Step 8 (optional)
We create a start / stop script in /etc/init.d named vncboot and add the following startup script in this one. As in Step 6 the resolution can be adjusted again.

 

Step 9 (optional)
Now we have to again give the file created additional rights.

Step 10 (optional)

Finally, we need to include the script in the Startup.

completely finished! When you start your Raspberry Pis, the VNC server will be started automatically. If you want to operate the Raspberry Pi in this form, I can recommend you to overclock this, because the graphical interface will run much smoother. How to do this I explained in the article Overclocking / overclocking without warranty loss. can connect now to the VNC client using the port 5901. As client I can for Windows TightVNC Viewer, recommend the package tightvnc-java for Mac OS X and Linux RealVNC.

proxy multicast stream over apache proxy with authentication

i configured an proxy for multicast to http

this you need for example for proxying traffic form Telekom home entertainment

add to crontab

initial creation for authentication

add an addtional user

add to vhost

enable mod’s on apache if not already done

modify the channel list like for telekom

 

WordPress autoupdater

install wp-cli -> http://wp-cli.org/

use this script

Funksteckdosen via Raspberry Pi via the terminal, Web Interface or control Siri – 433 mHz

occupancy

rpi2-pins

RaspberryPi Transmitter Receiver
Pin 2 / 4 (5V) VCC VCC
Pin 6 / 9 (GND) GND GND
Pin 11 (GPIO17) – RPi Nr.1 ATAD
Pin 13 (GPIO27) – RPi Nr.2 DATA (to the left of GND)

Software

We come now to the software. For this purpose, you must first start your Raspberry Pi, where everything has been assembled as described above. Connecting you should only times

perform. This your repositories are updated. Then git-core must be installed (if not already done anyway):

In order to realize the control of the transmitter, there is a project calledWiringPi. This it installed you on your Raspberry Pi as follows:

For our purposes,, to control the outlets there is already a project. This comes from xkonni and called Raspberry-Remote. Your installed it you so:

It's running, you have to you, nor the compile send.cpp, So type the following:

install a sniffer

For the pin assignment

test sniffers

Web Interface

Of course it is a bit awkward and uncomfortable, the whole always having to worry about the terminal / SSH. But no problem! Raspberry remote also provides the same Web interface with a matching. So you can use the, should her first time Apache and PHP install on your Raspberry:

Here we go to the Web Interface, what mitliefert xkonni directly. In addition I have the folder

a subfolder remote created. Then the contents of ~ / raspberry-remote / webinterface moved there:

Now still has in

File the IP address of Raspberry Pis to be adjusted: to simply use nano.

Deamon

Now is still missing, the daemon, accessed by the PHP script the web interface. For this we go back to the Raspberry remote directory: cd ~/raspberryremote and compile the daemon: make daemon
Now we can start this:

The & causes, that the process running in the background.

Now we can try our luck with the Web Interface: Therefore we call from another computer / mobile web interface via http://192.168.11.44/remote/ (Insert your IP) on. If it works and there are various outlets visible, then you have to now only in the config.php sockets named and possibly. the codes, etc. to adjust. The configuration should be self-explanatory.screenshot_webinterface

If you receive an error message such as "Switch out of range: GET /:XY "gets, do not worry! In the daemon.cpp are by default only the House Codes 00000 & 00001 & 00010 covered. This can, however, easily change. Go to back to the directory of Raspberry Remote (with me /home/pi/raspberry-remote/, also via

and opens the daemon.cpp with nano. Inside is the entry "nPlugs = 10;“, which you simply "nPlugs = 1110;“. then onsudo make daemon recompile and sudo ./daemon & start again. Now should work with you the web interface.

 

sources:

Let Raspberry Pi’s communicate with each other per 433MHz wireless signals

https://alexbloggt.com/funksteckdosen-raspberry-pi-teil1/

https://alexbloggt.com/funksteckdosen-raspberry-pi-teil2/

 

Further still have some other great projects found

OK Google, Switch to list -> https://blog.medienman.de/blog/2017/08/20/google-home-steuert-433-mhz-funksteckdosen/

Working Effectively With iTerm2

Fine-Tune Settings

Launch iTerm, open iTerm > Preferences or just

Open tab/pane with current working directory

Under Profiles tab, go to General subtab, set Working Directory to “Reuse previous session’s directory”.

Enable Meta key

To enable Meta key for Bash readline editing e.g.

to move to previous word, underProfiles tab, go to Keys subtab, set Left option key acts as: to “+Esc”.

Hotkey to toggle iTerm2

Under Keys tab, in Hotkey section, enable “Show/hide iTerm2 with a system-wide hotkey” and input your hotkey combination, e.g. I use

Switch pane with mouse cursor

Under Pointer, in Miscellaneous Settings section, enable “Focus follows mouse”.

Handy Shortcut Keys

Here’s a set of shortcut keys I commonly use. You can always look for other shortcut keys in the iTerm menu.

Tab navigation

  • open new tab
  • next tab
  • previous tab

Pane navigation

  • split pane left-right
  • split pane top-bottom
  • next pane
  • previous pane

Search

  • open search bar
  • find next

Input to all panes

  • input to all panes in current tab

Clear screen

  • clear buffer
  • clear lines (Bash command)

Zooming / Font Resize

  • toggle maximize window
  • toggle full screen
  • make font larger
  • make font smaller

iTerm lovers, did I miss anything out?

letsencrypt on apache and linux

this is a small guide how to setup letsencrypt on apache and on linux

first we need to download a letsencrypt tool and move the sample config to the right position

configure the letsencrypt config file

/opt/letsencrypt.sh/config.sh

 

configure theletsencrypt alias for apache

/etc/apache2/conf.d/letsencrypt

configure the hook.sh file for reloading the apache

/etc/letsencrypt.sh/hook.sh

change the mod of this file

configure the domain file

/opt/letsencrypt.sh/domains

run letsencrypt

create a crontjob that the certs will be generated every week

vhost

rewrites

proxy pass

Errors

systemd – tutorial

The new init tool systemd is already several distributions as an alternative to Upstart or dusty Sysvinit at. Some Sysvinit- and Upstart distributions familiar commands and tricks to work through compatibility measures under systemd. To use the capabilities of systemd correctly, the administrator should know, however, also tools and parameters of systemd.

The most important tool to interact with systemd's command line program systemctl. For changes to the configuration or restarting of background services it requires root privileges; some diagnostic calls can also perform simple user. Who calls the program without any parameters, receives a list of “Units”, do the at startup used tasks. In addition to the integration and testing of volumes includes the start background services or setting up hardware.

In a default installation of Fedora 16 lists Systemctl hundred sixty active units in ten different varieties. Among the most important service units. They take care of background services, a Sysvinit distribution typically starts about init scripts. Mount- and automount Units bind a file systems. Socket-Units legen Sockets an; they start indirect dependencies one other Unit, is accessed when the socket. (A detailed explanation of the Unit concept, see the first part of the article.)

you can instruct Systemctl A parameter, list only units of a particular type, about all service units:

Systemctl automatically directs its output further to less; Use the arrow keys can be not only high- and scroll down, but also to the right, because there sometimes hide further information.

The startup does Systemd with Units. The come in different varieties, the Systemctl can list separately. VergrößernIn the first column of output we find the unit name. The second column indicates, whether systemd could invite the Unit-Definition, the third, whether the unit is active. Inactive - installed, but not to start envisaged - Units are the program only with the switch -a out; The same applies to units, which was unable to load the init system about because of an error in the unit file.

Column four gives the current status. “exited” shows, that the process has completed without error. This is for example the case for services, the running in the background - for example in the service unit, the known Sysvinit file performs compatibility reasons /etc/rc.local at system startup. “running” stands for services, running in the background: cron, dbus, sshd, udev and other.

The fifth column is a description of Unit. If you with “LSB” or “SYSV” starts, Systemd generated the unit automatically, work off a traditional init script.

For services, which could not be started or have crashed later, is in the fourth column “failed” - Highlighted in red, provided that the console colored output controls. The status-Command of sytemctl is the time of the cancellation and the returned error code of the program, for example

The status command of Systemctl supplies cutoff time and error code crashed services. In a freshly installed Fedora 16 lists Systemctl the 60 Service units on. Among them are the login processes for textconsole (agetty), because unlike Sysvinit Systemd handles this via service units as a normal background service.

Units …

The configuration files for generating Units, the systemd brings, liegen in / lib / systemd / system /; a same file in / etc / systemd / system / but takes precedence.

Unit definition are usually much shorter than the classic Sys V init scripts. A unit file for the service for network time synchronization via NTP is only a few lines long:

All unit files contained by a [Unit] introduced section with general settings, including a short description. In section [Service] follow service-specific information; with NTP that is only the command, to start the service. If a special command to exit is necessary, this can be a ExecStop-define statement. In the NTP daemon that is unnecessary, because it can be terminated in good Unix tradition by a SIGTERM signal; sending systemd to end, when no other command is specified.

The section [Install] includes instructions, the systemd in (From-)interpreted installation; , the entry in the NTP Example, that the time synchronization with the driving of the target “Multi-User” to be called.

… and targets

The target units offer a concept, resembling runlevels Sysvinit; For reasons of compatibility is understood Systemd even runlevels names to control equivalent targets. As before you can therefore at Fedora 16 the kernel in the boot loader parameter single give to; Systemd then controls rescue.target an, the minimal, the single-user mode corresponding area offers.

Also 3 is working, to control the multi-user mode without graphical login manager. Represents is this mode in systemd by the target unit multi-user. a multi-user.target to become the standard, submits Links:

If the graphical login manager later but start by default again, you can in the same way graphical.target raise the standard target; it is the equivalent of runlevel 5 Fedora and OpenSuse. As an alternative to the old runlevel designations can give to the kernel, the name of the starting target unit:

In order to drive a different target unit in operation, serves the isolate-Command of Systemctl:

The change in the Rescue Target's interesting for administration tasks, because it ended Systemd all user logins and background services, leaving only system services run - as those for monitoring Logical Volumes (lvm2-monitor). Sometimes they have to be shut down for renovations, what with the emergency mode emergency.target succeed; here only run the kernel threads.

desire

The show-Command of Systemctl delivers some of the internals to the current units and the work carried out on them. It can be used also spend, calls which Units systemd in driving the multi-user targets:

In issue other targets can be found - when multi-user.target about basic.target. This in turn depends on sysinit.target from, the local-fs.targetpresupposes. These three targets care about the basic setup of the system; these include the integration of the file system and the start of Udev. To specify the function of the Basic Target Unit contains the configuration file multi-user.target following information:

By After-Indication learns Systemd, that it not only call the target, but must wait for its full launch. Next Requires there is also the weaker Wants. In specified Units calls systemd to also, sets the start but also continued, if one of them does not start.

This type of function can also links to unit files specify, that are created in a directory, whose name composed of the name of the target unit and an attached .wants, about

.../systemd/system/multi-user.target.wants/

Ausknipsen

Who wants to disable NTPD Service Unit, so that the system at boot time is not synchronized via NTP, can do the following command:

Here Systemctl does nothing, to remove as the link to the service unit file in the directories Wants; when activating a service with enablethe tool will create a link. Both can be done manually, to Units to (from)check box to enable.

If a service is not of a Unit, but started a traditional init script, passes Systemctl prompted to activate the program chkconfig continue. In the Fedora is the case, if you installed Apache and activated via Systemctl.

The (From)Activate a service takes effect only after the next start or stop the system. The following command starts a service unique immediately:

The parameters stop ended the service. The command status Systemctl provides information about the unit, including its current state and the name of the file specifying them. In addition, the program gives, whether and how long does the service already and which processes belong to him; the main process has Systemctl thereby explicitly from.

About the group membership can be seen, to which service has a process.
Belonging to the scale of systemd Control Groups can be quite easy to find, the processes used and from which service to start. The scale of systemd cgroup hierarchy gives the command systemd-cgls out; alternatively shows ps the group membership to:ps crude -eour pid,args,cgroup

abgesoffen

If problems during startup problems, where systemd seems directly or indirectly involved, you should give to the kernel, the following parameters in the boot loader:

Systemd then writes detailed debugging information on the console and in the buffer of the kernel messages, to you later dmesg can read.

For systemd include the command line tools poweroff, halt and reboot; alternatively, you can shut down the system via the homonymous Systemctl commands or restart. A restart is also achieved with the command


The tool “systemd-cgls” , the Control Groups and their associated processes Show.
After stopping all services has Systemd the running kernel at, directly to start a previously configured Linux kernel - without BIOS self-test and boot loader. If no Kexec kernel configured, carried out a normal restart.

Ranholen

In common administration tasks to get only with the service- and target units in direct contact; the other units are particularly important for special features of systemd or do at startup all those things, around which at Sysvinit- have looked after and Upstart distributions distribution specific scripts. Among them is the inclusion of in / etc / fstab file systems specified, Enabling swap space or the occasional cleaning up the / tmp directory.

For some of these works systemd brings an automount function, the pseudo-mount may invest for in / etc / fstab configured file systems; actually involved they are, however, only on the first access. Adding “comment=systemd.automount” in / etc / fstab turns any mount point in a car mount point. This can speed up the startup process and is useful for example for network shares, if the network connection through the Network Manager is only set up when logging in a user.

cause research

About Systemctl can systemd for transmitting a signal calling, without knowing the process ID of the service. The following command offset Rsyslogd in debug mode; This is terminated, if one invokes the command a second time:

If you omit the indication of the signal to be transmitted, sends Systemctl a normal term signal, whereupon all processes should end, belonging to a service.

Systemd brings a program with, to visualize the startup process; the dark red areas, the starting phase of services from. Vergrößern
The command systemd-analyze outputs, how long the startup took and how much time it at the cost of kernel, omitted Initramfs and setting up the userland by systemd. The command systemd-analyze blame are the start times of the individual units of. For a more detailed consideration of the boot process, the program can create an SVG file, die the Start where Units visualized:

Sometimes you get so Units on the track, the strong pull the startup in the length. Some notes regarding the correct interpretation of these results provides the seventh part of the blog series “Systemd for Administrators”. The previous twelve-stranded series also includes many other tips and hints for practical use by systemd:

  1. Verifying Bootup
  2. Which Service Owns Which Processes?
  3. How Do I Convert A SysV Init Script Into A systemd Service File?
  4. Killing Services
  5. The Three Levels of “Off”
  6. Changing Roots
  7. The Blame Game
  8. The New Configuration Files
  9. On /etc/sysconfig and /etc/default
  10. Instantiated Services
  11. Converting inetd Services
  12. Securing Your Services

About the Homepage Lennart Poettering also found numerous other articles with backgrounds for init system. Im third “Systemd Status Update” Poettering has also listed some of the innovations recently, which were incorporated in the last eighteen months in systemd.

 

Those: http://www.heise.de/open/artikel/Das-Init-System-Systemd-Teil-2-1563461.html

Rebooting the Magic Way

If you have ever had a hard drive fail on a remote server you may remember the feeling you had after trying to issue the following commands:

Obviously, there is a problem with your drive. These commands are failing because the kernel is unable to load the /sbin/reboot and /sbin/shutdown binaries from the disk so that it can execute them.

A fsck on the next boot might be able to correct whatever is wrong with the disk, but first you need to get the system to reboot. If your machine is located at a managed hosting provider then you could submit a reboot ticket, but you’ll have to wait for someone to take responsibility.

Wouldn’t it be nice if there was a way to ask the kernel to reboot without needing to access the failing drive? Well, there is a way, and it is remarkably simple.

The “magic SysRq key” provides a way to send commands directly to the kernel through the /proc filesystem. It is enabled via a kernel compile time option, CONFIG_MAGIC_SYSRQ, which seems to be standard on most distributions. First you must activate the magic SysRq option:

When you are ready to reboot the machine simply run the following:

This does not attempt to unmount or sync filesystems, so it should only be used when absolutely necessary, but if your drive is already failing then that may not be a concern.

In addition to rebooting the system the sysrq trick can be used to dump memory information to the console, sync all filesystems, remount all filesystems in read-only mode, send SIGTERM or SIGKILL to all processes except init, or power off the machine entirely, among other things.

Also, instead of echoing into /proc/sys/kernel/sysrq each time you can activate the magic SysRq key at system boot time using sysctl, where supported:

If you would like to learn more about magic SysRq you can read the sysrq.txt file in the kernel documentation.

map server shares over sshfs

Installation on Debian

vi /etc/rc.local (this file will execute after network is enabled)