Strona główna / Społeczność / Blog

Today I wrote my firs application for ReadyNAS OS. It's very, very simple. It just for Proxy Auto Configuration (PAC) / Web Proxy Autodiscovery Protocol (WPAD) so I called it wpad ;-)

The whole "application" serve only one file wpad.dat. It fits in two files: /apps/wpad/http.conf and /apps/wpad/wpad.dat itself. The content of /apps/wpad/http.conf is:

Now when apache starts it creates link:

To more detailed info about applications for ReadyNAS OS see ReadyNAS Applications Specification.

To have WPAD worked I had to configure also my router:

To resolve wpad as 192.168.1.12 (this is address of my NAS) in /etc/dnsmasq.conf I added:

and to in /etc/config/dhcp file in section config dhcp 'lan':

To backup embedded systems, such as Android phone or OpenWRT router you can use tar command in conjunction with ssh. As I mentioned before this method is almost successful with Android. Now example with Gargoyle router - called device.

Similar to Android devices OpenWRT's tar doesn't support --totals option, so I've prepared wrapper (see below) because it is necessary for BackupPC.

You will need:

  1. Copy your generated earlier id_rsa.pub to /etc/dropbear/authorized_keys on device. To be able to login without password.
  2. Login to device manually for the first time (to add it to known_hosts):

    as you can see I logged as root to device named router. Alternatively you can manually edit known_hosts.

  3. On device create file (ie. /root/tar_totals.bash) to emulate --totals option behaviour:

    and of course make it executable:

    (this what I can't do on Android)

  4. Define host in BackupPC with settings:

    as you can see only /etc is copied, and I use wrapper instead of tar command.

Now you can backup it. Of course in log you will have:

where you can see fake transfer summary.

Unfortunately on Android device you cannot set file as executable:

After you manage to ssh to your android device. You can set it up to backup with BackupPC.

Since rsync command is not available You can use tar. In configuration you have to set:

change path to tar:

and command to execute:

as you can see I've removed -l root and --totals.

Complete config is:

There are still some problems because backup is ended with an error:

You can backup android phone/tabled (device) with rsync installed on some host and SimpleSSHD installed on device.

First you have to check if you can ssh to device:

To login first time You have to run SimpleSSHD and press START to run it in foreground. From some host login to device using command:

enter password displayed in SimpleSSHD windows on device, you will see something like this:

As you can see my device has address 192.168.1.241 and server is using his default port 2222. You don't have to provide any user name (ie. -l someuser).

Now you can backup device manually using rsync:

Another approach is to use Rsync Wrapper by Letscorp (I didn't tested it yet).

The main target is to make android device be able to backup using BackupPC.

Installation

add following lines to /etc/puppetlabs/puppet/puppet.conf, of course, change puppetmaster to your host name:

you can reduce memory usage - edit /etc/sysconfig/puppetserver file and change JAVA_ARGS to:

then run service:

First manifests

To communicate with agents puppet use 8140 port - we try to open it using puppet in three steps:

  1. Install module to manage firewalld
  2. Create new puppet service
  3. Enable this service for public zone

Module installation

First we need module to manage firewalld - to install it create manifest file, ie. puppet.test.firewalld-install.pp (as you can see I used /root directory, but it does'n matter):

and test (--noop) first manifest:

after this you can apply (without --noop):

of course you could just run:

but it would be too simple ;-)

Create service

Now we can create firewalld service. Create file puppet.test.firewalld-service.pp:

and apply this:

(I cut warnings about depreciated validate functions)

As you can see there is a new file:

Again we could create this file manually, but what for?

Enable service

It's time to use this service. Create file puppet.test.firewalld-apply.pp:

(because public id default parameter zone can be omitted) and apply this:

and check:

This way is more interesting than boring:

Summary

As you can see setting up a test puppet master (and use them) is not so difficult. Configuration files and manifests are easy to understand.

Next step is to manage agents on other hosts...

To properly install and boot CentOS 7 from iSCSI target (without PXE) you have to have iSCSI Boot capable device. You have to configure your BIOS or NIC (aka HBA) properly.

When you boot CD/DVD/other installer you have to select Install CentOS 7 and type e (or Tab) to edit booting parameters and add rd.iscsi.ibft=1 (option ip=ibft is deprecated) to parameters.

Then during installation iSCSI discs will be available during installation.

The easiest way to restore files from BackupPC is web interface, but if You are desperated to use command-line style You can try this:

where:

  • backuppc (after su) - name of user BackupPC is running as
  • /opt/BackupPC/bin - path where BackupPC is installed
  • myLaptop - name of host in BackupPC (usually DNS name)
  • 23 - backup number you want to restore (can be relative ex: -1)
  • / - is share name
  • etc - directory you want to restore (relative to share name)
  • /tmp/etc.tar - file with restored files

Of course usually You will compress this file:

Detailed information on BacpupPC documentation page.

To list your hard drives you can use command:

...

I just found that I've wrote similar article some times ago:

I've tried to install virtual Linux on my second HDD (using optical bay adapter). To add physical drive you have to type command:

(based on Using a raw disk as a VirtualBox drive in Windows 7 by Dan Fox) In my case I've to add full path to VBoxManage.

Then to install additional packages in CentOS 7 (using minimal installation) you have to manually enter full URL:

(How To Install CentOS 7 Via NetInstall)

Ten kto umie pisze kod, ten kto nie umie pisze książki..., albo blog.

Pon Wt Śr Czw Pt So N
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31