« first day (1374 days earlier)      last day (3874 days later) » 

00:01
@slm he's the guy that directed Inception and a bunch of other super awesome movies
@strugee, I wish he directed Man of Steel as well.
@Ramesh mmm
never seen it
00:39
I think that you are looking for a json parser here, you sure you want to use sed? It will be messy and error prone. — Braiam 9 secs ago
@Ramesh hehe thanks :). Yeah argentina played nice
hey guys out about other cool things to do in a shell:
colorized cat: alias dog='pygmentize -g'
text to binary: echo "$1" | perl -lpe '$_=unpack"B*"';
binary to text: echo "$1" | perl -lpe '$_=pack"B*",$_';
its kewl :D
and a stopwatch, press any button to end the recording: alias hold='time read -sn1'
01:07
perl can really screw that stuff up in a different locale
You should use od and bc
01:26
@mikeserv how would you do that? :)
printf %s 'string' | od -An -td1 -w1 -v will get you one bite at a time on its own line as decimal.
From there you need to convert - set bc and/or dc's in/out radixes correctly.
od won't do multibytes correctly though - when bringing them back together you'll need iconv.
In fact, it may just be that's the same thing I was thinking perl would do anyway, so maybe perl is just as good.
There are some good modules for perl that are designed to handle non-POSIX locales though.
01:42
@mikeserv ok thanks nice to know. I got to sleep. Take carezzz... :)
sleeping too
 
9 hours later…
10:48
Hi Guys, I am wondering if any of you know about high availabilty/clustering/heartbeat?
 
3 hours later…
13:29
@Tbuermann some zookeeper, some aws, some load balancer and everything is working like a charm ;)
13:39
@Ramesh are you around?
@terdon, Hi.
what an awesome video :D I wish that guy didn't have a sell rate in the hundreds of dollars per hour, or I'd ask him to help me figure out why ffmpeg encoding with libvpx-vp9 on an E5-1620v2 on SmartOS gives me 1/3rd the encode speed of the same ffmpeg+libvpx builds on an i7-3770 on Debian (the E5 is significantly better: more cache and higher base clock)
@ÃŁŁǫǛȉЖΦΤїҪ You're so cheap :)
slhck might know though.
@terdon eh? this is a hobby for me... it's not a for-profit business... if it were, I'd probably purchase his services ;p
13:50
@ÃŁŁǫǛȉЖΦΤїҪ Just kidding.
and I don't think slhck uses Solaris or SmartOS so he probably can't help much
@Ramesh I'm confused about your parsing question.
it's probably a compiler option somewhere
@terdon, oh ok. I will try to explain.
@ÃŁŁǫǛȉЖΦΤїҪ I just thought of him 'cause he's the ffmpeg expert.
13:51
I have files which has 3 columns (key1, key2, key3).
ffmpeg appears to have built with all optimizations and even the inline assembly enabled (I had to disable one specific codec that I'll never use to fix the build) so I doubt it's ffmpeg itself
@Ramesh You want the max value of key2 for each key1. How exactly does key3 come into it?
key1 --------(key2)----> key3
Ok, key1 connects to key3 using key2.
Max value of key2 for each key1/key2 combination?
yeah but the max value should be for the entire file.
13:52
thats what max means
For example, if I have
a1 30 l1
a1 20 l1
a2 5 l2
@Ramesh So, basically, you want something like "for each key1, find the max value unless that max value's key3 has already been seen"?
for each (key1 key3) tuple return the line with maximum key2
I will just return a1 30 l1 as output.
who not a2?
13:53
@UlrichDangel That's what I though, but I think that's not what he wants.
@UlrichDangel, sorry. I edited it.
.oO(sounds like a awk/perl solution)
@Ramesh Still don't get it. Why isn't a2 printed?
@Ramesh why not a2? what is the criteria why a2 isnt returned?
Sorry, a2 is to be there.
I am really sorry.
13:56
@Ramesh Double check your question also please, I think there should be an a1 in your desired output that you're not showing.
so for
a1 30 1
a2 5 2
a1 31 1
a2 4 2
a1 42 2

it should return
a1 31 1
a2 5 2
a1 42 2

right?
OK, I still don't understand though. You want the max value of key2 for each key1. OK, how does key3 come into it? Do you want each key3 to be printed once irrespective of which key1 it is associated with? So, for the first key1, print the max, for the second, print the greatest key2 that doesn't have the same key3 as the one printed before?
i think i am wrong...just read the question
@terdon, I will give a small example. For instance,
a1 5 l1
a1 3 l2
a2 3 l1
Should produce the output as,
a1 3 l2
a2 3 l1
huh? Why? Why not the max value for a1?
14:00
However, if the input is,
a1 7 l1
a1 3 l2
a2 3 l1
Then I expect the output as,
a1 7 l1.
@terdon If I choose the maximum value of a1, I cannot choose other values. And I end up getting the total as 5 as compared to 6 in the output.
OK, that last one made no sense at all :)
@Ramesh explain the first example
@Ramesh where do you get the 6 from?
The output that I gave.
a1 3 l2
a2 3 l1
The sum of key2
based on what I've read so far, this looks like it may be non-deterministic "choosing" that is intractable to implement algorithmically ;-) either that or it isn't being explained properly
Basically, it looks like you want to produce output printing the largest possible combination of key2s while ensuring that each key3 is only printed once. Correct?
14:03
you gave
a1 5 l1
a1 3 l2
a2 3 l1

