« first day (2426 days earlier)      last day (2532 days later) » 

SBM
1:17 PM
Genome :)
 
?
 
1:43 PM
@SBM Who are you calling a genome!? ;-)
 
@SBM Mitochondria.
 
I used to work at the "Genome Campus". The e was on a couple of occasions peeled off from the sign :-)
 
SBM
Oh GNOME, I guess you know more about that than me.
 
2:02 PM
@SBM I know nothing about gnomes, only that you need to treat them kindly. And both @FaheemMitha and @terdon are more genomic than I am.
 
SBM
Sorry
 
2:16 PM
I'm just bad at cheap puns... :-)
 
m59
Anybody installed alpine-extended?
According to stuff I'm reading, I expected sudo to be installed in the setup, but it isn't. I'm supposing I'm missing something.
oh nm. I think I read something else and thought it was related to alpine-extended
It's extended, but not that extended :)
 
heh
 
m59
If anyone has a link to a guide to go from a fresh, minimal linux install (any flavor) to a desktop environment like Ubuntu, I'd appreciate it a bunch
I use Ubuntu as my dev machine and usually alpine on docker for my applications
I'm messing around with replacing my ubuntu with alpine with a desktop and hyper terminal
but I've never gone this low level before
well, outside of the specific things I do with docker
 
@m59 Never heard of it.
 
2:41 PM
@m59 What is alpine-extended?
 
m59
just alpine with a little extra stuff to start with
 
@m59 That's alpine the MUA, or Alpine the distribution?
 
@m59 Ah, the latter.
@m59 I don't follow. If you want to install Ubuntu, what's stopping you?
And what does a "fresh, minimal linux install" have to do with it?
 
m59
Not really connected. Here's my situation. I use windows for non-dev stuff. For development, I'm on Ubuntu running through VirtualBox from my Windows machine. My interests there are: simply linux environment and gnome terminal. Hyper terminal is super sweet and cross platform, so I'm moving to that. So, most of Ubuntu is not useful to me. Alpine being extremely light seems like the ideal distro to setup just enough of a desktop to install hyper terminal and I'm set. I like minimal.
Rather than a big Ubuntu install, I'm thinking of scripting an alpine setup with a desktop and hyper terminal that I could install/reinstall quickly
But primarily this is just for fun and learning
If it works as a replacement for my Ubuntu dev machine, even better
 
2:53 PM
Any particular reason not to start with something like Arch which is made for this sort of thing? I mean made to be very minimal by default and then you can add what you want to it.
And do I understand you correctly that you want to have something "minimal" and then install an entire GUI stack on it in order to use a terminal?
 
@m59 If most of Ubuntu isn't useful to you, don't install it.
 
That seems like wanting to buy a bicicle since it's easy to carry around and then trying to add a 500kg car motor onto it.
 
But I don't know if Ubuntu forces you to install a lot of stuff, because I don't use it.
Debian definitely doesn't. So try that instead.
 
@FaheemMitha That's not an easy thing to do with Debian-based distros in general and even harder with Ubuntu. The main system is relatively bloated. Even for the server edition.
@FaheemMitha The hell it doesn't!
 
I think a minimal Debian install, even now, is just a few hundred MB. Which by historical standards is pretty bloated, but far better than the norm.
 
2:55 PM
Ah, the minimal minimal maybe.
 
@terdon It didn't the last time I tried it. Which I admit has been a while.
 
m59
I don't know much about Arch, or Alpine for that matter :)
 
But everything considered, it's unlikely to have changed.
 
m59
I'll do some research, thanks
 
Debian is nothing but not conservative.
And a lot of DDs like minimal installs, for one reason or another.
 
2:57 PM
@m59 The benefit of Arch here is that the initial system is truly minimal. You then add to it and the Arch Wiki is an excellent (as in probably the best in the Linux world) collection of docs for adding what you need onto this minimal system
 
@m59 In the install, just uncheck everything in sight. You'll still get stuff like bash and coreutils and so forth, but it's pretty pared down.
 
m59
What's lost with Alpine in comparison to Arch? Just the nice wiki?
 
I'm talking about Debian, obviously.
Is Alpine a Debian derivative?
 
@m59 I don't know the first thing about Alpine. I recommended Arch because it is so very very minimal by default and anything extra you need to add yourself.
 
m59
"unchecking" things doesn't fit with my philosophy
 
2:59 PM
Wikipedia is not that clear, but probably not.
@m59 What?
 
