Creating macro to take and save screenshot and paste saved location into clipboard - docker

I'm trying to follow this guide and countered a problem with step 4. This step essentially binds a keyboard shortcut to a bash script that uses scrot and xclip to save a screenshot and pastes the saved location to clipboard.
If I were using a Linux operating system I could follow this instruction, but currently I am using a Docker Ubuntu Container hosted on Windows 10. If I try to use xclip or scrot I get the following errors respectively.
xclip error:
Error: Can't open display: (null)
scrot error:
Can't open X display. It *is* running, yeah?
To work around this I've thought about replicating step 4 on my host machine with a combination of snip & sketch, clip, and binding a window shortcut to a batch file. There are many issues with this, the main issue being the fact that snip & sketch doesn't automatically save your screenshots, so I'd have to manually save after each screenshot.
My goal is to save a screenshot to a specified location and paste the saved location into my clipboard. Emphasis on image location because I am aware that snip & sketch copies the screenshot onto your clipboard; this is a problem I can't paste an image into vim.
To perform these series of commands on Docker or my host machine is fine.

Related

ROS: Using images from bag as subscriber

I am working on a ROS project and struggling with this problem.
Currently, I am using aruco_ros.
https://github.com/pal-robotics/aruco_ros
I have a bag file that contains raw images, and I want to get published topics from aruco_ros based on the file. So, I modified single.launch like below.
or
And then, I did this.
$ roslaunch aruco_ros single.launch
However, I could receive nothing from all published topics. From rviz, I recognized that image from aruco_ros is located at image/debug, so I modified the path to "/camera/color/image_raw" after writing a command
$ rosbag play -l my_bag.bag
At rviz, the image is well displayed, but the published topics are still emtpy.
I tried multiple attempts but I have no idea how this will work. Could you help me out?

Unable to locate lidar on rviz map through mrpt localization

I am trying to do localization just using lidar . I uses the map generated by cartographer_ros and do localization using mrpt_localization(http://wiki.ros.org/mrpt_localization).
I tried using the command 'roslaunch mrpt_localization demo.launch', it create an existing map from the bag file, similar to 'rosbag play '.
THIS IS THE LAUNCH FILE:
However, after finish the mapping, the lidar location (tf) disappear. I wanted to locate the lidar location in real-time on a generated/existing map. Even after i launch the rplidar_s1.launch it did not work. SEND HELP!!
The 'roslaunch mrpt_localization demo.launch' launch files already includes a map for demo purposes.
Try making a copy of that launch file, and remove the part that publishes the map (the demo_rosbag part). Then, make sure that all the TF and topic names in the mrpt_localization section of the launch file matches your settings... without more details on your files, TFs, etc. is hard to give more help, I guess!

ImageMagick failes to read a JPEG image

I've been using ImageMagick 6.9.0 for some time, and had setup some Railo scripts using it on a Windows Server 2008 R2 Standard Edition machine a while back. I know that they worked at the time. I just tried to run them on a new set of images now, but ImageMagick is failing on the very first command:
<cfexecute name="#Application.ImageMagickRoot#\identify.exe" variable="imgResult" timeout="60" arguments="-format ""%w|%h"" ""#attributes.infoFullPath#""" />
The error returned is:
identify.exe: RegistryKeyLookupFailed `CoderModulesPath' # error/module.c/GetMagickModulePath/662. identify.exe: no decode delegate for this image format `JPEG' # error/constitute.c/ReadImage/501.
I've never seen anything like this. So I checked and saw that there is a new version out, and downloaded IM 7.0.1. I tried running the above command again with no changes, but this time pointing to the 7.0.1 install folder. This resulted in a different, but similar, error:
identify.exe: unable to load module 'C:\ImageMagick-7.0.1-Q16\modules\coders\IM_MOD_RL_JPEG_.dll': The specified module could not be found. # error/module.c/OpenModule/1275. identify.exe: no decode delegate for this image format `JPEG' # error/constitute.c/ReadImage/505.
I looked in the directory in the error and there is a file named IM_MOD_RL_jpeg_.dll there.
The images that I'm trying to work with are all different, and I've cycled through 50 or so during testing. But all are between 4 and 10 megapixel photos exported from Photoshop CS5 Camera Raw to jpeg format. I've tried fiddling with the case of the drive letter and the file extension without success. A sample path to one of the images is:
c:\galleries_incoming\50\69\01 - Getting Ready\DSC_0001.JPG
I'm unsure what to try next. I tried running this command per an old message on the IM forum to get a list of my decode delegates:
convert -list configure
But IM tells me that configure is not a valid list option. In any case, it sounds like installing new decode delegates is something that requires a recompile, and I've just been relying on precompiled binaries (which I would assume would at least be able to read a jpeg).

Copying raw text from a grep to paste in an email

I'm running a VM with Debian 7.0 x64 and need to troubleshoot something with a provider, so when I run a grep command, the console outputs a long report. I need to copy all of that text that has been output and place in the body of an email, or post directly on another forum board. I'm sure the solution must be simple, but I can't find it in searching online. I see suggestions for right-clicking with the mouse but my VM console doesn't response to mouse clicks, and then I see suggestions for copying and modifying files within the console, but as I said above I just need to take the raw text to paste elsewhere.
Thanks for the help!!!
the easiest way would be to save the output to a file and attach that to your email. (personally i hate emails that have inlined long error-logs without good cuase - like annotations).
this would also allow you to compress the file before attaching it, reducing the size considerably (as text compresses quite nicely).
if this is not an option, there is xclip, which reads from stdin and puts that into a selection.
$ ls | xclip
allows you to paste (with your middle-mousebutton) the contents of a dir.
if you must use Ctrl-v for pasting, you can also do:
$ ls | xclip -selection c

How does vi editor remember current line of the previous file

Suppose I am reading a file in vi editor. I am at line number 50 and I quit. After some time I reopen the file in vi editor. I notice that the cursor is at the same line where I was before closing the file.
How does VI editor remember this?
Don't know about plain old vi. vim, however, saves the current line number of the files you edit with it in a file called .viminfo in your home directory. At least, that's what it does in Linux.
You can see this behavior in many programs. You close your IDE and when you reopen it, it opens your last project. Your can kill your firefox and when you reopen it, you get all your pages reloaded.
It is simple, they save it somewhere for themselves.
One of the common places to save these information in Windows-y applications is the registry. You can run regedt32 in your windows and see all those data there. With Linux-y applications, it is common to create a hidden file in your home (~). You can go to your home directory in your Linux and open file .bash_history and see your old bash commands that you can access with the Up Arrow key
Vi in particular? Definitely has a file somewhere.

Resources