Posted on Leave a comment

Announcing Phone Link, the next evolution of cross-device experiences for your Windows PC and Android phone

Phone Link, formerly known as Your Phone, brings your Android phone and your Windows PC closer together.

Today we are thrilled to announce the evolution of Your Phone app as Phone Link.  We introduced the Your Phone experience more than three years ago, allowing you to keep your smartphone in your pocket and still be able to access your photos and texts on your computer. Since then, we have enabled more capabilities, such as the ability to filter notifications on your Windows PC, make and receive phone calls even when your phone is out of reach, and use your Android mobile apps on your Windows PC.

As part of this evolution, we’re now introducing a brand-new interface that brings notifications upfront to help you be confident that you’re not missing out on anything.  With the new tabbed navigation, all the important capabilities and content from your phone are still right at your fingertips. And we have also made improvements to make set-up even easier.  With the next update of Windows 11, you will also be able to set-up Phone Link during your set-up with your new PC with the ease of scanning a QR code.

We see this experience as more than just bringing your phone into your PC but as a bridge between the two devices, so we are renaming the app to Phone Link. And to further celebrate this connection between your two devices, we have also renamed the mobile companion app from Your Phone Companion to Link to Windows for all Android users. We’re bringing both apps together with the same icon too.

User interface

Phone Link has updated design for Windows 11

In our journey to make it easier for customers to get to the content that matters to them, we saw a great opportunity with the recent release of Windows 11 to also refresh the app design.  We carefully updated our controls, color palette, and overall look and feel to deliver a native app experience on the new Windows 11 OS.  New app design changes include rounded corners, fresh illustrations and updated iconography.

User interface

Phone Link is reaching more customers around the world

Recently we took an exciting step in unlocking this cross-device functionality for a brand new market. Phone Link is now available in China thanks to a partnership with HONOR, making these experiences now available on HONOR Magic V, Magic 4 series and Magic 3 series devices, with more to come.

This is in addition to our existing partnerships with Surface Duo and Samsung to integrate deeply and provide an even better experience on these devices beyond what’s possible on other Android devices. Recently, in partnership with Samsung, we’ve made it easier to launch the apps you were recently using on your phone and continue using them on the PC. This brings the mobile and PC worlds closer by allowing you to jump to the Office desktop and web experiences for files you were viewing on your Office mobile app.

Phone and desktop

Get started with Phone Link on your PC

We want to express how excited we are to share the evolution of our Phone Link and Link to Windows experiences and thank all our customers for joining us on this journey thus far. The journey doesn’t stop here, we’ll continue to bring more cross-device experiences to Windows through Phone Link. If you haven’t tried it yet, now is the best time to dive in.  Start your cross-device journey here: aka.ms/phonelink.

Posted on Leave a comment

Using Fedora 33 with Microsoft’s WSL2

If you’re like me, you may find yourself running Windows for a variety of reasons from work to gaming. Sure you could run Fedora in a virtual machine or as a container, but those don’t blend into a common windows experience as easily as the Windows Subsystem for Linux (WSL). Using Fedora via WSL will let you blend the two environments together for a fantastic development environment.

Prerequisites

There are a few basics you’ll need in order to make this all work. You should be running Windows 10, and have WSL2 installed already. If not, check out the Microsoft documentation for instructions, and come back here when you’re finished. Microsoft recommends setting wsl2 as the distro default for simplicity. This guide assumes you’ve done that.

Next, you’re going to need some means of unpacking xz compressed files. You can do this with another WSL-based distribution, or use 7zip.

Download a Fedora 33 rootfs

Since Fedora doesn’t ship an actual rootfs archive, we’re going to abuse the one used to generate the container image for dockerhub. You will want to download the tar.xz file from the fedora-cloud GitHub repository. Once you have the tar.xz, uncompress it, but don’t unpack it. You want to end up with something like fedora-33-datestamp.tar. Once you have that, you’re ready to build the image.

Composing the WSL Fedora build

I prefer to use c:\distros, but you can choose nearly whatever location you want. Whatever you choose, make sure the top level path exists before you import the build. Now open a cmd or powershell prompt, because it’s time to import:

 
wsl.exe --import Fedora-33 c:\distros\Fedora-33 $HOME\Downloads\fedora-33.tar

You will see Fedora-33 show up in wsl’s list

 
PS C:\Users\jperrin> wsl.exe -l -v
  NAME                   STATE           VERSION
  Fedora-33                 Stopped         2