But @FaheemMitha is also right, if you deselect the defaults on Debian you'll also get a small system. But yeah, you need to go and deselect and figure out whether you actually wanted something etc.
 
@terdon My impression is that it also requires a certain degree of sophistication.
 
m59
I generally try avoiding anything I can't write a script for
 
@terdon It's safe to uncheck stuff in the installer.
You can always add it later.
 
Ah. Actually, don't use Alpine. It doesn't use the GNU toolset by default which means that what you learn when learning the basic tools will be a very limited subset of what the tools can do.
@m59 Then you really want something like Arch.
Seriously though, if you want to learn the Linux toolset, Alpine is a horrible choice since it doesn't actually have the "Linux toolset" (the GNU tools, don't tell Stallman I called them that) and instead has the very minimal busybox equivalents. Those are what you find on embedded systems, for example.
 
3:01 PM
Alpine looks pretty small. It probably beats the mainstream distributions handily by that metric.
 
Yep. But busybox:
> Alpine Linux is built around musl libc and busybox. This makes it smaller and more resource efficient than traditional GNU/Linux distributions. A container requires no more than 8 MB and a minimal installation to disk requires around 130 MB of storage. Not only do you get a fully-fledged Linux environment but a large selection of packages from the repository.
 
> Size: the base system in Alpine Linux is designed to be only 4–5 MB in size (excluding the kernel).
Hmm. In the 21st century this smacks a bit of overkill, though.
 
m59
You're pretty over my head in these terms. From my experience... are you talking about how, for example, if I try to create / change users, the command arguments are either missing or have a different API?
 
@terdon Yes, I read the WP page too.
 
m59
and etc things like that
If not, I have no idea what you meant by all that :)
 
3:03 PM
@m59 Yes, terdon's point is that the userland is pretty pared down.
 
@m59 More like the basic tools you would use for everyday use. But yes, basically the command line options will be completely different in some cases.
 
m59
I didn't mind that so much, but yeah not great
 
And that really doesn't have much of an advantage, especially if you are trying to learn stuff.
 
m59
For docker, I have to get a little lower level and actually write the files my self
 
Maybe it's fine for an expert with specific needs.
 
3:04 PM
Much of the power of the *nix operating systems comes from the large collection of standard tools they have for doing things like file parsing, file manipulation, filesystem searching etc etc. On GNU/Linux systems (normal Linux), these are the "GNU" versions which are extended in some very useful ways.
 
@m59 Most mainstream distribution have a standard set of software which they ship. So you might as well use that.
 
The busybox it mentions is a swiss army knife that offers many tools in one. However, this means that each tool is a simplified, hobbled version.
 
There's no particular advantage to throwing most of that away.
 
m59
RUN \
  echo "user:x:${uid}:${uid}::/home/user:" >> /etc/passwd && \
  echo "user:x:${uid}:" >> /etc/group && \
  echo "user:!:::::::" >> /etc/shadow && \
  echo "user:!::" >> /etc/gshadow && \
  mkdir /home/user && \
  chown -R user /home/user
 
So if you want to be learning Linux (as opposed to UNIX), I would recommend using a distribution that has the GNU tools.
 
m59
3:05 PM
I had to do that stuff for alpine ^
 
@m59 Um. OK, don't do that.
 
Not the most useful way of spending the time, imo.
 
m59
?
 
There are tools for this and I'm sure even alpine should have them.
 
m59
I don't think there's another way with alpine
Close, but no
 
3:06 PM
Unless you really want to learn things on a low level. The LFS way.
 
And what kind of weird script is that? With "RUN" and the escaped line endings?
 
m59
It's docker
 
Huh.
 
I'm wondering what the number of packages in stretch is, but Google is failing me.
Where's @derobert when we need him? :-)
 
@m59 so you don't have anything like useradd on Alpine?
 
m59
3:08 PM
I may remember enough. At minimum, the problem was API compatibility. I didn't want to be tied to a certain distro. That is cross-platform.
 
@m59 Not if you use echo :P
 
m59
And there might have been a certain option that alpine useradd doesn't support
hahah, oh yeah. I learned that now :)
But that was 2 months ago
 
398
Q: Why is printf better than echo?

amphibientI have heard that printf is better than echo. I can recall only one instance from my experience where I had to use printf because echo didn't work for feeding some text into some program on RHEL 5.8 but printf did. But apparently, there are other differences, and I would like to inquire what the...

 
m59
Yeah, and I learned it from that exact post :)
 
