Build and run UniFi Controller using Docker on Raspberry Pi

35 || 0  || 2018-09-30 08:27:32 || root    Bash

Use the following commands to build Docker image and run a container. All commands below are compatible with Raspbian 9 (stretch).

Dockerfile itself can be found here: https://snippets.yoctocloud.cc/snippets/8b3e124affea4f228bba6daa434df91e/

Show snippet

Git commands

35 || 1  || 2018-09-21 01:31:07 || root    Bash

Useful Git commands:

  • Remove all local Git branches that don't exist in remote repository
  • Remove all local Git tags that don't exist in remote repository
  • Remove tag from remote repository
  • Remove tag from local repository
  • Create new Git branch and push it to remote repository
  • Checkout to the branch from remote repository

Show snippet

Dockerfile for UniFi Controller

35 || 0  || 2018-08-04 08:50:41 || root    Dockerfile

Dockerfile for building UniFi Controller image on Raspberry Pi

Check the following document with instructions how to build an image and run a container: https://snippets.yoctocloud.cc/snippets/f7a6cbc1102a4ab581143f5af7bf626e/

Show snippet

Update dynamic IP in NOIP service

27 || 0  || 2018-04-18 07:54:47 || root    Bash

This script allows you to update your dynamic IP address in NOIP service. Don't forget to replace firstname_lastname@gmail.com, my_password and example.zapto.org with real values.

Save this script somewhere and add it to cron:

  • crontab -e
  • */30 * * * * /usr/local/bin/noip.sh

Show snippet

Configure VLAN on Linux server

27 || 0  || 2018-04-18 07:46:16 || root    Bash

Commands for configuring VLAN on Linux server for the following cases:

  1. When port is tagged
  2. When port is untagged

Show snippet

Useful Linux commands

30 || 0  || 2018-04-18 07:42:16 || root    Bash

Here is just number of different useful Linux shell commands

  • Show ports used by process
  • Release deleted files
  • Archive log files with maximum compression level

Show snippet

Generate random files

27 || 0  || 2018-04-18 12:05:05 || root    Bash

The command below will create 1000 files with random content and size between 500Kb and 25Mb

Parameters:

  • -w 1 1000 - number of files
  • of=file_%.log - filename
  • -i51200-2621440 - minimum and maximum size of files. Actual size will be multiplied by value of count (10 in our case)

Show snippet

Install and run Pyrasite

29 || 0  || 2018-04-16 09:06:45 || root    Bash

Steps required to install and run pyrasite package. Pyrasite is a library and a set of tools for injecting code into running Python programs.

More details in official documentation: https://pyrasite.readthedocs.io/en/latest/index.html

Show snippet

Dockerfile for ejabberd

31 || 0  || 2018-04-14 06:06:20 || root    Dockerfile

Dockerfile for building image for ejabberd server on Raspberry Pi

Check the following document with instructions how to build an image and run a container: https://snippets.yoctocloud.cc/snippets/f4ee2da14ecc46db87cb43336a4d4114/

Show snippet

Build and run ejabberd server using Docker on Raspberry Pi

32 || 0  || 2018-04-14 06:05:43 || root    Bash

Use the following commands to build Docker image and run a container. All commands below are compatible with Raspbian 8 (jessie).

The list below also contains commands related to Let’s Encrypt certificate for the jabber server. DON'T FORGET to change example.com to your real domain name!

Dockerfile itself can be found here: https://snippets.yoctocloud.cc/snippets/68bc29b442b147b9b0445dda8e63f495/

Show snippet

Convert MP3 files using FFmpeg

28 || 0  || 2018-04-14 06:04:28 || root    Bash

Convert MP3 files using FFmpeg. Script makes the following:

  1. Gets all MP3 files in current directory
  2. Shuffles files in random order
  3. Removes "bad" characters from files' names
  4. Converts each MP3 file using the same audio codec (libmp3lame)
  5. Saves each new MP3 file in "results" directory

Show snippet

Commands for MySQL

31 || 0  || 2018-04-14 06:03:57 || root    Bash

This snippet contains several useful shell commands related to MySQL. The document is periodically updated.

Show snippet

Incremental backups using Duplicity, Rsync and GPG

64 || 0  || 2018-04-14 06:03:33 || root    Bash

The script below allows you to create system backups on Linux systems using Duplicity, Rsync and GPG. Check comments in the code and don't forget to replace some placeholders with real values.

There are several snippets related to this topic:

  1. Incremental backups (duplicity + rsync + gpg)
  2. Full backups (duplicity + rsync + gpg)
  3. Backup to Amazon S3
  4. Configuring GPG keys

Please check the code to find links for other code snippets.

Show snippet

Full backups using Duplicity, Rsync and GPG

28 || 0  || 2018-04-14 06:02:41 || root    Bash

The script below allows you to create system backups on Linux systems using Duplicity, Rsync and GPG. Check comments in the code and don't forget to replace some placeholders with real values.

There are several snippets related to this topic:

  1. Incremental backups (duplicity + rsync + gpg)
  2. Full backups (duplicity + rsync + gpg)
  3. Backup to Amazon S3
  4. Configuring GPG keys

Please check the code to find links for other code snippets.

Show snippet

Backup files to Amazon S3

29 || 0  || 2018-04-14 06:01:56 || root    Bash

The script below allows you to upload backup of your system to Amazon S3. There are several snippets related to this topic:

  1. Incremental backups (duplicity + rsync + gpg)
  2. Full backups (duplicity + rsync + gpg)
  3. Backup to Amazon S3
  4. Configuring GPG keys

Please check the code to find links for other snippets.

Show snippet