Loading file from USB into SageMath - sage

I can load a file from my desktop into my SageMath IPython window. But can't determine the correct path for a USB drive. Is there a specific path line needed for USB's?
SageMath version 8.6 and Windows 10 operating system.

Related

about R program path in Mac equivalent to Windows

How can we find the R file path in Mac ?
In Windows, this should be C:\Program Files\R\R-3.6.1\bin\x64\r .
/Library/Frameworks/R.framework/Resources/bin/R is not correct??
/Applications/R.app is where it is "installed" by default, assuming you want the executable or program or app mac style the underlying Unix system is as you stated /Library/Frameworks/R.framework/Resources/bin/R

Device is unable to BOOT or INSTALL with generated .hddimg

I have device which has following configuration:
Chipset architecture - Intel NM10 express
Processor - Atom D2550 Dual Core
Display - DVI
Volatile Memory - 2GB DDR3
Storage - 16GB
Objective: Device should run yocto embededded OS successfully
What I have done,
Downloaded three required yocto layers for warrior branch i.e. 1. poky 2. meta-openembedded 3. meta-intel
Modified local.conf with MACHINE ??= "intel-core2-32"
Ran source poky/oe-init-build-env
Generated .hddimg by bitbake core-image-minimal
Flashed .hddimg to thumb drive through dd command
Attached thumb drive to device and I could see BOOT and INSTALL option, upon clicking any of them nothing happens(not even logs) i.e. Blank screen
Troubleshooting I tried out are,
Tried to boot lubuntu and it was successful
Replaced kernel & initrd of lubuntu with yocto's one and booting was successful which indicates there is no issue with kernel or initrd in .hddimg generated by yocto
Tried some experiment with syslinux as well but didn't work out
The .hddimg types are quite outdated these days, and meta-intel has also switched to wic Their README includes very good information on how to create boot- and installable images here and here.
Short summary of it:
for booting, use the .wic-file
for building an installer, setup image and bootlader config according to documentation, then use .wic-file

How to install xv6 on virtualbox or vmware?

I'm trying to run xv6 operating system on VirtualBox or VMWare in a Linux host. The official instructions said how to run the OS on qemu only. However, the official page (https://pdos.csail.mit.edu/6.828/2014/xv6.html) mentioned that xv6 can be booted directly on hardware also, but it's not clear how.
I want to boot xv6 on VirtualBox or VMware first. I extracted the following command from the Makefile, which runs xv6 from the command line after it's compiled using make command.
/usr/bin/qemu-system-i386 -serial mon:stdio -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 2 -m 512
Please help me how to proceed. If the procedure is already documented some reference will be helpful.
The instructions are here which is linked (via 6.828 tools page) from your link though they are a bit terse:
Using a Virtual Machine
Otherwise, the easiest way to get a compatible toolchain is to install
a modern Linux distribution on your computer. With platform
virtualization, Linux can cohabitate with your normal computing
environment. Installing a Linux virtual machine is a two step process.
First, you download the virtualization platform.
VirtualBox (free for Mac, Linux, Windows) — Download page
VMware Player (free for Linux and Windows, registration required)
VMware Fusion (Downloadable from IS&T for free).
VirtualBox is a little slower and less flexible, but free!
Once the virtualization platform is installed, download a boot disk
image for the Linux distribution of your choice.
Ubuntu Desktop is what we use.
This will download a file named something like
ubuntu-10.04.1-desktop-i386.iso. Start up your virtualization platform
and create a new (32-bit) virtual machine. Use the downloaded Ubuntu
image as a boot disk; the procedure differs among VMs but is pretty
simple. Type objdump -i, as above, to verify that your toolchain is
now set up. You will do your work inside the VM.
I can see how one could read that and not see the answer.
After the virtual machine is installed, download the Ubuntu Desktop .iso. Install that into the VM and fire it up. Presumably the Desktop will provide a clear mechanism for loading your OS. (Wait, I'm giving it a try. Will update with the result.)
Turns out that is simply a Ubuntu client desktop, and isn't anything special for running a sub-operating system.
Looking around some more, I found the commentary to be the best potential clue. It contains this (head scratcher) phrase:
To run xv6, install the QEMU PC simulators. To run in QEMU, run "make qemu".
If only it specified the context to get to that point! (Sorry I am not more help.)
I see that you want to boot it on VirtualBox or VMware, but another option would be to using docker to run xv6. A great guide for getting started with xv6 through docker is here.
The full guide is elaborate and can help you with getting started.
It is an alternative option, but one that can get you going fast hopefully.
It will only take 4 steps to get going with the xv6:
Step 1
Download and set up docker here
Step 2
- Run this command in PowerShell or bash to pull the ubuntu image with xv6 docker pull grantbot/xv6
Step 3
- To run the docker image and get going with xv6 run this command docker run -it grantbot/xv6
Step 4
- Now inside the shell in the ubuntu image run cd /home/a/xv6-public/ to enter the root folder of the xv6.
Done
- Now you can compile and run the xv6 with make qemu-nox
Step 1.Compile xv6
Download the code, unzip it and enter the directory, compile the operating system image and root file system, the command is as follows:
make xv6.img&&make fs.img
Step 2. Write image to disk
Create two disks in a existed vmware virtual machine(my vmware version is 15.2.2, linux version is Centos7.8), the operation steps are: virtual machine settings -> add -> disk -> SCSI -> create a new virtual disk -> size 0.005 (allocate immediately, single file) -> name the disk "os", which means this disk is the operating system.
Create another disk named "fs" in the same way to put the root file system.
At this time, there should be "sdb" and "sdc" in the /dev/ directory (sda is the current operating system itself). If you do not see the "sdb" and "sdc", restart the guest operating system.
Write the operating system and root file system to the disk with the following command:
dd if=./xv6.img of=/dev/sdb bs=4k count=1000
dd if=./fs.img of=/dev/sdc bs=4k count=1000
shutdown the current virtual machine to ensure that the file has sync to the disk. At this time, the two images have been written to the disk, vmware saves the disk as a file, the location is in the directory of the current virtual machine, named os.vmdk, fs.vmdk, the next step will load these two files into the new virtual machine.
Step 3. Create xv6 virtual machine
To create an empty virtual machine, the operation steps are: customize (advanced) -> next -> install the operating system later -> choose other operating system type (choose other versions) -> take the virtual machine name as xv6 (name depend on you) ) -> Then use the default configuration all the way to "Next" to completion.
Right-click the created virtual machine and delete the disk created by default. Add the disk file created in the previous step to the current virtual machine. The operation steps are: add -> "disk" -> ide (note that this is an IDE instead of a SCSI disk, because xv6 reads an IDE format disk) -> use an existing virtual disk -> select the os.vmdk generate in the step 2->complete
Add fs.vmdk in the same way. Note that you must add os.vmdk first. Because os.vmdk is the operating system, it needs to be the first hard disk.
Now, you create a virtual machine which has two disk. one is os disk, another is root file system disk, all is ready.
Start the virtual machine, and the xv6 will start successfully.