From here, you can start to play around with Fedora in wsl, but we have a few things we need to do to make it actually useful as a wsl distro.

 
wsl -d Fedora-33

This will launch Fedora’s wsl instance as the root user. From here, you’re going to install a few core packages and set a new default user. You’re also going to need to configure sudo, otherwise you won’t be able to easily elevate privileges if you need to install something else later.

 
dnf update
dnf install wget curl sudo ncurses dnf-plugins-core dnf-utils passwd findutils

wslutilites uses curl and wget for things like VS Code integration, so they’re useful to have around. Since you need to use a Copr repo for this, you want the added dnf functionality.

Add your user

Now it’s time to add your user, and set it as the default.

 
useradd -G wheel yourusername
passwd yourusername

Now that you’ve created your username and added a password, make sure they work. Exit the wsl instance, and launch it again, this time specifying the username. You’re also going to test sudo, and check your uid.

 
wsl -d Fedora-33 -u yourusername
$id -u
1000
$ sudo cat /etc/shadow

Assuming everything worked fine, you’re now ready to set the default user for your Fedora setup in Windows. To do this, exit the wsl instance and get back into Powershell. This Powershell one-liner configures your user properly:

 
Get-ItemProperty Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\*\ DistributionName | Where-Object -Property DistributionName -eq Fedora-33  | Set-ItemProperty -Name DefaultUid -Value 1000

Now you should be able to launch WSL again without specifying a user, and be yourself instead of root.

Customize!

From here, you’re done getting the basic Fedora 33 setup running in wsl, but it doesn’t have the Windows integration piece yet. If this is something you want, there’s a Copr repo to enable. If you choose to add this piece, you’ll be able to run Windows apps directly from inside your shell, as well as integrate your Linux environment easily with VS Code. Note that Copr is not officially supported by Fedora infrastructure. Use packages at your own risk

 
dnf copr enable trustywolf/wslu

Now you can go configure your terminal, setup a Python development environment, or however else you want to use Fedora 33. Enjoy!

Posted on Leave a comment

Windows search bar: The one stop for answers, now with Bing Visual Search

Every day, we have questions. Search engines, apps, digital voice assistants, or phones are usually our go-to places to find answers.

You may already know that you can use the search bar in Windows – found on your PC taskbar – to find things like an app, setting, or a file you’ve been working on.

But did you know it can also find answers to questions like…

What’s the weather like in Paris? What’s the score of the Leicester City match? How do you unzip a file?

Windows brings all these searches together in one place. It’s easy to find and easy to use.

Screenshot of Windows search home, pulled up in lower left hand corner of Windows home screen

You don’t have to scroll through a long list of results, you don’t have to open a browser, and you don’t have to leave whatever application you’re in. With a couple of keystrokes, you can find your answers.

Screenshot showing conversion of 5 pound sterling to 5.91 euro in search

“The goal was to enable search in Windows to bring the web to where you are,” says Alexander Campbell, a senior program manager working on search. “People spend a lot of time on the web and in browsers. We saw an opportunity to help people save time in Windows by bringing convenient, fast web results directly to the search bar in Windows. Stay on task and in your flow, just by hitting the Windows key or clicking on the search box.”

It’s also a convenient place to start a search that leads to a website. From the search bar in Windows, you can quickly type and navigate to a URL, without having to open a browser first.

“We have a search experience that gives you quick answers, web results and helps you start your web task. It’s amazing what you can do with it,” he adds.

Screenshot showing Reddit URL in search results

Every day it gets more useful: a full web search experience powered by the intelligence of Bing. You can search for quick calculations, music videos, movie trailers, sports scores, stock prices, movie times, weather forecasts and much more. Results turn up right in the taskbar. If you want to see more, you can open the results in your browser.

Screenshot showing Boston to Seattle flight status results

“The search bar in Windows gives you the quick info you need with none of the distraction,” Campbell says. “In the middle of an essay? It’s easy to jump in, check a fact and then get back to your work.”

The Windows and Bing teams worked together to bring a true web search experience into Windows, just like what you’d expect in a browser, into the search bar. And the teams continue to improve the search capability thanks to your feedback and Bing innovation.

Screenshot showing search results of how to zip files

