• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

The "Linux questions (and other stuff)" thread

Ctrl-C maybe?

... works if I have a terminal open, but the point of this exercise is to not open a terminal manually.




Now that I have an internet connection, I can do a little research.

How about this:

Code:
#!/bin/bash
# call tethering software
keylink
# identify Process ID
declare -i PID=$!
# call Firefox instance (Tether is the profile name)
firefox -no-remote -P Tether 
# once firefox terminates, kill the saved process
ps -p ${PID} | fgrep keylink && kill ${PID}
 
Upvote 0
Thanks. I thought the Firefox part would not be a problem, but what about terminating the klink and exiting the script?
Oops. I didn't even notice klink; just looked it up and see that it's an Android app for tethering without root. My phone allows me to do that anyway, so I've never looked for an app. (Not that it matters--since I get *ZERO BARS* at my house. :mad:)

How do you normally terminate klink? If you're doing everything manually at a prompt, what's its sequence?
 
Upvote 0
I hear that I get two bars at home, one or none at work-- I work in one of the many low-reception areas in town, which Sprint has decided need not get any upgrades in service, and the steel building I work in certainly doesn't help matters much.

But if I place the phone in just the right place (and plug it into the charger), I can get enough reception to move a tiny bit of data.

Anyway, klink is just a call-- right now, I open a terminal, invoke klink, and go running. When I am done, I ctrl-C and close the terminal.
 
Upvote 0
...
How about this:

Code:
#!/bin/bash
# call tethering software
keylink
# identify Process ID
declare -i PID=$!
# call Firefox instance (Tether is the profile name)
firefox -no-remote -P Tether 
# once firefox terminates, kill the saved process
ps -p ${PID} | fgrep keylink && kill ${PID}

I don't know.

If it doesn't work and provided you have no instances of keylink that you want to keep alive, you could try killall keylink.
 
Upvote 0
Okay, with a little research, some trial, a touch of error; this is the script I am running now:

Code:
#!/bin/bash
# call tethering software
klink &
# identify Process ID
declare -i PID=$!
# call Firefox instance
firefox -no-remote -P Tether
# once Firefox terminates, kill the saved process
ps -p ${PID}|fgrep klink && kill ${PID}
 
  • Like
Reactions: MoodyBlues
Upvote 0
Okay, with a little research, some trial, a touch of error; this is the script I am running now:

Code:
#!/bin/bash
# call tethering software
klink &
# identify Process ID
declare -i PID=$!
# call Firefox instance
firefox -no-remote -P Tether
# once Firefox terminates, kill the saved process
ps -p ${PID}|fgrep klink && kill ${PID}
Looks good, and thanks for posting it.

I was going to play with it here, but klink showed that it's incompatible with all my devices. :thinking: :mad:
 
Upvote 0
I hear that I get two bars at home, one or none at work-- I work in one of the many low-reception areas in town, which Sprint has decided need not get any upgrades in service, and the steel building I work in certainly doesn't help matters much.
AT&T says that I should have *GREAT* reception here at my house. But I don't! And their ads annoy me. :mad:

But if I place the phone in just the right place (and plug it into the charger), I can get enough reception to move a tiny bit of data.
Reminds me of the Bundys and what they had to do in order to watch Fox. :laugh: :rofl: (Anyone not a Married...with Children fan, never mind. :D)
 
Upvote 0
Looks good, and thanks for posting it.

I was going to play with it here, but klink showed that it's incompatible with all my devices. :thinking: :mad:

That sucks... then again, it took me a while to find something that did work with my phone.

By the way... I launch the script (got to make it executable, of course) by using a desktop launcher with ./tether (the script name), which eliminates the whole 'ask before launching scripts' dialog problem.

Got to start klink on the phone first, and Firefox can actually come up before klink establishes the connection, but those are minor details.
 
Upvote 0
Okay, with a little research, some trial, a touch of error; this is the script I am running now:

Code:
#!/bin/bash
# call tethering software
klink &
# identify Process ID
declare -i PID=$!
# call Firefox instance
firefox -no-remote -P Tether
# once Firefox terminates, kill the saved process
ps -p ${PID}|fgrep klink && kill ${PID}

Glad its working.

I had a "fun" with an init scripts for my Raspberry Pi and in the end resorted to killall to terminate the program. The XPL Hub I'm using starts a couple of new processes and then exits so the pid you grab is for a process that has already closed.
 
Upvote 0
Any Dropbox users here? I just started an account and I'm wondering about a few things.

I set up its directory in $HOME, i.e., ~/Dropbox. From the [admittedly extremely little] reading I did, it seems that you're supposed to place directories *IN* your DB directory in order to have them sync. In their terminology, you 'drag and drop your files here.' But when I tried that--using DB's interface--it MOVED the files and/or directories. Um...that's neither desirable nor workable for me.

So my first question is, is that correct? Is that the idea? For example, let's say I have a ~/whatever subdirectory, is it now supposed to be ~/Dropbox/whatever? Or my /data/mail/[account1], /data/mail/[account2], etc., directories...are they supposed to be moved into the DB directory? ~/Dropbox/mail/[account1], ~/Dropbox/mail/[account2], etc.? That won't work.

So my next choice seems to be copying files/directories into the DB directory. But I don't want double the space taken up for each item.