As did we all :)
 
3:10 PM
When we gzip ascii text file(a.c) into a.gz and call a.gz as binary file and a.c(C program) as text file, does that mean, both have same encoding(with ascii characters), but former is non-readable and latter is readable?
 
The release of stretch is imminent, apparently.
 
@overexchange No. ASCII != Binary.
 
collection of 8 binary bits can be an ascii character
 
Ok, stretch is listed as 52k on the WP Debian releases page. Can someone remind me - is that source or binary?
 
Anyway, @m59 if you want to learn Linux, I strongly urge you to go with just about anything other than Alpine. If your masochistic, DIY streak is so wide (:P) you can use Gentoo or even Linux From Scratch. But Alpine won't really teach you all that much about Linux. It sounds like it will teach you more about Alpine.
 
m59
3:13 PM
Makes sense
The reason it is so popular for docker is because it is so crazy small.
 
Wow. they're really stripping down the list of archs.
 
Say, a.c has three characters abc which in binary form would be 646566 in o' and 1's, but they are ascii characters
 
@m59 Puppy Linux might also be a good choice as could Damn Small Linux. Both of those emphasize small footprints.
 
a.gz has binary and each 8 bit combination is in ascii range but not human redable
This is how I see the difference between a.c and a.gz
 
$ cat a.c
abc
$ gzip a.c
$ cat a.c.gz
�      �.Ya.cKLJ�N��G$
As you can see, the characters in the compressed file are not (all) ASCII.
Also, which is more interesting, the compressed file is 8 times larger than the uncompressed one. Heh.
$ ls -l a.c.gz
-rw-r--r-- 1 terdon terdon 28 May 31 18:15 a.c.gz
$ gunzip a.c.gz
$ ls -l a.c
-rw-r--r-- 1 terdon terdon 4 May 31 18:15 a.c
 
3:18 PM
@terdon Possibly overhead.
 
Yeah, the header probably.
 
BTW, does anyone here use Calibre regularly?
 
$ ls -ltr
 total 24
 drwxrwxr-x 2 mohet01 mohet01  4096 May 30 12:55 tempDir
 -rw-rw-r-- 1 mohet01 mohet01 10240 May 30 12:56 a.tar.gz
 -rw-rw-r-- 1 mohet01 mohet01     4 May 31 08:27 file
 -rw-rw-r-- 1 mohet01 mohet01    29 May 31 08:27 abcFile.gz
$ find . -type f -exec grep -Iq . \{} \; -exec cat \{} \;
 abc
$ find . -type f -exec zgrep -Iq . \{} \; -exec zcat \{} \;

 gzip: ./file: not in gzip format
 abc
mohet01@mohet01-ubuntu:~/dummy$
@terdon If you see second command(find . -type f -exec zgrep -Iq . \{} \; -exec zcat \{} \;), it considerd abcFile.gz as ascii, because -I is to check that, if the content is ascii. abc is coming from abcFile.gz
 
@overexchange No, it is considering the file called "file" as not being in gzipped format. Could be ASCII, could be something else, but it has nothing to do with abcFile.gz
 
@terdon cat a.c.gz not showing printable text coud not mean it is non-ascii
 
3:31 PM
@overexchange Of course it does.
@overexchange You are confusing the thing with the representation of the thing. A compressed file is binary data not ASCII. Whether that can be decompressed to ASCII or not is irrelevant.
 
Despite compressed file is binary data, that binary data has to be stored in a predefined format that can be interpreted by gunzip back again. In that sense, a.c has nothing but binary data, but on interpreting first first 8 bits gives the relevant text([a-zA-Z0-9\nwhateverreadable]) for reading, unlike compressed files
My point is. binary data stored in compressed file abcFile.gz, if you take first 8 bits, it is in ascii range. Any subsequent 8 bits, will be in ascii range. But that ascii letter could be non-readable
 
@overexchange No. If it is ASCII it is readable. The binary representation of an ASCII character isn't ASCII, it is the binary representation of ASCII.
 
3:57 PM
$ cat script.sh
if zgrep -Iq . ~/dummy/a.tar.gz; then
    echo 'tar file is Ascii file'
else
    echo 'tar file is Non - ascii file'
fi

if zgrep -Iq . ~/dummy/abcFile.gz; then
    echo 'abcfile is Ascii file'
else
    echo 'abcfile is Non - ascii file'