The search bar is also the best place to go when you need to get things done on your Windows 10 device. Let’s say you need to download an app, Search can find it for you fast. For example, type “download microsoft to-do” or “download solitaire” and get an install link in the results preview. It’s also an easy way to get Tech Help answers to common questions, like “how do I connect a printer” or “how do I unzip files.”

Screenshot showing search results for "download microsoft to-do"

And now, in addition to entering a text search, you can search with an image by taking a screenshot. This feature is rolling out to users in the U.S. first with international markets to follow shortly after. (You need the Windows 10 May 2019 Update or newer to see this.)

Simply click the Bing Visual Search button in the bottom right corner and snip any part of your screen to search the web using the image.

GIF showing how Visual Search works, using searching for a blue couch as an example, with similar results popping up after sniping a screenshot of the couch

“Visual search is a new way of searching,” says Ravi Yada, product lead for Bing Visual Search. “There are a lot of things you can’t describe in words to get good enough results. By using an image as input for search, Bing can help you search what you see.”

Bing added camera-based searches in 2017, and made visual search features available in the Windows Photos App, Microsoft Edge, the Bing App and on Android phones through Microsoft Launcher. With the latest releases of Windows, you can use Windows Search to snip any part of your screen and search.

Screenshot of a bright orange flower with a pulldown menu in the Photos app, showing the choice to click on similar results

Screenshot of Bing results of Visual Search on photo of bright orange flower

“We found people also wanted to search with screenshots, so we brought searching with screen snips to the Windows search bar,” says Nektarios Ioannides, Bing Image Search lead.

For instance, if you’re planning your wardrobe for winter and you want inspiration from what your favorite celebs are wearing? You’ll find similar results. Or you might be shopping for furniture and see a sofa you like. Snip it and use it to comparison shop with Visual Search results [1].

Aside from finding similar products, Visual Search can recognize landmarks, flowers, celebrities, animals. It also recognizes text in images, so you can copy or search it [2].

“Search is evolving. We’re still expanding the breadth of capabilities,” Ioannides says. “It’s cool to see the growth and excitement it generates, especially as we move into a world where using our eyes to search becomes more common.”

For developers, there’s an API to incorporate Visual Search within products and apps they create.

“Search in Windows is now more intelligent than ever at getting you where you want to go, saving steps and time,” Campbell says. “We can’t wait to see how you use it.”

Let us know your feedback and what you want to see next by clicking the “Feedback” button in the top right corner of the search experience.

Eager to try this yourself? If you’re reading this on a device running Windows 10 May 2019 Update or newer, click on the following examples:

[1] Shopping results are only available to users in the United States and United Kingdom.

[2] This is available in English for now.

Posted on Leave a comment

Managing JBoss EAP/Wildfly using Jcliff

Systems management can be a difficult task. Not only does one need to determine what the end state should be but, more importantly, how to ensure systems attain and remain at this state. Doing so in an automated fashion is just as critical, because there may be a large number of target instances. In regard to enterprise Java middleware application servers, these instances are typically configured using a set of XML based files. Although these files may be manually configured, most application servers have a command-line based tool or set of tools that abstracts the end user from having to worry about the underlying configuration. WebSphere Liberty includes a variety of tools to manage these resources, whereas JBoss contains the jboss-cli tool.

Although each tool accomplishes its utilitarian use case as it allows for proper server management, it does fail to adhere to one of the principles of automation and configuration management: idempotence. Ensuring the desired state does not equate to executing the same action with every iteration. Additional intelligence must be introduced. Along with idempotence, another core principle of configuration management is that values be expressed declaratively and stored in a version control system.

Jcliff is a Java-based utility that is built on top of the JBoss command-line interface and allows for the desired intent for the server configuration to be expressed declaratively, which in turn can be stored in a version control system. We’ll provide an overview of the Jcliff utility including inherent benefits, installation options, and several examples showcasing the use.

The problem space

Before beginning to work with Jcliff, one must be cognizant of the underlying JBoss architecture. The configuration of the JBoss server can be expressed using Dynamic Model Representation (DMR) notation. The following is an example of DMR:

{ "system-property" => { "foo" => "bar", "bah" => "gah" } } 

The DMR example above describes several Java system properties that will be stored within the JBoss configuration. These properties can be added using the JBoss CLI by executing the following command:

/system-property=foo:add(value=bar) /system-property=bah:add(value=gah) 

The challenge is that the same commands cannot be executed more than once. Otherwise, an error similar to the following is produced.

