Calendar Synchronisation - iPhone

In this article I will show you how to sync the calendar in Nextcloud with the one on an iPhone.
The idea is that you can create an event in the cloud and it will be on your phone within seconds.

 

1) Go to Preferences

2) Select accounts and passwords

3) Add account

4) Select type "different"

5) At calendar select CalDAV-Account

6) Add the data fron the nextcloud

Attention: behind /users/ you will need to put your login name!

Now you can test if you
can add Nextcloud events in your calendar.

7) Select Calendar

8) Create a new event

9) Now you can choose...

10) ... if the Event shoud be set up locally
or in the nextcloud

Cheers,
Ori


KVM: Setup on Ubuntu 16.04

This article describes how to:

  • Install KVM
  • Set up a virtual Ubuntu Server
  • Configure portforwarding to the virtual machine

The benefits of virtualizing are:

  • Secure the host- and guestservers from one another
  • Run multiple services such as databases without running into unwanted synergy effects

Canonical is releasing a so-called Ubuntu "Cloud Image".
This is a slim, optimized for virtualisation image of the ubuntu server.

Also we will take a look at the very powerfull tools Libvirt and ukv-kvm that automize a lot of the work setting up virtual machines.

 

Install KVM

SSH to your server with a user that has sudo.
Before doing any work we update the packet sources and install pending updates.

sudo apt-get update && sudo apt-get upgrade

Not every CPU does support virtualisation.
To check if your precessor works with kvm we install the "cpu-checker".

sudo apt-get install cpu-checker

Now you can check if your CPU meets the requirements using  kvm-ok.

Now that we are sure that we can work with KVM we install the uvtool.

sudo apt-get install uvtool

This provides us with two new tools with lots of parameters:

  • uvt-simplestreams-libvirt → Download and update images (synchronize)
  • uvt-kvm → Manage VMs

Lets download a Ubuntu 16.04 (xenial) 64-bit image.
Even if the cloud images are relativley small, compared to the original server images, this might take a few minutes depending on your internet connection.

uvt-simplestreams-libvirt sync release=xenial arch=amd64

 

Create Virtual Machine

To be able to connect to the VM we have to provide a public ssh key that gets implanted into the VM when setting it up.
In this example we create a new key, you can use your existing one however, if you want.

Remember to give the key another name then "id_rsa", to not override any existing key.

ssh-keygen

Now we use uvt-kvm to set up a ne VM with the name „vm_xenial“ and provide it with the generated public key.
(The default user is "Ubuntu". The key will be placed inside the vm at /home/ubuntu/.ssh/Authorized_keys )

uvt-kvm create vm_xenial release=xenial --ssh-public-key-file ~/.ssh/vm_xenial_id_rsa.pub

Using virsh we check the running VMs.

virsh list

Check for the IP...

uvt-kvm ip xenial

... and ssh to the VM using the private key.

ssh -i ./vm_xenial_id_rsa ubuntu@<ip>

Cheers,
Ori

Lots of thanks to Fl@ and beegeees, who provided significant help in writing this article.


Remotely activate RDP

If a Server or Client is unreachable via RDP the following Trick might help.
(Only works if the default $Admin share is enabled in this network)

Download PS Tools and start an administrative CMD.

Navigate to the pstools directory.
Using psexec you can start a shell on a remote host.

psexec \\HOSTNAME cmd

If the device is not domjoined or not in the same domain use this syntax to add username and password.

psexec \\HOSTNAME -u DOMAIN\USER -p PASSWORD cmd

Now that we have CMD with systemrights on the target system we can open up the RDP ports.

netsh firewall set service remoteadmin enable
netsh firewall set service remotedesktop enable

Then change the registry key that handles weather or not the target machine accepts RDP

reg add "hklm\system\currentcontrolset\control\terminal server" /f /v fDenyTSConnections /t REG_DWORD /d 0

Then you can rdp to the machine/server.

 

Cheers,
Ori


Restore deleted Object

If on a Microsoft Server there is no Active Directory Bin active, which happens way too often, and user-  or computerobjects get deleted and do not just get deactivated and pushed to an OU to rest in peace, you will find yourself in the delecate situation to restore Objects from the hidden OU "Deleted Objects".

This article describes how.

 

Connecting to LDP

At first you have to start ldp.exe with domain admin credentials.

In LDP you connect to the DC using Hostname or IP.

Now you authenticate over connection > bind.

If you are logged in as Dom-Admin you can use single sign on.
Otherwise provide domain, user and password.

Now connect to the Organisational Unit "Deleted Objets".
Go to Scope > Subtree

CN=Deleted Objects, DC="Domain", DC="Domainsuffix"

Now you will see the OU on the left hand side.
To show these you have to edit the control elements.

Here you select "Deleted Objects" check it out and in again (yay!) and now the hidden objects are visible.

Afterwards we search for the Object we want to restore.

 

Restoring the object

We remove the "isDeleted" attrbute  replace the "distinguishedName" attrubute with "CN=SomeName," followed by the canonical name of the last known parent.

 

