On a Chromebook (Dell Chromebook 11), using Vim, I saved a file to /home/user/filename.txt . How can I get that content anywhere else in the world?
gmail attach a file does not let me go to /home/user
copy with Ctrl-C within Vim does not result in my text being in the paste buffer
I can see file:///home/chronos/user/Downloads/ in a browser, so if I could save content to /home/chronos/user/Downloads from Vim, I could get text out, but I can't do that.
In sum, I'd like any way to get the content of filename.txt anywhere outside the machine (cut and paste available in a browser, moving the file, resaving to a thumb drive). Thanks for any help.
file:///home/chronos/user/Downloads/ is literally the same Downloads folder. However, you can do that with terminal as well (if you're linux geek, this should be pretty simple)
Since you said you were using Vim, I assume that developer mode is on. In the shell, you can make use of mv linux command to move it to downloads.
mv /your/path/to/file.txt ~/Downloads/file.txt
Cheers!
Related
I have got downloaded a file that got downloaded in a format .ipynb extension but its not in a readable format. Can anyone help me to figure out how to make it in a readable format? Attaching a screenshot of the file when I tried opening it in notepad.
how to open it in readable format
One of the easiest ways to just view a notebook file that is also 100% secure in case what you are being sent is sensitive: nbpreview.
When you go there it asks you to choose a local file. The file isn't uploaded anywhere. It remains in your browser's local cache so it is useful for sensitive stuff that cannot be public.
Similarly, you can upload it to the notebook{sharing}space which is billed as "the fastest way to share your notebooks". It would provide you with a link to view the notebook you have and can be private if you limit sharing the link.
If the notebook can be posted to Github (repository or gist) or online, you can point nbviewer at it and have it rendered nicely. In fact, although it is technically 'static', nbviewer can render some interactive Plotly plots and widget controls that enable playing back animations comprised of frames. This rendering form is also very nice for sharing with non-programmers as the GitHub cruft is not surrounding the content.
You can use Jupyter running in your browser and backed by a free Jupyter community-run service to view the notebook file as an active notebook, on what is equivalent to a temporary remote machine.
Go to Try Jupyter and select either 'JupyterLab' or 'Jupyter Notebook' from the offerings presented. I'd suggest JupyterLab as the steps outline below are made easier as you have the file navigation pane on the left.
After your session spins up in your browser, if you chose JupyterLab, drag your file from your local machine into the file navigation pane on the left side. It will get a gray dashed line around it when you have dragged it to the right place. Drop it in and let it upload. Now double click on it to open it.
If you don't want to drag-and-drop or you chose Jupyter notebooks (classic notebook interface) make a text file and paste in the content you showed. (It's json format as that is the underlying .ipynb format presently.) Save that file with an .ipynb extension. You should then be able to open it the Jupyter Dashboard. (Note the following in the rest of this section was written before the 'Try Jupyter' offerings were switched to using the exerpimental JupyterLite and so your mileage may vary. If you drag-and-drop into JupyterLite, it actually is in your machine; however, it is in a virtual system in your browser that your local file system cannot access directly. To get what this section was specifically written for now, go here and click on the launch binder badge to trigger a session on a true remote machine served by MyBinder.) You used to click on the logo in the upper left to get to the dashboard but it will now take you to JupyterLab and you can double click to open your notebook file. If you really need the classic dashboard, change the end of the URL to change /lab to /tree.
Note because the environment backing your notebook hasn't been set up to handle everything, you'll be out of luck for now trying to run it. You'd have to add your pokemon.csv and install anything else besides pandas. There are ways to use the MyBinder system to handle that as well; however, probably best learned about later this stage.
The MyBinder session is temporary and unique to you. It will close after 10 minutes of inactivity and no longer be accessible. You can always open another session later and redo the steps. Or learn about other options eventually.
Related:
Nbpreview and a lot of the related tools mentioned here are also covered in Sharing R code in Jupyter notebooks.
(These following suggestions mostly assume the notebook is already online, usually at Github. You can still use a local notebook by uploading it to the session as I suggest above. They do though provide additional ways to learn about using MyBinder to serve active notebooks in your browser.)
How to save code file on GitHub and run on Jupyter notebook?
Run a Jupyter notebook directly online (without downloading it locally)
You need Jupyter Notebook in your machine. That is one option. Otherwise, you can upload the file into GitHub and open the .ipynb file from there.
I want to make an executable R-file (for automation purposes). Therefore I concluded the following tutorial.
After completion however nothing happens... Only the .Rexec file opening in RStudio (in stead of running it and showing me the pop up...
Any more people experienced this? Any clues to where to look to fix this?
The tutorial you gave is useful. However, it missed something.
After done all the things in that blog, you still need to do one more thing. Right click on the "test.Rexec" file and choose "open with" and then select "RScript". Maybe you need to find RScript in your system which is usually here:
C:\Program Files\R\R-3.2.1\bin\Rscript.exe
Remeber to check the "Always use the selected program to open this kind of file".
Next time, when you double click the "test.Rexec" file, evethying would be okay.
I found no need to create Rexec file.
I created .bat file and then set it up in Task Scheduler.
The .bat file opens up the Rscript.exe, as shown in prev answer above. The .bat file then points to the .R file, that I want to be executed.
For some time, I could not get it to work, but solution was to point to Rscript.exe as mentioned above. Then it will not open up in compiler.
Works fine for me.
I have a PyQt application where it spawns an XTerm window in a widget.
The XTerm window is launched with -e vim <file> which immediately runs Vim displaying the file for edit, etc.
When I hit :w! in Vim, I'd like to somehow catch that event and echo it
back to XTerm, and/or ultimately back to PyQt, so that I can modify another UI element.
I do know how to use a Vim autocmd to catch :w! (BufWritePost) and execute a shell script,etc...
...but I think I need to have Vim echo back, either with simple ASCII text or via a SIGNAL, back to the XTerm window and hopefully back to the QProcess.
So I think the key is figuring how to tell XTerm to do this, but I'm a bit stumped and open to any and all suggestions about how to accomplish.
Thanks to all in advance.
Your script would have to take into account that XTerm will not do the echoing (text echoed/printed in the terminal goes to the terminal's screen). Your script would have to either make vim echo something to a file, or run vim (in xterm) from a helper script that would pass the information back in a file.
Usually this is done by allocating a temporary file in the parent process (your PyQt application), and passing its name to the child process.
Can anybody help me to sort this out.
What is the logic of Tail -f utility in Unix.
Is it open the log file to check the updated content or is there any other way to get this information. All the implimentation of Tail utility says that it will open the fileenter link description here
As per the source code of tail utility, it is opening the file in read mode not in write mode.
So the answer is, I would say TAIL is opening the file for checks. But along with that i would like to answer one more question, since it is opening in read mode the other process that tries to open the same file will not face any issues.
Running RStudio in MAC (not server) and would like to know where to locate the Rprofile.site file in my working directory. Yes I have read ?Startup and I know exactly what I want to do with it (provided I find the file first) and yes I know where my getwd() is.
I have also gone through a bunch of posts in SO already which vaguely touch on/ answer this. Surely this will keep coming up so I will ask the question: Is there a literal file we can open and update with all the great start up code that has been shared and if so, where is it located in a MAC directory OR is there something more to it as I cannot locate this file.
1 answer I found mentions to create a text file then use terminal to copy visible contents of text file to invisible Rprofile? INVISIBLE??
Rprofile.site and .Rprofile are different files. Only files with a lead "." are treated as invisible by the Mac Finder. You didn't specify which OSX version you're using. If it's pre-Mountain Lion, you can IIRC use System Preferences to choose to display invisible files in Finder windows. Apparently it's more difficult in MountainLion. There are third-party tools like Onyx which allow you do set invisibility as well.
Given all that, I recommend you check the FAQ and forums at RStudio for specific info on where RStudio's installation expects to see these files.