finding path in google colab - path

I am learning to work on google colab. For some reason, I did cd enter.
Now when I do !pwd
output : /root
when I do: ls!
output: googleplay
This is a file I was supposed to create in another folder.
Now I am not able to figure out how to get into the folder that I have in colab.
I am trying to go to the folder called tutorial that I have in colab.
I don't know how to get to this location
This is the tree structure of my directory
-Sample_data
-tutorial
tutorial
I know these files are stored in the content folder. But how should I find path to this

%cd <directoryname>
This is a magic function to change the directory.

I believe this question was already answered here: Changing directory in Google colab (breaking out of the python interpreter)
As the thread suggests, use:
%cd DIRECTORY_NAME
I hope this will help.

Related

JSON Error: Files or directories outside directory

I tried to submit an Edge extension. It is a simple extension that had three files: the manifest.json, background.js, and an icon.
When I sideload it in Edge, it works. When I tried to publish it, I got an error that says, Files or directories outside directory.
I have looked everywhere for documentation on what the folder directory should look like. Can someone point me to an example directory? Should there be more folders?
The solution was to create a zip file in another way. I found an online site, but if this was something important, I would find another computer.
Anyway, it seems that Big Sur adds something extra that MS doesn't like. Strange Google accepts it.

Rails 4: Issue Sending .txt files from local machine to Windows Share

I'm currently creating .csv files from a SQL view and writing to
#{Rails.root}/public/
which works no problem. In addition, I need to write these generated files to a Windows share in the form of:
\\NAME-APP.enterprise.company.com\Files
I've tried Net::SCP.upload, Net::SFTP.start, FileUtils, rsync, and even Dir.entries('share url here)` just to see if I can see anything in the folder, which generally results in
No such file or directory # dir_initialize
I can map my local computer to the Windows share point, in the form of:
smb://NAME-APP.enterprise.company.com/Files
but manually dragging and dropping to there isn't an acceptable solution in this case.
Feel like I've hit a wall and may be overlooking something. Have stumbled across this post but to no avail: How do I address a UNC path in Ruby on Windows?
Any advice on this is greatly appreciated.
Edit:
FileUtils.cp_r('/Volumes/Macintosh HD/Users/davidpardy/development/ror/sbb/oct31week/1a/FST-Export/public/1538791_new.txt', '\\\\NAME-APP\\Files')
doesn't return an error, but doesn't upload the .txt file to Files.
The solution is not to use FileUtils.cp_r(source_file, 'smb://...') because smb://... only represents the server address, not the mount folder on your filesystem.
In the terminal, run the mount command to find the path of the mount folder, which is what you'll use in ruby, e.g., FileUtils.cp_r(source_file, '/Volumes/mount_folder_here...').

Extract ZIP and move all files to parent directory

I'm only just getting started with Yeoman, trying to create a Generator that downloads WordPress, unzips it, and then proceeds to download my own WordPress starter theme.
The problem I'm having is that when I extract the latest.zip from wordpress.org (using this.extract()) it contains a wordpress/ directory resulting in my directory structure being my-project/wordpress/ rather than my-project/.
I've tried moving, copying and deleting the wordpress/ directory with various degrees of success; using this.fs.copy() I actually managed to get the files in the correct folder, but when trying to delete the original wordpress/ directory the user has to confirm deletion of every single file (not ideal). When I tried this.fs.move() I had to confirm each and every move instead.
I've found similar gulp/node.js questions on here, but I would prefer to use Yeoman's built in this.fs API.
Please note that I am aware of YEOPress but this is mostly for learnig purposes.
I ended up using the Node Package fs-extra instead as it deletes or moves without confirmation.

Edit Google spreadsheet automatically from command line

I´m trying to make a collection of scripts in php and bash that ask to bugsense for the errors in my app, make everything what I need and upload a couple of files to Google Docs so everyone in the company can see all the data up to date.
I do this because, as you know, Bugsense just gives me information of the last 30 days so I cannot store there a historical of my applications crashes.
The only problem that I´m having is how to edit a Google Spreadsheet without deleting it and uploading again. I mean, what I´m doing right now is:
google docs get $GOOGLE_DOC $GOOGLE_DOC_TSV
Now that I have the file I want to edit, I delete it from my drive because if I upload again it will not override and I will have to files with the same name:
google docs delete $GOOGLE_DOC --yes
After that I just do everything what I need with file and upload it again:
google docs upload $GOOGLE_DOC_TSV
The problem with this is that I´m having a new file everytime the script is runned so I cannot share that document because I´m deleting it everytime and uploading a new one.
The other thing that googlecl allows is to edit a file:
google docs edit $GOOGLE_DOC --format tsv --editor vim
But with this, the proccess is not automatic because you need to deal with vim. I´ve been checking everywhere about it but nothing found that solves my problem.
Finally I found how to do it looking to Python code of googlecl. What you need is to build a script that do the following:
#!/bin/bash -l
#$ -S /bin/bash
#S -N $1
export GOOGLE_DOC=$1
#!Then do whahever you need to do with the google file
This script is just taking the value of the first argument (which will be the path to the google doc that you want to edit by doing whatever with it). Then all what you need is to call to googlecl like this:
google docs edit --title GOOGLE_DOC_TITLE --format FORMAT --editor SCRIPT_WE_JUST_BUILD
GoogleCl is creating a temporary file in your system and is passing to the editor(our script) the path to that temporary file. So what we are getting is the path to the temporary file.
Whenever yoy finish googlecl will look if there is any change in that file and will upload it if YES.

Minix3 read only issue

I would just like to know is there a way you can overwrite the main.c file in the kernel folder (dir /usr/src/kernel/main.c) in MINIX 3. I want to change some code in the file (I know the risks involved) but the problem is I can't save it. I've tried logging in as bin and root and still the same issue.
Is there another way of doing this?
I think your problem lies within the fact that you may not have installed MINIX 3 and that you are running it from the ISO or CD-ROM. That is why you cannot write the file, as you cannot write to an ISO or CD-ROM.
Follow this link to install in on a hard disc or virtual drive:
MINIX 3 install guide

Resources