fi
$ ./script.sh
tar file is Non - ascii file
abcfile is Ascii file
$
@terdon How do I understadnd this output?
 
@overexchange You are not looking at the compressed file. Zgrep will first uncompress it and then search through it.
So your results are never about abcFile.gz and always about abcFile (no .gz)
 
hmmm
$ cat script.sh
if grep -Iq . ~/dummy/a.tar.gz; then
    echo 'tar file is Ascii file'
else
    echo 'tar file is Non - ascii file'
fi

if grep -Iq . ~/dummy/abcFile.gz; then
    echo 'abcfile is Ascii file'
else
    echo 'abcfile is Non - ascii file'
fi
$ ./script.sh
tar file is Non - ascii file
abcfile is Non - ascii file
$
@terdon So, what does grep -Iq . ~/dummy/abcFile.gz returning false mean? with -I flag
 
Um. The -I flag just makes all binary files not match by definition. It isn't really relevant here.
 
ok
Here it says,
--binary-files=TYPE
If the first few bytes of a file indicate that the file contains binary data, assume that the file is of type TYPE. By default, TYPE is binary, and grep normally outputs either a one-line message saying that a binary file matches, or no message if there is no match. If TYPE is without-match, grep assumes that a binary file does not match; this is equivalent to the -I option.
first few bytes in a.c is also binary, So...
What does it meant to say binary?
Like my text file file1 has abc with representation 646566 in binary
What does this mean? If the first few bytes of a file indicate that the file contains binary data
Anyways, you are right
I got the canswer
2
Q: How can I detect if a file is binary (non-text) in dart?

KasperIn a dart console application, how can I tell if a file is binary (non-text)?

 
4:22 PM
@overexchange Huh? What OS are you using? That's not GNU grep's -I
 
4:44 PM
@tendon Am using
$ grep --version
grep (GNU grep) 2.25
Copyright (C) 2016 Free Software Foundation, Inc.
But that answer is OS agnostic
 
The answer is yes. But the -I option on my system is:
   -I     Process a binary file as if it did not  contain  matching  data;
          this is equivalent to the --binary-files=without-match option.
 
answer to which question? Am missing the question. Oh OS agnostic
ok
 
heh, sorry, I missed a comma. I meant "The answer is OS agnostic, yes"
 
-I option is equivalent to --binary-files=without-match, so grep will not pick any binary file coming on its way
 
Exactly. Which means that as soon as its binary, it will skip it.
That's why it was returning false.
 
5:01 PM
How to display grep -Iq . file returning truefalse on shell?
I mean stdout
 
I think you'd have to look at the return code, but I'm not sure what your return code is for a valid match vs. invalid match
(check with echo $? on the shell maybe after executing your grep?)
pipes /dev/urandom to @terdon's stdout just for the heck of it :P
 
snort
What @ThomasWard said. Either echo $? or simply do something like:
 grep -Iq . file && echo TRUE || echo FALSE
 
Oh ok
 
i'd do @terdon's suggestion
but from my testing I can't guarantee you'll get a non-zero exit value
 
Or what you did with the if. The problem was that since you were telling grep to return false for binary files (-I) and then feeding it binary files, it was always returning false.
$ > file
$ grep -q . file && echo TRUE || echo FALSE
FALSE
$ echo "foo" > file
$ grep -q . file && echo TRUE || echo FALSE
TRUE
 
5:12 PM
So, what does echo TRUE do with grep -q . file?
 
@overexchange It tells you that the grep command exited successfully, that a match was found.
 
which is what you wanted.
 
. matches foo so it worked.
 
5:35 PM
Good evening! What's happening? Still fiddling with that non-ascii grep thing? Well, once the individual bits are understood, it will be clear how it all fits together.
 
6:15 PM
Hey folks. Was just re-reading a novel after many years. It was less substantial than I remembered, but I think I read it when I was much younger.
 
6:34 PM
BTW, does anyone here have experience refreshing patches? I'm wondering what the best way of doing so is. Perhaps by hand?
 
Everyone, this is Michael. Be like Michael:
Here's how to take a crappy post (originally posted on meta, no less) and magically convert it into a decent question.
 
Oh, I thought that was a new Michael. But it's an old Michael.
 
 
2 hours later…
8:12 PM
hey
can someone here help me?
 
 
2 hours later…
Vi.
10:29 PM
Is there actual, real Linux Kernel for Emscripten? With actual ELF files whose text section contain javascript?
 

« first day (2426 days earlier)      last day (2532 days later) »