mySQL workbench can’t connect via ssh tunnel

If you can’t connect with your mysql-workbench to a database via ssh have a look at your logfile:

tail -f -n 100 ~/.mysql/workbench/log/wb.log

and you will see this error:

14:12:58 [ERR][sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last):
File “/usr/share/mysql-workbench/sshtunnel.py”, line 265, in _connect_ssh
look_for_keys=has_key, allow_agent=has_key)
File “/usr/lib/python2.7/dist-packages/paramiko/client.py”, line 306, in connect
t.start_client()
File “/usr/lib/python2.7/dist-packages/paramiko/transport.py”, line 465, in start_client
raise e
ValueError: CTR mode needs counter parameter, not IV

change your transport.py:

sudo nano /usr/lib/python2.7/dist-packages/paramiko/transport.py

press CTRL+W for searching for the term

return self._cipher_info[name]['class'].new(key, self._cipher_info[name]['mode']

and replace this

return self._cipher_info[name]['class'].new(key, self._cipher_info[name]['mode'], iv, counter)

with

return self._cipher_info[name]['class'].new(key, self._cipher_info[name]['mode'], '', counter)

as mentioned in the Github pull requst

All credits are going to user hansaplast for his answer on stackoverflow!

Sync folders in Vagrant but exclude some folders from syncing

Maybe you know this:
you have a huge Java project, maybe the project itself is a sum of many (not even so small)  Java projects.
For sharing the complete setting with other developers you normally use a Vagrant box to make it easy.
At work we needed 2 big projects in one Vagrant box, which included over 10 small maven projects.
Normally I would share it like this:

config.vm.synced_folder "my-project1", "/home/vagrant/my-project1"
config.vm.synced_folder "my-project2", "/home/vagrant/my-project2"

You can imagine, the normal start-time of our server with permanently syncing all folders, including all the target folders took much too long.
On a local machine, without a Vagrant box, it normally needs around 2 minutes to start
But with syncing all target folders, it needs between 7-10 minutes to start the server

Of course, this is not acceptable at all.

So i was looking for some better way for syncing it, and I came to a good solution rsync

config.vm.synced_folder "my-project1", "/home/vagrant/my-project1", type: "rsync",
 :rsync__exclude => ['my-project1/, my-project1/mini_project2/target,my-project1/mini_project2/target,my-project1/mini_project3/target,my-project1/mini_project4/target']
config.vm.synced_folder "my-project2", "/home/vagrant/my-project2", type: "rsync",
 :rsync__exclude => ['my-project2/, my-project2/mini_project2/target,my-project2/mini_project2/target,my-project2/mini_project3/target,my-project2/mini_project4/target']

 

You do this with every folder you need in your Vagrant box and where you don’t want everything synced.

At the moment it only syncs the folder from you host to your guest system on vagrant up and vagrant reload.
Of course you want to have any changes to be synced to your developer box.

So the solution is:
Open two terminal shells:

First terminal:
vagrant rsync-auto

Second terminal:
vagrant up

When you change now something in the host system, it’s automatically synced on your guest system

Being able to develop on a THL 5000 phone on a linux computer

When i tried to deploy a Hello World app from my Linux notebook to my THL 5000 notebook i got this result:

API Level 1 sucks

So, my phone has API level 1, nice – NOT!

Googling my ass off, I could nowhere find the device id for this phone… So Tobi told me: Brute-Force is the way to go and what should I say: it worked!

So: google for the “51-android.rules” or just save this one.

After that copy it in the right place

sudo cp /home/username/download/51-android.rules /etc/udev/rules.d/

and make it working with

sudo chmod a+r /etc/udev/rules.d/51-android.rules

When plugging now my THL 5000 to my notebook, everything works fine!