How to run jupyter Rkernel notebook with inline graphics on machine without display?

I often run jupyter IPython notebooks on a linux cluster compute node without X11 with no problems. However, running the R kernel on the same setup is not working very well.
The machine details are:
CentOS 7.2
R 3.3.1 with X11, png, and cairo capabilities
Anaconda 4.0.0 (python 2.7.11)
Just starting the notebook causes the kernel to crash after the first cell is run with this in the log:
unable to open connection to X11 display ''
I can get it to work by starting the notebook with xvfb-run jupyter notebook. This lets me run R commands in the cells but when I try to produce plots, I get the following
Error in grid.Call(L_textBounds, as.graphicsAnnot(x$label), x$x, x$y, : X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 1 at size 9 could not be loaded
I suppose that if I could install the x11 fonts it would work, but this is on a compute node of a cluster and I don't have the administrative privileges to install them.
What is the correct way to configure jupyter notebook with the R kernel to produce graphics on a linux machine without X11?
I think that I've found the minimal configuration necessary for the irkernel when running the notebook on a linux machine with no display hardware and no physical input devices.
Run the notebook under the virtual framebuffer X server, xvfb:
xvfb-run jupyter notebook
Use cairo instead of X11:
# Run this in a notebook cell, or put in .Rprofile
options(bitmapType="cairo")
Set the jupyter.plot_mimetype. SVG looks much better and worked fine for me. PNG was ok too:
# Run this in a notebook cell, or put in .Rprofile
# svg much clearer, but won't rescale (scrolling works though)
options(jupyter.plot_mimetypes = "image/svg+xml")
# png had some artifacts, but had the nice feature that it would
# resize when the browser window changes size
#options(jupyter.plot_mimetypes = 'image/png')
# can easily resize plots (have to re-plot) with this:
#options(repr.plot.width=14, repr.plot.height=4)

Copy all files with certain extension from all subdirectories from a portable device (which has no drive letter assigned)

I've a cellphone connected as MTP to my computer (windows 7) and shows up as a 'Portable Device'. I want to copy all .apk files from all subdirectories of this device.
But using the search function of windows I can't copy from multiple directories and xcopy or xxcopy command line tools require my USB device to have a drive letter assigned. Which is not possible for a MTP connection (correct me if I'm wrong).
Forget the Portable Device of the USB option.
On phone
Download a server app such as WebDAV Server. This mounts your
phone roots directory over your local WiFi connection
Open app and start WebDAV server (mine: http://192.168.1.113:8080)
On pc
Assign a map network drive from the command prompt. Open cmd.exe and type net use s: //192.168.1.113:8080 (this will assign drive letter s to the UNC path.
Stay in cmd.exe and use xxcopy to copy all .apk from all subdirectories from the device into one folder by the following command: XXCOPY S:\*.apk C:\myapks\ /SGN. (the SGN command sorts the files, with newest files first)
downside: DAV is slow
sources:
step 1 and 2 - step 3 - step 4

Resources