so what is with the 5?
@terdon, yeah.
@Ramesh You realize that is really quite complex right?
@UlrichDangel If I choose a1 5 l1, I have exhausted the possibility of including a1 and also l1.
You can't just parse it using coreutils or the like. You need to take into account all lines and find the maximum.
So, I cannot choose the remaining 2 values as well.
14:04
ah but whats the connection to linux/unix? this is just an algorithmic problem
this sounds like homework somehow ;)
@UlrichDangel it really does.
Nothing wrong with homework Qs but since this is Ramesh asking, I doubt it is.
@UlrichDangel No. It is not homework.
14:05
if the homework says "now implement this in Bourne shell", a new level of hell needs to be invented for that professor
@Ramesh Also, how do you choose? Why not :
a1 5 l1
a2 3 l1
Oh, yeah. never mind.
@terdon yeah. l1 is already selected. :)
@Ramesh so it's more important to get all key3s printed than it is to get the max value of key2s right?
@terdon, the important thing is sum of max value of key2 irrespective of the total key3s
As I showed in the second case, I just got a1 7 l1 which is what I am after.
Sum? You mean the sum of all the values in the 2nd column? That's what you want to maximize?
14:08
@terdon, yeah.
Umm, to be honest off the top of my head, I think this could use a dynamic programming algorithm. You'll need to build all possible paths and find the max sum. Dunno if there's a simpler workaround.
i don't think there is
@terdon, I understand it. I just have very few inputs that are notorious like this. :)
R might have some cool tricks for this.
14:10
I thought I could solve it in bash for those smaller inputs atleast.
@Ramesh You could, but it is not simple. You'll still need to build all possible combinations and iterate through them.
@terdon i would have thought of mathematica
The thing is, you'll need to be able to backtrack and choose a different route.
@UlrichDangel Never used it, I have no idea what it's capable of.
@terdon yeah. Let me see if I could do it in the bash script. I am getting the output just similar as Gnouc.
I think I need to backtrack which I have not implemented as you said.
Anyways, I really appreciate your time and patience :)
No problem, that's what the site's for!
:O I answered a q on unix.SE
0
A: How could I restrict directory content by file type?

ÃŁŁǫǛȉЖΦΤїҪThere are a number of problems with trying to enforce this "after the fact" using a cron job or similar: Race condition. Regardless of which method you use, if you have some program or some code that will be looking through the directory and may pick up and use files you don't want it to intera...

something must be brewing inside of me due to my recent use of SmartOS
@ÃŁŁǫǛȉЖΦΤїҪ Cool :)
@terdon I REALLY like SmartOS. I still need to learn more and compile some more programs that aren't in pkgsrc, but damn, it's a nice OS, and the support for GNU tools makes it easy to compile most stuff from source.
Well @terdon, I suppose the script stays cool to its name of greedy approach. I basically choose something greedily and so I cannot always say the greedy approach is the best one :)
not only that, but Solaris Zones, ZFS and Crossbow are coming in handy to avoid doing hypervisor virtualization on my server
14:25
@Ramesh Yeah, that's why you need recursion.
took me about 30 minutes to get GateOne running, reverse proxied through nginx, with my SSL cert installed and Google OAuth2: tiyukquellmalz.org/gateone
15:05
@ÃŁŁǫǛȉЖΦΤїҪ why it ask me for login?
@Braiam it's Google authentication to keep track of user sessions
 