{ "outcome" => "failed", "failure-description" => "WFLYCTL0212: Duplicate resource [(\"system-property\" => \"foo\")]", "rolled-back" => true } 

Where Jcliff excels is that it includes the necessary intelligence to determine the current state of the JBoss configuration and then applying the appropriate configurations necessary. This is critical to adopting proper configuration management when working with JBoss.

Installing Jcliff

With a baseline understanding of Jcliff, let’s discuss the methods in which one can obtain the utility. First, Jcliff can be built from source from the project repository, given that it’s a freely open source project. Alternatively, Jcliff can be installed using popular software packaging tools in each of the primary operating system families.

Linux (rpm)

Jcliff can be consumed on a Linux package when capable of consuming an rpm using a package manager.

First, install the yum repository:

$ cat /etc/yum.repos.d/jcliff.repo [jcliff] baseurl = http://people.redhat.com/~rpelisse/jcliff.yum/ gpgcheck = 0 name = JCliff repository 

Once this repository has been added, JCliff can be installed by using Yum or Dnf:

Using yum:

$ sudo yum install jcliff 

Or using dnf:

$ sudo dnf install jcliff 

Manual installation

Jcliff can also be installed manually without the need to leverage a package manager. This is useful for those on Linux distributions that cannot consume rpm packages. Simply download and unpack the archive from the release artifact from the project repository.

$ curl -O \ https://github.com/bserdar/jcliff/releases/download/v2.12.1/jcliff-2.12.1-dist.tar.gz $ tar xzvf jcliff-2.12.1-dist.tar.gz 

Place the resulting Jcliff folder in the destination of your choosing. This location is known as JCLIFF_HOME. Add this environment variable and add it to the path as described below:

$ export JCLIFF_HOME=/path/to/jcliff-2.12.1/ $ export PATH=${JCLIFF_HOME}/bin:${PATH} 

At this point, you should be able to execute the jcliff command.

OSX

While users on OSX can take advantage of the manual installation option, those making use of the brew package manager can use this tool as well.

Execute the following commands to install Jcliff using Brew:

$ brew tap redhat-cop/redhat-cop $ brew install redhat-cop/redhat-cop/jcliff 

Windows

Fear not, Windows users; you can also make use of Jcliff without having to compile from source. Windows, in the same vein as OSX, does not have an official package manager, but Chocolatey has been given this role.

Execute the following command to install Jcliff using Chocolatey:

$ choco install jcliff 

Using Jcliff

With Jcliff properly installed on your machine, let’s walk through a simple example to demonstrate the use of the tool. As discussed previously, Jcliff makes use of files that describe the target configuration. At this point, you may have questions like: What is the format of these configurations, and where do I begin?

Let’s take a simple example and look into adding a new system property to the JBoss configuration. Launch an instance of JBoss and connect using the JBoss command-line interface:

$ /bin/jboss-cli.sh --connect [standalone@localhost:9990 /] ls /system-property [standalone@localhost:9990 /] 

Now, use Jcliff to update the configuration. First, we’ll need to create a Jcliff rule. The rule resembles DMR format and appears similar to the following:

$ cat jcliff-prop { "system-property" => { "jcliff.enabled" => "true", } } 

Then we can simply ask JCliff to run this script against our JBoss server:

$ jcliff jcliff-prop Jcliff version 2.12.4 2019-10-02 17:03:40:0008: /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties) 2019-10-02 17:03:41:0974: /system-property=jcliff.enabled:add(value="true") 

Use the JBoss CLI to verify the changes have been applied.

$ “${JBOSS_HOME}/bin/jboss-cli.sh” --connect --command=/system-property=jcliff.enabled:read-resource { "outcome" => "success", "result" => {"value" => "true"} } 

To demonstrate how Jcliff handles repetitive executions, run the previous Jcliff command again. Inspect the output.

$ jcliff jcliff-prop Jcliff version 2.12.4 2019-10-02 17:05:34:0107: /core-service=platform-mbean/type=runtime:read-attribute(name=system-properties) 

Notice that only 1 command was executed against the JBoss server instead of two? This action was a result of assessing the current state within JBoss and determining that no action was necessary to reach the desired state. Mission accomplished.

Next steps

