Copy Android MTP files using linux terminal or python; error Operation not supported
location:
linuxexchange.com - date:
January 1, 1970
i'm trying to create my own python script to backup Android images.i can see the Android mounted well, and i can move files back and forth using nautilus but not from CLI
the CLI error is "Operation not supported"
[email protected]:/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Phone/Download$ cp DSC03951.JPG /home/hkhrais/Desktop/
cp: cannot open ‘DSC03951.JPG’ for reading: Operation not supported
python code
try:
shutil.copyfile('/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Phone/Download/DSC03951.JPG', "/home/hkhrais/Desktop/test")
except:
raise
Traceback (most recent call last):
File "scriptt.py", line 33, in <module>
main()
File "scriptt.py", line 18, in main
shutil.copyfile(img, "/home/hkhrais/Desktop/test")
File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 95] Operation not supported: '/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Phone/Download/DSC03951.JPG'
How to loop through the list of .tar.gz files using linux command in python
location: linuxexchange.com - date: January 1, 1970
Using python 2.7
I have a list of *.tat.gz files on a linux box. Using python, I want to loop through the files and extract those files in a different location, under their respective folders.
For example: if my file name is ~/TargetData/zip/1440198002317590001.tar.gz
then I want to untar and ungzip this file in a different location under its
respective folder name i.e. ~/TargetData/unzip/1440198002317590001.
I have written some code but I am not able to loop through the files. In a command line I am able to untar using $ tar -czf 1440198002317590001.tar.gz 1440198002317590001 command. But I want to be able to loop through the .tar.gz files. The code is mentioned below. Here, I’m not able to loop just the files Or print only the files. Can you please help?
import os
inF = []
inF = str(os.system('ls ~/TargetData/zip/*.tar.gz'))
#print(inF)
if inF is not None:
for files in inF[:-1]:
print files
"""
os.system('tar -czf files /u
Monitor linux server and/or log files using the terminal [closed]
location: linuxexchange.com - date: January 1, 1970
Sometime ago when I was first configuring a linux server with Rails I found a nice linux monitor from the terminal. It had percentages and text-based bars showing up. It had a nice text-graphics interface. But I thought: "I will come back to it once I finish the app". So now I finished the app and can't remember in what server I installed it and what tool it was.
Is there a nice linux server monitor open source software that displays live data through the terminal? With colors and bars?
Converting WAV Files to High Quality MP3 Using Linux terminal
location: linuxexchange.com - date: July 6, 2012
I converted some WAV files using LAME on Linux terminal but the quality of the sound of the resulting MP3 files is very poor, as compared to initial wav files. The results did not improve even after increasing LAME output quality to higher value.
I am looking for conversion mechanisms with following requirements
Should be able to run from Linux terminal
Quality of output MP3 files should be as good as input WAV file, if not better.
Any help or suggestions on other possible methods is welcome.
check if a file is in a folder or its subfolder using linux terminal
location: linuxexchange.com - date: March 3, 2014
I want to check if the particular file is in a folder or its sub folder or not using Linux terminal.
Which should I use for this? I use find and grep command but it travels only one folder.
How can I combine lines from two files using sed, awk, or other linux commands
location: linuxexchange.com - date: January 1, 1970
I have two files:
file1.txt
apple
orange
banana
file2.txt
red
white
blue
What I would like to end up with is this:
file3.txt
apple
red
orange
white
banana
blue
Any help would be greatly appreciated!
Anyone here set up thin clients using Linux Terminal Server Project?
location: ubuntuforums.com - date: February 27, 2012
Hey all,
I live iin Central Asia and am helping out a local reform school for orphans and delinquent youth. I'm working on getting a computer education program started at the school for the 2012-2013 academic year.
Right now they have a few really old computers (Win2K era) and I'm working to scrounge up more computers for them. Because of (1) old hardware, (2) lack of software licenses, (3) lack of money to acquire software licenses, and (4) a general love of Linux I'm considering setting up the old computers as LTSP thin clients.
According, I have quite a few questions:
Has anyone here deployed LTSP in an educational environment?
If so, what were some difficulties you faced?
What sort of hardware would you recommend for a server that has approximately 20 clients (I imagine disk I/O becomes an issue as you scale up the number of clients/server)?
Any educational software / curricula you recommend?
Do you have other helpful tips before I start planning this out?
If any of you wa
Possible To Install Android On Computer, using Linux/ Without The Aid Of Windows?
location: linuxquestions.com - date: March 9, 2014
I am curious to find out how useful Android would be for turning my Sony Vaio dual core laptop into a user friendly internet portal for light entertainment and basic tasks, such as diary keeping and list making. I like how simple Android makes installing and running apps on tablet and smartphone devices, without any difficulties or requiring special knowledge. How easy is this to achieve through Linux, without having Windows installed?
Thanks in advance.
Executing .exe files in Linux terminal
location: linuxquestions.com - date: September 5, 2013
Can anyone explain how to run a .exe file using the terminal in linux?
thanks in advance
Search text string in multiple PDF files using the terminal?
location: ubuntuforums.com - date: March 5, 2011
I have multiple PDF file in a series of folder, mostly scientific articles. In the past, under Windows, I used Google Desktop to search for an specific text string on those documents. Now, I managed to look search an specific text string in all PDF documents under a certain folder using a combination of grep and pdftotext (the later included with the package poppler-tools)
If I type under a certain folder:
Code:
find . -name '*.pdf' | xargs -ifoo sh -c 'echo "\033[34;1m// === PDF Document:\033[33;1m $foo\033[0m" ; pdftotext -enc Latin1 "foo" - | grep -i --color=always "String.To.Find"'
It will convert all the pdf files to text (handling the ligatures created by LaTeX with the -enc Latin1 option), and will search for the "String.To.Find" in these documents, without paying attention to the character cases, printing the output into the console with nice colors. The points to separate words are the only way I found to handle spaces.
However
please wait...
Page: 1 2 3 4 5 6 7 8 9 10