Code Optimization

Interesting things about software development and code optimization

USB 3.0 - 3.2 and SSD speed or what the hell is going on here

Привет друзья!

вы купили ноутбук или компьютер с поддержкой USB 3.0-3.2 (синего цвета разъем USB ) и карман с поддержкой USB 3.0-3.2 для внешнего SSD диска и решили что теперь то вы насладитесь скоростью, мощью и всеми преимуществами новых технологий?

подключили внешнее устройство и начали копировать файлы с компьютера/ноутбука на диск или обратно и наслаждаетесь процессом думая что 50МБ в секунду это максимум что позволяет технология и это то что вы ожидали?

а как на счет элементарных расчетов в голове или того что USB 3.0-3.2 и SSD - это минимум >500 МБ в секунду или в 10 раз быстрее или вместо 1 часа всего 6 минут?

как так? что такое?! - скажите вы,

проблема в том что Windows (вот хитрюги) по умолчанию отключает все эти преимущества в пользу небезопасного извлечения устройства тоесть без использования "безопасное извлечение устройства" иконки в вашей панели задач :)

да-да, чтоб вы могли просто выдернуть внешнее устройство из USB без всяких там "безопасных извлечений"

так что же делать? - выход есть! если вы продвинутый пользователь (или просто любите попадать в неприятные ситуации) и реально хотите ощутить всю мощь технологий и при

этом готовы отвечать за свои поступки - тогда включите эту опцию (см. скриншот) через свойства устройства.

но не забудьте! теперь вам нужно извлекать внешнее устройство только через "безопасное извлечение устройства"!

спасибо за внмание :) с вас всего каких-то 5 биткоинов - но зато какой ноледж и куча сэкономленного времени! ;)


USB 3.0 - 3.2 and SSD speed or what the hell is going on here (en)

Hi friends!

You have just bought a leptop or PC that supports USB 3.0-3.2 (blue color of USB ) and an External Drive case with USB 3.0-3.2 for your external SSD and decided that you would taste the speed, power and all other benefits of the latest technologies?

You have just plugged-in your external SSD and started copying files from/to your PC/laptop and enjoying of the process thinking that 50MBytes per second is the maximum of all of that?

But just do a simple calculations in your head or just think/google about that USB 3.0-3.2 and SSD - supports  more than 500 MBytes per second or 10 times faster or should take 6 minutes instead of 1 hour (60 min)?

What? What is wrong?! - you would say

Main issue is in that that Windows (oh wily) turn all these benefits by default in favor to non-safe device ejecting so you would just pull it out and forget about it :)

Yeah-yeah, so you would just pull it out without the "Safely Remove hardware and Eject media"

So would can you do? - there is a way! If you are an advanced user (or just like to get into troubles all the time ;) ) and really want to get most of the all latest technologies along be able to respond for all your doings - then just enable this option (see the screenshot) via Device Properties.

Pay Attention! from now you should always use the "Safely Remove hardware and Eject media"! or you will find yourself with lost or corrupted data.

Thank you for reading :) 

you owe me just a 5 bitcoins - but what the knowledge and I saved you a lot of time! ;)


Dropbox and Drive C - Clean disk on Windows and Windows Server

Hello friends,

You are trying to free up a few GBs on drive C? You tried to clean WinSxS folder, you have tried Disk cleanup util and even the Dism.exe but still need a few GBs of free space? ;)

You got to the right place - your problem is Dropbox.

- Go to the Program Files (x86) > Dropbox folder
- Delete all Client XX.XX folders except the latest one

You will be amaized that it will free up to 2-4 GB of space! :)

Thank you and see you ;)


AWS Windows Server - Restore RDP access blocked by Friewall

Hello friends,

today I'm going to share my experience on how we did restore RDP access blocked by Firewall after we blocked 3389 port by accident.

So first thing we tried was the standard steps suggested by AWS support, here they are:

1.Stop the instance i-xxyyzzaabb
Please note: it is recommended you take a snapshot or AMI of the instance prior to performing modifications for backup purposes.

I would note that if you have any data on any temporary drive attached to your instance then you will loose that data unless you will figure out how to backup it (I'm not sure if creating snapshot is backing them up but I guess - no)

2. Launch a temporary Windows EC2 Instance (20yy) in the same Availability Zone us-west-2a)

Be Sure to select exactly the same Availability Zone!

3. Detach the root volume vol-aabbccdd from the problem instance.

4. Attach the root volume to the new temporary instance (xvdf mapping is fine)
5. Login to the helper instance.
6. Download EC2Rescue on the temporary/helper instance from the following location:
7. Run EC2Rescue and select Next -> Offline Instance
8. Select the root volume vol-aabbccdd from the list of disks and select Next
9. Select Diagnose and Rescue which will provide suggestions to restore connectivity to the instance.
10. In the list of Detected Possible Issues, select all the checkboxes under windows firewall.
11. Select Next, then Rescue, and OK for the volume to be offline
12. Once EC2Rescue has completed, detach the volume from the temporary instance and re-attach the volume back to the original instance i-xxyyzzaabb as /dev/sda1. It is important to attach it back as /dev/sda1 .
13. Start the instance i-xxyyzzaabb and attempt to RDP

After two tries we were not able to get ride the Firewall and were not able to connect to Server via RDP.

So we decide to edit Register file of that problematic instance and yes we were right and managed to solve it.

Here are steps to do it:

1. Attach the volume to the temporary instance if not yet
2. Right-click the Windows toolbar button and open the Disk Management system tool

3. Find the offline disk (volume) and bring/make it online

4. Open RegEdit tool: Win+R > RegEdit > ENTER

5. Select HKEY_LOCAL_MACHINE node then File > Load Hive ...

6. go to Windows > System32 > Config  and find SYSTEM file on the new drive you just made online and available (the problematic instance drive)

7. in the prompt dialog gives it any user friendly name for example "RDP Lost Instance" or whatever you want

8. Under the name you set go to the node: 


if you added rule and want to disable it like we did.