Although the preceding scenario was not overly complex, you should now have the knowledge necessary to understand the capabilities and functionality of the Jcliff utility as well as the benefits afforded through declarative configurations and automation. When building out enterprise-grade systems, however, Jcliff would not be executed manually. You would want to integrate the utility into a proper configuration management tool that employs many of the automation and configuration principles described earlier. Fortunately, Jcliff has been integrated into several popular configuration management tools.

In an upcoming article, we’ll provide an overview of the configuration management options available with Jcliff, along with examples that will allow you to quickly build out enterprise-grade confidence with Jcliff.

Share

The post Managing JBoss EAP/Wildfly using Jcliff appeared first on Red Hat Developer.

Posted on Leave a comment

4 tips for better tmux sessions

The tmux utility, a terminal multiplexer, lets you treat your terminal as a multi-paned window into your system. You can arrange the configuration, run different processes in each, and generally make better use of your screen. We introduced some readers to this powerful tool in this earlier article. Here are some tips that will help you get more out of tmux if you’re getting started.

This article assumes your current prefix key is Ctrl+b. If you’ve remapped that prefix, simply substitute your prefix in its place.

Set your terminal to automatically use tmux

One of the biggest benefits of tmux is being able to disconnect and reconnect to sesions at wilI. This makes remote login sessions more powerful. Have you ever lost a connection and wished you could get back the work you were doing on the remote system? With tmux this problem is solved.

However, you may sometimes find yourself doing work on a remote system, and realize you didn’t start a session. One way to avoid this is to have tmux start or attach every time you login to a system with in interactive shell.

Add this to your remote system’s ~/.bash_profile file:

if [ -z "$TMUX" ]; then tmux attach -t default || tmux new -s default fi

Then logout of the remote system, and log back in with SSH. You’ll find you’re in a tmux session named default. This session will be regenerated at next login if you exit it. But more importantly, if you detach from it as normal, your work is waiting for you next time you login — especially useful if your connection is interrupted.

Of course you can add this to your local system as well. Note that terminals inside most GUIs won’t use the default session automatically, because they aren’t login shells. While you can change that behavior, it may result in nesting that makes the session less usable, so proceed with caution.

Use zoom to focus on a single process

While the point of tmux is to offer multiple windows, panes, and processes in a single session, sometimes you need to focus. If you’re in a process and need more space, or to focus on a single task, the zoom command works well. It expands the current pane to take up the entire current window space.

Zoom can be useful in other situations too. For instance, imagine you’re using a terminal window in a graphical desktop. Panes can make it harder to copy and paste multiple lines from inside your tmux session. If you zoom the pane, you can do a clean copy/paste of multiple lines of data with ease.

To zoom into the current pane, hit Ctrl+b, z. When you’re finished with the zoom function, hit the same key combo to unzoom the pane.

Bind some useful commands

By default tmux has numerous commands available. But it’s helpful to have some of the more common operations bound to keys you can easily remember. Here are some examples you can add to your ~/.tmux.conf file to make sessions more enjoyable:

bind r source-file ~/.tmux.conf \; display "Reloaded config"

This command rereads the commands and bindings in your config file. Once you add this binding, exit any tmux sessions and then restart one. Now after you make any other future changes, simply run Ctrl+b, r and the changes will be part of your existing session.

bind V split-window -h bind H split-window

These commands make it easier to split the current window across a vertical axis (note that’s  Shift+V) or across a horizontal axis (Shift+H).

If you want to see how all keys are bound, use Ctrl+B, ? to see a list. You may see keys bound in copy-mode first, for when you’re working with copy and paste inside tmux. The prefix mode bindings are where you’ll see ones you’ve added above. Feel free to experiment with your own!

Use powerline for great justice

As reported in a previous Fedora Magazine article, the powerline utility is a fantastic addition to your shell. But it also has capabilities when used with tmux. Because tmux takes over the entire terminal space, the powerline window can provide more than just a better shell prompt.

Screenshot of tmux powerline in git folder

If you haven’t already, follow the instructions in the Magazine’s powerline article to install that utility. Then, install the addon using sudo:

sudo dnf install tmux-powerline

Now restart your session, and you’ll see a spiffy new status line at the bottom. Depending on the terminal width, the default status line now shows your current session ID, open windows, system information, date and time, and hostname. If you change directory into a git-controlled project, you’ll see the branch and color-coded status as well.

Of course, this status bar is highly configurable as well. Enjoy your new supercharged tmux session, and have fun experimenting with it.


Photo by Pamela Saunders on Unsplash.