Afterwards the object shoud be visible in Active Directory again, it is deactivated however.
If it is visible just refresh the Active Directory view a few times by pressing F5 or restart AD.

So easy... thanks Peter!

Cheers,
Ori


Edit the Bonestructure of Mixamo Rigs

Intro

this article describes how Mixamo rigged Characters can be Imported into Unity to work with VRchat.
It is based on this amazing Blogpost:
http://vrchat.wikia.com/wiki/Quick_Start_-_Mixamo_Avatar_Creation

The Unity Add-In is supposed to block you from uploading imporperly rigged Characters.
If however you fixed the Prefab after importing it, you can end up with your character not beeing animated.

How to change the Bone Structure

  1. Load the rigged Model into the Assets, set Rig to Humanoid and edit the bonestructure
  2. Then set the "Upper Chest" to None, "Chest" to Spine2, Apply and Done.
    Now you can import the Character and continue with the tutorial.

Cheers,
Ori


Installing the Linux Subsystem

I have found my self a lot of time beeng mad at how unnecessarily complicated and unintuitive the powershell feels.
Often I would miss the core utils, Screen / Byobu or even ssh for that matter.

A few days ago I came along a Blogpost by fefe where he mentiones the "Linux Subsystem for Windows".
http://blog.fefe.de/?ts=a7172ae6

Lets give it a try.

 

What is it
Windows Subsystem für Linux is Microsoft trying to implement a working Linux Shell in Windows.

How this is working on a technical level is described in the related Microsoft blogpost.


https://blogs.msdn.microsoft.com/wsl/2016/04/22/windows-subsystem-for-linux-overview/

Installation
The installation is quite easy.

Run (Windows + R): control /name Microsoft.WindowsUpdate

There you can activate the the developer mode.
This can take a few minutes.

Afterwards you have to activate the windows feature "Windows-Subsystem for Linux (Beta)" and restart the Host.

After reboot you can start the bash.

On first startup a couple of files will be downloaded from the microsoft store and you have to set up a user for the shell.
In this process there will be a few dialoges claiming that the procedure "Might take a few minutes"... if it appears to be stuck just hit Enter ;)

Finaly update und upgrade you packets and you are good to go.
sudo apt-get update && sudo apt-get upgrade

 

Tadaa, Bash on Windows:

There are limitations that I have run into already.
I will play around with it a bit and make a separate Blogpost for that.

Cheers,
Ori


When network drives are blocking the Powershell

The following error can prevent powershell scripts from running properly.

Attempting to perform the InitializeDefaultDrives operation on the 'FileSystem' provider failed.

In order to get the powershell up and running again we will have to fix this.
This error is resulting from a network drive that is mounted by the user 'System'.

Running Net use, even on an elevated CMD, the network drive is not visible and cannot be removed.

To remove it we will have to open a cmd with system rights.
There are more then one way to do this but the most easy one is PsExec.

PsExec is one of the legendary PsTools.
https://technet.microsoft.com/de-de/sysinternals/pstools.aspx
Download them and navigate to the directory.

The PsTools have been written by Mark Russinovich and then later been bought by Microsoft.
So you shoud be fine using them on productive systems.

With PsExec you can Spawn a Process on a remote device if the $admin share is active.
If you do not specify a certain context for this process 'System' will be used.

psexec.exe \\localhost -s cmd.exe

Net use should now show the drive.
Now you can delete it using net use DRIVELETTER: /delete /yes.

Cheers,
Ori


Changing Terminalserverprofilepath using Powershell

In a Windows Active Directory Domain additionally to having userprofiles on a server you can have a seperate user profile.

This profile is called terminalserver-profile and hence the name is only used if the user is working on a terminal server.

This way you only have to have one account per user, have a personalized profile optimized for working on a terminal server and the user has to remember just one Account / Password. (!)

If you want to roll out this sort of profile in an existing domain, depending on its size, it can become a very tiring job.
Jobs like this are perfect for scripting and in Windows this means Powershell.

A sad fact is that this profile path cannot be set using Get-Aduser and Set-Aduser.

Powershell Fu

We define a variable $user and provide using [ADSI]“LDAP://“ the canonical name of the users an.
In my example I point to the AD-Account tstest in the OU SBSUsers.

$user = [ADSI]"LDAP://CN=tstest,OU=SBSUsers,OU=Users,OU=MyBusiness,DC=xxx,DC=local

If you do not want to read this value manually from the ADSI Editor, first save the ad user object to a variable using get-aduser.

$findme = get-aduser -Identity tstest

Another way to do this:

$findme = Get-ADUser -Filter {(Name -Like "tstest*")}

This object has the "DistinguishedName" property, access it:

$usersCN = ($findme.DistinguishedName)

Now we build the complete canonical name:

$user = [ADSI]"LDAP://$usersCN"

The property "terminalservicesprofilepath" of the user tsts (stored on the object $user) can now be changed using $user.psbase.Invokeset("Property","New Value").

$user.psbase.Invokeset("terminalservicesprofilepath","\\server\share")

Finally we have to write the changes to the AD:

$user.setinfo()

 

 

Blow you will find an example script.

 

Cheers,
Ori