2 hours later…
16:53
Ugh. Wish it were possible to comment on deleted posts, I'd like to encourage this one to undelete his question and self-answer. At least, I'm guessing 'found an answer somewhere' is why its deleted. unix.stackexchange.com/questions/144494/…
(You'll need 10k rep on the site to see that, of course)
... there, for anyone without 10k
@derobert Ask it yourself. I could undelete but it seems a little harsh.
Well, I could vote to undelete it. But I'd much rather just suggest it to the OP.
Of course, OP has other questions and answers, so I could just put a comment on one of them. I think I'll do that.
anyone see something wrong with this question? unix.stackexchange.com/q/126136/41104
@derobert just me or that d looks bad
@Braiam looks bad?
@arielnmz (Unrelated to this question). You recently asked about how to find the name of a driver in the CUPS GUI, but deleted the question. I'm guessing you deleted that because you found an answer somewhere. If so, I suggest you undelete it and post an answer. It's both allowed and encouraged to answer your own questions on the site. That'll help the next person facing the same question. — derobert 40 secs ago
It could use some copy editing, but appears to be a reasonable question to me...
@Braiam I'm not sure what OP means by "check the debconf configurations of some non-installed packages"
@derobert actually all the letters on the "deleted by balbl" looks like trimmed in the top and bottom
17:04
@Braiam Ah! Yeah. Chrome's rendering there is a little weird.
@Braiam Sorry, just noticed you are the OP. I'm unsure what you mean by that question.
@derobert packages are accompanied by some debconf configurations which modify the way they are configured/installed (like mysql, which you set the mysql password at installation time) but these keys are only accessible once you install the package
Yep. But I wasn't sure from reading the question if you wanted the selections on your system (for a previously installed but not purged package), or the templates, or something else
so I was wondering if there was a way that, without installing the package, I could see them.
@derobert know the keypairs of any non installed package
as long as I can't see them when running debconf-get-selecttions
@Braiam Ah, OK, then I'm going edit that into your question.
You have a .deb and want to know what key/value pairs you could put into debconf for it
@derobert no, I want to know what key/value pairs of any package that it's not installed
I know how to find out the ones that are already installed
17:11
@Braiam Yes. You have a .deb, but its not installed. And you don't want to (or can't) install it.
0
Q: How to check debconf selections of a non-installed package?

BraiamI'm trying to find the available debconf configuration options (which key-value pairs the package supports and if possible a description of each) of some non-installed packages, like ufw, but I haven't found a way with debconf* binaries to check them out. Is there something I'm missing?

... does my edit still reflect what you want?
@derobert as long as it means "I need X information, where do I find it" it's fine
if the solution is: run awesome command package and it will query for the Debian database all the debconf pairs
I want the question be able to allow it
@Braiam Yeah, the question still allows that. I just added in details of what info you're after, the key/value pairs and descriptions if possible
18:16
What can this be closed as? "Closed because the OP is a lazy bugger who can't spend 3 seconds googling to do their own homework" sounds a bit rude.
-2
Q: How to sort files uniquelly

user72510The file /etc/fstab is used to predefine mount points on your system. The third column of this file specifies the filesystem type of the device to be mounted. Sort the contents of this file in alphabetically ascending order, using the third column as your primary key. Store the output in the new...

@terdon downvote it to hell
Seriously, can't even google for sort linux?
It's not even a complex case.
@terdon OP has now been asked twice to show an example. I'd say if that isn't answered, then "unclear what you're asking"
@terdon Maybe leave out the "bugger".
Heh, don't get much clearer that that though.
@FaheemMitha bugger, I was afraid you'd say that.
18:20
@terdon :-)
Still no cupcakes here.
That post really bugs me for some reason, I think because it's a direct copy of an exam question or whatever, he couldn't even be bothered to write it as a question. If he had been , I'd have commented with sort -dk3 /etc/fstab > ~/fstab.byfs which is all he needs.
Yay for peer pressure! He deleted it :)
@derobert I'm guessing that upvote is you.
@FaheemMitha On your mc answer? That was me.
I love it when I can upvote everything on a post :)
@terdon: This one?
1
A: How to check debconf selections of a non-installed package?

Faheem MithaExtracting the contents is one option, as Braiam suggests. Another option is to look inside the deb using mc (midnight commander), which is a little less messy, because it doesn't explode files all over the place. mc which show the contents of the deb as a virtual filesystem, and allow you to nav...

Yup
18:27
if anyone is wondering why SE is wonky
on the same vein
in Tavern on the Meta on Meta Stack Exchange Chat, 41 mins ago, by Bart
@AnnaLear with that many exceptions, are they still exceptions? Can't you just rename that to "the norm" and be done with it?
@terdon Thanks.
@Braiam something going on?
 
5 hours later…
23:00
@mikeserv, it's party time............................................................................‌​....................................

« first day (1374 days earlier)      last day (3874 days later) »