Copy Drives with rsync on Windows from WSL

I have E: drive that I have been using for years to dump my personal files. I just purchased 4TB drive for fear of failing drive, so I want to copy everything on E: to the new drive (F:). I could have drag and drop everything from E: to F: but I wanted a geekier way (well maybe more robust way) to copy files from E: drive too F: drive. Here is how I started the process with rsync.

rsync -avz --progress /mnt/e/* /mnt/f

I have like 1TB of data (that’s it?) and it will take hours for it to finish the copying process.

VS Code Remote SSH Development

Though I love Linux Mint, I still have my Surface Pro 7 laptop for my personal mobile use. There is nothing I really need Windows for now but I just have it around when I need to be somewhere else to do my personal work.

I’m away from my desk but I want to continue to work on my personal project I started on my Linux Mint. Sure I can continue to do it through SSH in terminal using vim but I want to use my favorite editor like Visual Studio Code. I looked around how I could edit my code remotely. I found Visual Studio Code Remote Development extension. I was able to connect my VS Code on my Windows via SSH and directly edit the files.

I followed an instruction on remote development using SSH and I was able to start to use it. It’s quite easy to follow so I high recommend it!

Amazon Workspaces

AWS has a feature called Workspaces. You can have Windows desktop on AWS cloud for relatively cheap price. I just provisioned one that says “Free Eligible” so I don’t know exactly how much it costs (AWS always has something to charge…) so I will see how it goes in the next few weeks and I’ll report the cost here.

It’s really nice to have a desktop on Cloud in a sense that I don’t have to manage hardware. That said, I am not sure if it can be used as my development machine because the free tier spec is quite weak.

Here is the spec of the virtual desktop.

  • 1 CPU (at 2.5 GHz)
  • Memory: 4GB
  • Diskspace: 80GB+40GB

Surface Pro 7 is Back

I had my Surface Pro 7 being repaired (replaced) and it had been away from me for about a month. It had come back to me in about 2 weeks when I first sent it back to Microsoft but the one that came back to me was a faulty one. I had to send it back to Microsoft again to get a replacement again. Not having my personal laptop made me feel somewhat crippled but it finally came back to me yesterday.

This time, things are working as expected. It will take some time for me to get back the software I usually use and set it up to the usable state.

Now that Windows 11 has been released officially, I have upgraded the OS to Windows 11.

Surface Pro 7 in Repair

I have had my Surface Pro 7 for the last few years. It had been working well until recently but it died today. It was malfunctioning in the last week or so. It was not showing anything on the screen when I turned it on. It did come back up sometimes but it was rarely usable.

So I searched Microsoft’s repair service. They want to charge me like $500 for a replacement because it’s out of warranty. I could have gone for another new laptop but what I would like would cost at least a thousand. I did things to improve the situation such as applying the latest firmware and reinstalling Windows 10 but nothing worked. My old MacBook Pro lasted more than 10 years and my current company provided MacBook Pro has been working just fine for the last 2 years. It’s sad that the PC laptop doesn’t last so long…

I do like Surface Pro 7 but I was getting quite sick and tired of the unstableness every time Windows 11 updates happen. So to mitigate it, I installed Linux Mint on it. It looked like it worked but still the graphic damage was so severe that it wasn’t usable.

I’ve sent the device to the address it was specified in the repair process page already, so I should get a replacement in a few weeks. No personal laptop till then… oh well.

How to Add a Control to System.Windows.Controls.MenuItem Programmatically in WPF

I’m working on a new feature for Jenkins Toolset. It’s the feature that allows you to invoke a job with parameters. I need to add parameters to MenuItem according to parameter types. I have not completed the feature yet but I figured out a way to add controls programmatically, so here is the sample code.

var g = new System.Windows.Controls.Grid();
g.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());
g.ColumnDefinitions.Add(new System.Windows.Controls.ColumnDefinition());

var lblText = new System.Windows.Controls.TextBlock();
lblText.Text = $"{p.Name} ";
System.Windows.Controls.Grid.SetColumn(lblText, 0);

var txtBox = new System.Windows.Controls.TextBox();
txtBox.Width = 100;
System.Windows.Controls.Grid.SetColumn(txtBox, 1);

parItem.Header = g;

Here is the sample UI.

It took me a while to figure this out, so I thought I’d share it here in my blog. 🙂

Jenkins Toolset

I used to do a lot of automation with Jenkins. I worked for a software shop that had multiple instances of Jenkins for prod, stating and development with hundreds of jobs. It was not so easy to manage all of them without a tool, so I had decided to create a desktop software with WPF. I still have the project on GitHub today.

As the context menu indicates, it can do all of those things. It can list the jobs on the specified Jenkins instance and manage them. I made it downloadable on OCI’s Object Storage from here.

Here is the view of the builds of a job.

I would like to convert this project to a MAUI project eventually. I will write about the tool more later when I have some more time.

Uploading Backup File to OCI’s Object Storage via Jenkins

I have had a need to upload a zip file for backup from a Windows agent to Oracle Cloud Infrastructure’s Object Storage. Here is what I did.

Installed OCI CLI for Windows. Please follow this link to install it on Windows. Then, Install Jenkins slave on the same machine. I have a step by step instruction on how to do it. Once you install it, make sure to change the account to run the slave as to the account you used to install OCI CLI. Otherwise, it won’t work.

On the Jenkins job, using Compress-Archive Cmdlet, you can zip up some directories into a zip file.

Compress-Archive -Path $zipPaths -DestinationPath $zipFile

Please note that Compress-Archive has a limitation of 2GB. I heard that it’s the limitation of the underlining API.

Now that you have the zip file, you can upload it to Object Storage like the following.

oci os object put -bn backup --file $zipFile -ns "yournamespace" `
	--parallel-upload-count 5 --part-size 20 --verify-checksum

I am recommending this method to a customer because Object Storage is a relatively cheap and secure storage on OCI. It also supports retention duration and also replication. Great feature for relatively reasonable service.