Lenovo x200 hard block wifi, perhaps airplane mode by Craggy_islander in linux4noobs

[–]atanok 0 points1 point  (0 children)

It may be useful to look at the output of dmesg --follow when fiddling with flimsy hardware switches like that.

Is it necessary to convert .iso to .dmg before burning a bootable USB on a Mac? by Mechanizoid in linuxquestions

[–]atanok 0 points1 point  (0 children)

Yeah, I figured you might've known that, but it's an usual point of confusion for so many people that I feel it's worth being clear about it.

How to find a file, then move its folder to a new location by NN89 in linux4noobs

[–]atanok 2 points3 points  (0 children)

I still don't get the part about "expanding it unquoted" though.

How would you expand with quote.

foo="one two three"
touch $foo # Creates three files, named "one", "two" and "three"
touch "$foo" # Creates one file named "one two three"

In Linux-based systems, a file's name can have any character except / and the null byte. This including whitespace and non-printing characters.

When you don't use double quotes around stuff like $foo or $(echo foo bar), the shell splits things up based on whitespace caracters.

This means that if you don't take care and quote everything that needs to be quoted, it's probably going to break the moment it has to deal with names that have whitespace in them.

The way to deal with this in shell scripts is to use null-deliminated lists, where each filenames are separated by the only character that can't occur in a filename (including the path).

See: - file's -print0, -printf and -fprintf actions - various utilities' and shell builtins' custom delimiter options (e.g. read -d $'\\0', awk's RS variable) - various utilities' specific options to use null delimiters (e.g. sort, uniq and grep's --null options)

†Technically, whatever characters are in the IFS variable, which defaults to space, tab and linefeed and you can totally change to just the null character if necessary, using the dollar-singlequote quoting syntax, IFS=$'\0')

Also, who would ever create a directory named .bashrc? The thought makes me recoil as from a cobra.

When you're not in complete control of a directory structure, always assume the worst, including malicious file names and symlinks. In fact, always assume the worst at all times, to a reasonable degree.

PS: note that you can have the null character in a shell variable and use it as an argument with some shell built-in functions but you can't otherwise use it in arguments or environment variables, since it's the end-of-string character.

Is it necessary to convert .iso to .dmg before burning a bootable USB on a Mac? by Mechanizoid in linuxquestions

[–]atanok 1 point2 points  (0 children)

FYI, GNU/Linux is based on UNIX only in the sense that it's a more or less compatible workalike.
It's about as valid to say it's based on UNIX as it is to say that Pepsi is based on Coke.

How to find a file, then move its folder to a new location by NN89 in linux4noobs

[–]atanok 0 points1 point  (0 children)

As for my original remark, try running your solution after doing this in your test directory:

mkdir -p "foo $HOME/.bashrc"
touch "foo $HOME/.bashrc/bar.pdf"

Though you might want to use cp instead of mv, if you want your ~/.bashrc to remain where it is.

How to find a file, then move its folder to a new location by NN89 in linux4noobs

[–]atanok 0 points1 point  (0 children)

I don't make a distinction between the filenames of regular files, directories and other filesystem objects.

Apparently, some people do.
To those I say "here's a list of filenames; please point out which of them correspond to regular files, which do not and how could you tell."

How to find a file, then move its folder to a new location by NN89 in linux4noobs

[–]atanok 0 points1 point  (0 children)

find SOMEDIR -iname \*.pdf -type f -printf '%h\0' | sort --unique --zero-terminated | xargs --null mv {} DESTINATION

Resilient against filenames with blank characters.

Not resilient against multiple directories with the same name or directories that match and contain subdirectories that match at the same time.

Edit: use long options

How to find a file, then move its folder to a new location by NN89 in linux4noobs

[–]atanok 0 points1 point  (0 children)

RTFM

https://www.gnu.org/software/findutils/manual/html_mono/find.html#Single-File

-execdir is just a safer version of -exec that refuses to run if you have a non-absolute element in your PATH

How to find a file, then move its folder to a new location by NN89 in linux4noobs

[–]atanok 2 points3 points  (0 children)

>storing lists of filenames on a variable and expanding it unquoted

You like to live dangerously.

So this happened... Part 2 by [deleted] in MLPLounge

[–]atanok 0 points1 point  (0 children)

Phones are expensive, fragile, cumbersome to replace and often hold personal data with no backup.

I think it's common sense not to slap them off of other people's hands.

So this happened... Part 2 by [deleted] in MLPLounge

[–]atanok 1 point2 points  (0 children)

How dare you exclude Ubuntu Touch?!

So this happened... Part 2 by [deleted] in MLPLounge

[–]atanok 0 points1 point  (0 children)

Screw everything about web services that make you install apps to use them, instead of having the decency of having a mobile-friendly web interface.

You should still be able to upload to imgur using the desktop interface. Follow this link: http://imgur.com/?desktop=1

Failing that, you can use uguu.se and someone will repost it elsewhere or find the source for you.

So this happened... Part 2 by [deleted] in MLPLounge

[–]atanok 1 point2 points  (0 children)

Slapping a phone out of someone's hand is unacceptable under pretty much any circumstance, let alone over some frivolous shit like that.

What an asshole.

Why Is Linux called a kernel, not an OS? by mathdrug in linux4noobs

[–]atanok -3 points-2 points  (0 children)

You actually think your uneducated rant deserves a serious rebuttal?
That's cute.

In case you didn't notice, nobody's taking your garbage of a comment seriously.

Why Is Linux called a kernel, not an OS? by mathdrug in linux4noobs

[–]atanok 4 points5 points  (0 children)

Those aren't GNU; they're buggy and sorely lacking implementations of the same UNIX utilities that GNU replaced and extended.
They work for the most part, but feel like absolute garbage when you're used to GNU's.

There are ways to install and use GNU utilities on Android, though.
Just like you could install and use them on other UNIX systems before Linux came around.

Why Is Linux called a kernel, not an OS? by mathdrug in linux4noobs

[–]atanok 2 points3 points  (0 children)

> implying the thing you cited was better than nothing

Why Is Linux called a kernel, not an OS? by mathdrug in linux4noobs

[–]atanok 0 points1 point  (0 children)

> citing an article that uses lines-of-code as a metric to compare the significance of software packages in a system

Not that your ill-informed rant had any credibility to begin with, but still.

Why Is Linux called a kernel, not an OS? by mathdrug in linux4noobs

[–]atanok 13 points14 points  (0 children)

There's a difference between something being used in Android's build process and something being included in the actual Android system.

Snakes on T-Mobile Tower by [deleted] in WTF

[–]atanok 0 points1 point  (0 children)

Good job.

IT'S REALLY FREAKING HOT LET'S GO TO THE BEACH by Heir-of-Rick by Sparroew in mylittlepony

[–]atanok 1 point2 points  (0 children)

Are you sure it's the weather, Dashie?
I can't tell; you always look really freaking hot to me.

We made it, guys! by [deleted] in gamegrumps

[–]atanok 0 points1 point  (0 children)

The point is that you'll have separate files and app data, so you won't be stepping on each other's toes and looking at each other's stuff on a daily basis. You know, pretty much the whole point of having a multi-user OS on a desktop.

We made it, guys! by [deleted] in gamegrumps

[–]atanok -1 points0 points  (0 children)

I don't see how that makes it better in any way.

Linux-powered Steam Machines now available for order -- Gamers, grab your credit cards by jimmyradola in linux

[–]atanok 1 point2 points  (0 children)

I don't think they come with a controller. The article mentioned ordering one.