Okay, so since it's *nix, how about symbolic links? I can link things there, and that seems okay, but I'm just not sure...about any of it right now. (And let me add my normal [recent] disclaimer: I'm doing this on virtually no sleep. My brain hurts from straining so hard just to remember what day it is. If anyone knows, kindly clue me in. :))
 
Upvote 0
I'm not sure if I asked this once before, the thread has gotten big and I can't seem to find it.

Using Mageia 3, KDE 4.10, when I plug my Nikon S3300 camera into the USB 2.0 port, the device notifier picks it up but Dolphin doesn't. Digikam picks it up also, but Gwenview doesn't.

Any idea why it's not being picked up by Dolphin?

Thnx.

I'd guess the device needs to be mounted before you can use browse it with Dolphin.

With my OpenSuse 12.3/KDE 10.5, my Pentax K-50 is detected by Device Notifier as a Storage Volume. The notifier offers me 3 options: Open with FileManager (which is Dolphin), Download photos with Digicam and Download photos with GwenView. I just choose from there.

Actions can be edited and added to notifier via System Settings/Hardware/Device Actions. The command it is using on my system to open Dolphin is kioclient exec %25f.
 
Upvote 0
Any Dropbox users here? I just started an account and I'm wondering about a few things.

I set up its directory in $HOME, i.e., ~/Dropbox. From the [admittedly extremely little] reading I did, it seems that you're supposed to place directories *IN* your DB directory in order to have them sync. In their terminology, you 'drag and drop your files here.' But when I tried that--using DB's interface--it MOVED the files and/or directories. Um...that's neither desirable nor workable for me.

So my first question is, is that correct? Is that the idea? For example, let's say I have a ~/whatever subdirectory, is it now supposed to be ~/Dropbox/whatever? Or my /data/mail/[account1], /data/mail/[account2], etc., directories...are they supposed to be moved into the DB directory? ~/Dropbox/mail/[account1], ~/Dropbox/mail/[account2], etc.? That won't work.

So my next choice seems to be copying files/directories into the DB directory. But I don't want double the space taken up for each item.

Okay, so since it's *nix, how about symbolic links? I can link things there, and that seems okay, but I'm just not sure...about any of it right now. (And let me add my normal [recent] disclaimer: I'm doing this on virtually no sleep. My brain hurts from straining so hard just to remember what day it is. If anyone knows, kindly clue me in. :))

Dropbox ought to behave like a USB stick - if files were moved rather than copied then it would seem your ~/Dropbox is just a local directory, not actually your Dropbox.

You don't link things there - it's a separate cloud service specifically for copying.

Did you - https://www.dropbox.com/install?os=lnx

Make sure that the Dropbox daemon is running.

Confirm actions using the web interface to help debug.
 
Upvote 0
Dropbox ought to behave like a USB stick - if files were moved rather than copied then it would seem your ~/Dropbox is just a local directory, not actually your Dropbox.
When I use DB's interface (and do the drag and drop thing), there is no 'copy' choice; it moves whatever I'm dragging/dropping. But, immediately checking my account via web browser, the files are there. (As in really there--I've verified that by downloading some from another computer or phone.)

You don't link things there - it's a separate cloud service specifically for copying.
But 'make link' is one of the options within its interface (right-clicking on an item brings it up). And when I 'make link' and then drop the link into the DB directory, and then check online, the files are there. THERE there. (As above, I tested by downloading on a different device.)

Yes.

Make sure that the Dropbox daemon is running.
Yes, it definitely is. I'm looking at its cool little icon right now. :)

Confirm actions using the web interface to help debug.
That's what I've been doing, but for some reason I just have doubts. :thinking:
 
Upvote 0
Using Mageia 3, KDE 4.10, when I plug my Nikon S3300 camera into the USB 2.0 port, the device notifier picks it up but Dolphin doesn't. Digikam picks it up also, but Gwenview doesn't.

Any idea why it's not being picked up by Dolphin?
Did it ever work? Or has it always been like this? It sounds like Dolphin and Gwenview aren't associated with it as options.

Do you have a card reader? If so, what happens if you put the camera's card in the computer?

FWIW, I never actually use the cables that came with my Nikons, but both the D40 and D5100 yield the expected three choices when I put their cards in a computer.
 
Upvote 0
I'm not sure I understand the problem, Moody... the magic behind the scenes is doing what it is supposed to be doing, right?

No, drag and drop to Dropbox on other platforms, and what you expect from a cloud disk, is to copy.

She's reporting a move - copy then delete source.

Unless I'm reading that wrong.
 
  • Like
Reactions: MoodyBlues
Upvote 0
I'm not sure I understand the problem, Moody... the magic behind the scenes is doing what it is supposed to be doing, right?
Yes and no.

If you go back and look at what I posted originally, you'll see that my choices seem to be moving directories into my DB directory, which is not workable for me, or copying things into my DB directory, which is not acceptable because that means double the [local] disk space, or linking things. All of these leave me wondering if this is how it's actually supposed to work. :thinking:

But, yes, if they're in my DB directory, they are being synced with my online DB account.
 
Upvote 0
Yes and no.

If you go back and look at what I posted originally, you'll see that my choices seem to be moving directories into my DB directory, which is not workable for me, or copying things into my DB directory, which is not acceptable because that means double the [local] disk space, or linking things. All of these leave me wondering if this is how it's actually supposed to work. :thinking:

But, yes, if they're in my DB directory, they are being synced with my online DB account.

OK, now I'm confused - or, unconfused.

It sounds like it IS working correctly as described.
 
Upvote 0
No, drag and drop to Dropbox on other platforms, and what you expect from a cloud disk, is to copy.

She's reporting a move - copy then delete source.

Unless I'm reading that wrong.
No, you're correct. It's definitely a move.

It threw me because of Dolphin's behavior. With Dolphin, if you drag a file/directory to another location, it'll prompt with four choices: move, copy, link, cancel. So when I plunged in with DB's GUI, and dragged/dropped a directory into it, I was shocked that it [silently and without choice] MOVED the sucker. :eek:
 
Upvote 0
Yeah, the daemon wants to sync with a known location. So a move there prevents duplication.
But, see, this is [part of] what's bothering me. I have all my directories and subdirectories mapped out the way I want them. And I don't want them relocated to ~/Dropbox.

Do you have Dropbox mounted? As in /mnt/Dropbox?
No. Should I?! In the very little reading I did, I don't recall seeing any mention of that. The only things I have mounted in /mnt are my other computers' hard drives.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones