IMAPSYNC for Debian 8 installation

  1. apt-get update
  2. apt-get upgrade
  3. apt-install git libjson-webtoken-perl libauthen-ntlm-perl libcgi-pm-perl libcrypt-openssl-rsa-perl libdata-uniqid-perl libfile-copy-recursive-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libhtml-parser-perl libjson-webtoken-perl libmail-imapclient-perl libparse-recdescent-perl libmodule-scandeps-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-mockobject-perl libtest-pod-perl libunicode-string-perl liburi-perl libwww-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus
  4. cd /home
  5. git clone https://github.com/imapsync/imapsync.git
  6. cd imapsync
  7. chmod +x imapsync
  8. Test it by typing
    ./imapsync
  9. You may need to install some extras by entering
    cpanm File::Tail
  10. cp imapsync /usr/bin/

Done!

Item 10 is to make sure you can use this command anywhere on the server. Have fun!

Loading

Force a file scan in NextCloud

To force a scan after a manual file transfer, for example, can be done as follows:

sudo -u [USER] php occ files:scan --all

for example:

sudo -u john php occ files:scan --all
Usage:
  files:scan [-p|--path="..."] [-q|--quiet] [-v|vv|vvv --verbose] [--all]
  [user_id1] ... [user_idN]

Arguments:
  user_id               will rescan all files of the given user(s)

Options:
  --path                limit rescan to the user/path given
  --all                 will rescan all files of all known users
  --quiet               suppress any output
  --verbose             files and directories being processed are shown
                        additionally during scanning
  --unscanned           scan only previously unscanned files

Source: https://docs.nextcloud.com/server/15/admin_manual/configuration_server/occ_command.html

Loading

Adding SSH keys to Github

For Debian 9 (and MacOS)

  1. Check for old keys
    1. cd ~/.ssh
    2. ls id_*
  2. Backup old keys
    1. mkdir keys_backup
    2. cp id_* keys_backup
  3. Generate a new key
    1. ssh-keygen -t rsa -C "your_email@example.com"
    2. don’t use a passphrase
  4. Go to the key directory
    1. cd ~/.ssh
  5. Download the public key
  6. Open the key in Notepad++ (or similar)
  7. Log in at github.com
  8. Click on the right side on your profile picture
  9. Click on Settings
  10. Click on SSH and GPG Keys
  11. Click on New SSH Key
  12. Create a new name for the key
  13. Paste the contents of the public key into the Key field
  14. Click on Add SSH Key

Done.

Loading

I fixed my fuse in Debian 8

[root@conrad ~]# apt-get autoremove
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up fuse (2.9.3-15+deb8u3) ...
Creating fuse device...
/run/udev or .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
chmod: cannot access '/dev/fuse': No such file or directory
dpkg: error processing package fuse (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 fuse
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have no idea why my fuse got bonked, but I simply made a folder named fuse in the dev folder and everything works as intended again.

Loading

IMAPSYNC command

Quick and dirty, still need to test it.

imapsync --host1 SOURCE_URL_OR_IP --user1 --password1 host2 DESTINATION_URL_OR_IP --user2 --password2

Next you will see how a simple command is written.

My source is hosted at mail.website.tld and has a mailbox with username “user@website.tld” and password “macaroni”

Now I don’t want my client to have any troubles with having to enter a new password and such, so I set up the mailbox on the new server with the exact same data.

The new server has the IP address “111.222.333.444” and has been set up that the new mailbox is using the same credentials.

Your command will now look like this:

imapsync --host1 mail.website.tld --user1 user@website.tld --password1 macaroni --host2 111.222.333.444 --user2 user@website.tld --password2 macaroni

A lot of text will fly by now and you will see that the mailboxes are synching. If you get “Detected 0 errors” at the end, all went well.

Now proceed with the other mailboxes and then you can make the change in the DNS to make the mailboxes on your new server available.

Loading