I am doing a lab for my class using Code Composer Studio and the Tiva Launchpad. I am using a macbook and I have downloaded PuTTy using MacPorts. Now that PuTTy is running I have to type in the serial line to communicate with CCS and the Launchpad.
It is necessary to type in the serial line for connection to work,
PuTTy Serial line
Any help or direction is very appreciated! First time posting sorry if I am unclear at any point.
Here's an easy way to find the device special file for any device.
Unplug the device and reboot your system.
Get a list of all device special files in /tmp/a
ls /dev > /tmp/a
Now plug in your device and wait a few seconds, and get a list of the device special files again, this time in /tmp/b:
ls /dev > /tmp/b
Now compare /tmp/a with /tmp/b:
opendiff /tmp/a /tmp/b # Yes, you could use "opendiff /tmp/[ab]"
Whatever is new in file /tmp/b corresponds to what you plugged in.
Related
I have been using smbclient to grab files from a windows file system to an ubuntu based computer. It was working up until a few weeks ago. It works on 2 other computers with the exact same settings. From ubuntu I do:
smbclient -A ./credentialsFile //IP/path/to/folder -c
at that point I am in the directory. I then do
mget file.txt
it responds with
get file file.txt?
I type y
it then states
failed to open \IP\path\to\folder\file.txt NT_STATUS_OBJECT_PATH_NOT_FOUND
How can it know what file I am talking about yet be unable to find it?
Is there a command for the apple terminal to brute force a wipe of everything including all partitions, master boot records, and data on a usb flash drive?
Just a little information about the situation:
I just got a stick from a friend which seems to be damaged but it isnt a physical defect. I guess he just removed the stick while formatting or so.
I already tried to repartition, reformat and erase the stick with the Mac Disc Utility and I tried to format it on windows. Nothing of it worked, so I decided to use terminal for it (im just getting used to terminal/bash, so im a complete newbie at this) and tried the commands (all with sudo and diskutil in front of them ofc) repairDisk, reformat, partitionDisk, eraseDisk or zeroDisk, but nothing worked. Im getting this error message now: Error: -69759: Securely erasing data to prevent recovery failed
Underlying error: 5: POSIX reports: Input/output error
So my final thought is now that I have to clean everything from this drive as it seems there is something broken on a very low level and i would assume that completely wiping it will result in my diskutil to install a complete new partition scheme and everything on the drive so it will eventually start working again..
Thank you all in advance!
Screenshots:
Try this in Terminal if you are CERTAIN it is disk3:
sudo dd if=/dev/zero of=/dev/rdisk3 bs=65536 count=1000
If it says the disk is busy, make it un-busy!
sudo diskutil unmountDisk /dev/disk3
First, check what disk# your usb is (to be certain) in a terminal:
sudo diskUtil list
then
sudo dd if=/dev/urandom of=/dev/<your_usb_disk_here> bs=1m
If you get busy error and/or if the usb is in use elsewhere, stop what you are doing there and unmount it first as Mark Setchell said
sudo diskutil unmountDisk /dev/<your_usb_disk_here>
If you get a funky name from using bootcamp assistant or something, and you cannot get dd or even Disk Utility to wipe it for some reason, like "permission" problem, use:
diskutil eraseVolume HFS+ NAME <your_usb_disk_here>
Note that the last arg is not e.g. /dev/disk2 , but just the last part, disk2
I have a need to duplicate about 10 USB thumb drives a day from a Dropbox folder that changes slightly each day (about 10GB of data). I considered the $300 "Aleratec 1:10 USB 3.0 Copy Cruiser" but upon study, realized it's no more than a USB 3.0 hub and some basic copying software. I can do this with my own USB 3.0 hub and Terminal in OS X! (Windows 10 is also available if there's an easier way.)
Question: Since the bus is faster than my drives, is there a way I can execute this command to write to all the drives simultaneously? Or any other creative suggestions appreciated. Thanks.
You can format them in parallel quite easily, if you make a little script. Say your drives have the word USB in their names, you could write something like this:
#!/bin/bash
# Don't barf if no drives mounted, or if USB is lowercase
shopt -s nullglob
shopt -s nocaseglob
# Iterate through all mounted USB drives
for drive in /Volumes/*USB* ; do
# rsync source to USB drive in background
echo rsync <options> <YOURSOURCE> "$drive" &
done
# wait for all parallel rsyncs to finish
wait
You would save that on your Desktop, as DuplicateUSB and then you make it executable like this in Terminal:
chmod +x "$HOME/Desktop/DuplicateUSB"
Then you can run it by double-clicking it, or going in Terminal and typing:
$HOME/Desktop/DuplicateUSB
At the moment, it only echoes what it would do, but doesn't actually do anything. When it looks to be correct, and you are happy with what it is doing, you can remove the word echo from the line with rsync in it so it actually does the rsync.
So I want to make a udev rule which does, when I connect my usb key to my computer the rule mounts my usb key, takes a file from my computer, copies it to my usb key and then unmounts my usb.
So I did my udev rule like that:
ACTION=="add" SUBSYSTEM=="BLOCK", ENV{ID_VENDOR_ID}=="0718", ENV{ID_MODEL_ID}=="0618", ENV{ID_SERIAL_SHORT}=="CB00524932077759", RUN+="/bin/mount /dev/sda1 /media/usb"
ACTION=="add" SUBSYSTEM=="BLOCK", ENV{ID_VENDOR_ID}=="0718", ENV{ID_MODEL_ID}=="0618", ENV{ID_SERIAL_SHORT}=="CB00524932077759", RUN+="/bin/ScriptCopy"
And I wrote a script, in /bin, called ScriptCopy:
#!/bin/sh
cp /root/average.db /media/usb/database/average.db
ldconfig
echo "Done!"
exit 0
So the first part of my udev rule works, it mounts the usb key, but then my script does not work, I do not really understand why. Can someone explain it to me? Thx
edit 1:
when I am running my script in the terminal, doing
./ScriptCopy
it works! so I must have a problem in my udev rule.
edit 2:
I found out something really strange (at least, that I don't understand at all), my rule works if I am plugging my USB key while I am on the GUI (XFCE) on my banana pi. But I am working with ssh, so normaly I don't open the GUI. I want to do is, to run some commands with the ssh, trigger my python script and then I take the data with my usb key once every two days. But when I plug my usb while banana pi is not on the GUI (while I triggered my script from another computer using ssh), it does not transfert the data to my usb key. I don't know if it was understandable.
Edit 3:
Ok I had an error of path in my UDEV rule because on ssh, I was not in the same user. I am closing the topic.
I found that I had an error of path in my script/udev rule.
I know that , we can copy files from host to another from mac using finder/smb protocol.
But I would like to copy files from mac to windows machine using command line. so that, I can call the same pro-grammatically.
Could anyone please guide?
If you can copy the files using the Finder then you have connected to the SMB share. Usually, you can see this from the command line by looking in the /Volumes folder; if it doesn't look like it's there, try running the mount command to see other places things might be connected. The following assumes the SMB is mounted in /Volumes, adjust as necessary for your particular case.
On the command line, issue the command:
ls /Volumes
You should see the SMB share listed along with some other names.
Then to copy files to it:
cp myfiles/* /Volumes/MySMBShare/mydirectory
If the name of the share has spaces in it you will need to escape them with backslashes like so:
cp myfiles/* /Volumes/My\ SMB\ Share/mydirectory