Re: [DNG] netman-gtk3

2016-01-24 Thread aitor_czr

Hi all,

I uploaded short video of netman-gtk3.

gnuinos.org/netman-gtk3/netman.mpg

The project isn't finished. Shortly i will push the code to gitlab.

Cheers,

   Aitor.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Does dunst require dbus?

2016-01-24 Thread Hendrik Boom
On Sun, Jan 24, 2016 at 02:30:15PM +0100, Didier Kryn wrote:
> 
> Thanks for the links. Actually I think I derived my PS1 settings
> from an example found in some default .bashrc. I found the colors by
> try and fail, or maybe I looked at what ncurses was producing. Of
> course you don't want to use ncurses here since you want to keep a
> scrolling terminal. I eventually wrote a simple C programs which
> changes the color. It understands color names in english and french
> - easy to change to your prefered language.
> 
> Steve can see the use I make of indentation and curly braces
> placement is non-standard, but it makes blocks more visible :-)

Really, not al lthat standard.  It resembles the formatting that the FSF
recommends.  Or once recommended, if I recall correctly.

It's my preferred formatting, too.

There's a longstanding dispute whether to use this one or the one 
used in examples in the old K&R book.  THe dispute will probaby never 
be resolved. 

--- hendrik

> 
> #include 
> #include 
> #include 
> #include 
> 
> static int myputc(int c)
> {
>   return fputc(c, stdout);
> }
> 
> #define defcolor max_colors+1
> #define SETCOLOR(C) tputs(tparm(set_foreground, C), 1, myputc)
> 
> int main(int argc, char **argv)
> {
>   const char * const couleurs[] =
>   {"noir", "bleu", "vert", "cyan", "rouge", "magenta", "jaune", "gris"};
>   const char * const colours[] =
>   {"black", "blue", "green", "cyan", "red", "magenta", "yellow", "grey"};
> 
>   int c;
>   char choix[8];
> 
>   if(isatty(1)) setupterm(NULL, 1, NULL);
>   else return 0;
> 
>   if(argc>1)
> {
>   for(c=0; argv[1][c] && c<8; c++) choix[c] = tolower(argv[1][c]);
>   choix[c] = '\0';
>   for(c=0; c<8; c++)
> {
>   if(!strncmp(couleurs[c], choix, strlen(couleurs[c]))) break;
>   if(!strncmp(colours[c], choix, strlen(couleurs[c]))) break;
> }
> }
>   else c = defcolor;
> 
>   SETCOLOR(c);
>   fflush(stdout);
>   return 0;
> }
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Go Linux


On Sun, 1/24/16, Ian Zimmerman  wrote:

 Subject: Re: [DNG] Ad filtering and blocking
 To: dng@lists.dyne.org
 Date: Sunday, January 24, 2016, 5:34 PM
 
On Sun, 1/24/16, Ian Zimmerman  wrote:

Subject: Re: [DNG] Ad filtering and blocking
To: dng@lists.dyne.org
Date: Sunday, January 24, 2016, 5:34 PM

>
> The feature that was literally called "keep cookies until I close
> iceweasel" (and still is, except that it doesn't work) was perfect.  Why
> is it getting slowly dropped?  I don't know, but I'm guessing partly
> because everyone uses bazillions of tabs :-(
>




Or maybe because xul is going the way of the dodo?

http://forums.mozillazine.org/viewtopic.php?f=7&t=2979611

Have you tried an older version of that addon?

golinux
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Go Linux
On Sun, 1/24/16, da...@olansa.co.uk  wrote:

 Subject: Re: [DNG] Ad filtering and blocking
 To: dng@lists.dyne.org
 Date: Sunday, January 24, 2016, 1:18 PM
 
> Thanks for your reply. I am noticing that since some time ago websites
> are starting to 'brainwash' users to use cookies. This is often done
> by displaying a high contrast banner at the top threatening that by
> using their website one MUST also enable cookies.
>
> Is there a way to avoid this new 'cool feature'?
>
> Edward

Edward, are these sites based in the EU? If it's very little to do with
brainwashing -- at least by the site owners -- and everything to do with
a cretinous law forcing EU-based sites to warn visitors of cookies.
Apparently, at least according to the politicians who handed us this
mess, cookies are the latest and greatest security threat to web users.
More so than government intrusion, man in the middle attacks, forged
site certificates, hacking or other such trivia. :)

Most sites are restricting themselves to a simple warning pop-up to
comply with EU/national regulations (thus avoiding the remote threat of
a prosecution) without getting in the way too much. Daft but true.

Cheers,

Dave H



I do a lot of custom element blocking in AdBlock which works very well - no 
popovers and/or overlays and or nag bars allowed here.  But sometimes I have to 
resort to stylish . . .

golinux
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] Non-popularity of Lisp

2016-01-24 Thread Rainer Weikusat
Apollia  writes:

[...]

> Emacs recently reawakened my curiosity about Lisp, which was originally
> piqued years ago by Paul Graham's articles on Lisp:
>
> http://www.paulgraham.com/lisp.html
>
> I never got far with Lisp all those years ago.  But, recently, I found
> working with Emacs Lisp a lot more enjoyable and productive than I thought
> I might, and in some ways Emacs Lisp is actually more comfortable to use
> and easier for me to understand than Perl and Bash.
>
> And I've encountered so much high praise of Lisp that I'm now extremely
> curious to know if it really is as superior to other programming languages
> as it's reputed to be.  And if it is, why isn't Lisp more popular?

Somewhat educated guess at that:

When John McCarthy initially designed the language, S-expression (the
stuff in brackets) where supposed to be for use by the machine while a
to-be-created later M-expression syntax was supposed to offer a more
familiar 'algebraic syntax' to humans. But S-expression syntax turned
out to be so popular that the M-expression project was
dropped. Unfortunately, this means that Lisp categorially doesn't
resemble algebraic expressions in any way, and people tend to reject
'unfamiliar stuff' out of hand because it's unfamiliar, especially when
they've invested a sizable amount of effort into learning
(now) familiar stuff.

One of the longest running language wars in history was caused by the
fact that "some American guy" (Dennis Ritchie) ignored the Algol
convention of using := to express assignment in favour of just using
=. This would seem a preposterous cause for a 40-years-and-counting
propaganda campaign/ flame war but at least until last year, the guy who
Strongly(!!1) objected to that was still happily publishing new texts
about this atrocious case of deviant behaviour.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread dev1fanboy
You can remove some cookie notices with prebake:

http://prebake.eu/

If you look in the ublock dashboard it's under the regional section of third 
party filters

On Sunday, January 24, 2016 5:56 PM, Stephanie Daugherty  
wrote:
> On Sun, Jan 24, 2016 at 7:55 AM, Edward Bartolo  wrote:
> 
>> Hi,
>>
>> Thanks for your reply. I am noticing that since some time ago websites
>> are starting to 'brainwash' users to use cookies. This is often done
>> by displaying a high contrast banner at the top threatening that by
>> using their website one MUST also enable cookies.
>>
>> Is there a way to avoid this new 'cool feature'?
>>
> 
> 
> 
> My understanding is this is actually some EU privacy law where they have
> to
> disclose cookie use.
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
-- 
Take back your privacy. Switch to www.StartMail.com
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Stephanie Daugherty
On Sun, Jan 24, 2016 at 7:55 AM, Edward Bartolo  wrote:

> Hi,
>
> Thanks for your reply. I am noticing that since some time ago websites
> are starting to 'brainwash' users to use cookies. This is often done
> by displaying a high contrast banner at the top threatening that by
> using their website one MUST also enable cookies.
>
> Is there a way to avoid this new 'cool feature'?
>



My understanding is this is actually some EU privacy law where they have to
disclose cookie use.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread david

Thanks for your reply. I am noticing that since some time ago websites
are starting to 'brainwash' users to use cookies. This is often done
by displaying a high contrast banner at the top threatening that by
using their website one MUST also enable cookies.

Is there a way to avoid this new 'cool feature'?

Edward


Edward, are these sites based in the EU? If it's very little to do with 
brainwashing -- at least by the site owners -- and everything to do with 
a cretinous law forcing EU-based sites to warn visitors of cookies. 
Apparently, at least according to the politicians who handed us this 
mess, cookies are the latest and greatest security threat to web users. 
More so than government intrusion, man in the middle attacks, forged 
site certificates, hacking or other such trivia. :)


Most sites are restricting themselves to a simple warning pop-up to 
comply with EU/national regulations (thus avoiding the remote threat of 
a prosecution) without getting in the way too much. Daft but true.


Cheers,

Dave H
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Florian Zieboll
On Sun, 24 Jan 2016 13:55:49 +0100
Edward Bartolo  wrote:

> I am noticing that since some time ago websites
> are starting to 'brainwash' users to use cookies. This is often done
> by displaying a high contrast banner at the top threatening that by
> using their website one MUST also enable cookies.
> 
> Is there a way to avoid this new 'cool feature'?


"Self-Destructing Cookies" is a nice add-on for Firefox: install,
configure and forget. Quote:

| Fix the web. Gets rid of a site's cookies and LocalStorage as soon as
| you close its tabs. Protects against trackers and zombie-cookies.
| Trustworthy services can be whitelisted.

https://addons.mozilla.org/en-US/firefox/addon/self-destructing-cookies/ 

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] How stable is the devuan migration?

2016-01-24 Thread Ángel Ramírez Isea

On 2016-01-19 08:10, fsmithred wrote:

I did an upgrade of wheezy to devuan jessie last week, and it was
uneventful. It seemed easier than any major upgrades of debian that 
I've

done in the past. Boring description is here -
https://lists.dyne.org/lurker/message/20160114.194903.4e35c189.en.html

fsr


On 01/19/2016 06:59 AM, Nuno Magalhães wrote:

Greetings,

I have a VPS running whezzy (7.8) which was a little behind updates
before systemd hit the fan. It's used as a LAMP stack and i'm
wondering how easy would it be to upgrade it to devuan.

I had a debian vm laying around and remember i did just that and IIRC
it wasn't a big deal. Does anyone have fresh/recent input/tips?

TIA,
Nuno


Reporting another server migrated from Debian 7.8 to Devuan Alpha. No 
hiccups :D


--
Saludos cordiales,

Ángel Ramírez Isea.
Usuario de Devuan Jessie GNU / Linux # 460737.

Coordinador General.
Cooperativa Simón Rodríguez para el Conocimiento Libre, RS.
www.simonrodriguez.org.ve
(261) 524.55.93 -:- (426) 369.57.18
J-40294137-4
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Dr. Nikolaus Klepp
Am Sonntag, 24. Januar 2016 schrieb Edward Bartolo:
> Thanks for your reply. I am noticing that since some time ago websites
> are starting to 'brainwash' users to use cookies. This is often done
> by displaying a high contrast banner at the top threatening that by
> using their website one MUST also enable cookies.
> 
> Is there a way to avoid this new 'cool feature'?

You could accept all cookies and let them purge when the browser exits.

Nik



-- 
Please do not email me anything that you are not comfortable also sharing with 
the NSA.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Florian Zieboll
On Sun, 24 Jan 2016 14:06:42 +0100
Didier Kryn  wrote:

> Either forbid the cookies or avoid web applications.

"Self-Destructing Cookies" is a nice add-on for Firefox: install,
configure and forget.

| Fix the web. Gets rid of a site's cookies and LocalStorage as soon as
| you close its tabs. Protects against trackers and zombie-cookies.
| Trustworthy services can be whitelisted.

https://addons.mozilla.org/en-US/firefox/addon/self-destructing-cookies/
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread dev1fanboy
Not sure which methods you already know about but..

Another approach would be to setup unbound with redirects for those domains to 
lighttpd and just have the following in index.html:


 

Ads will not appear or have placeholders this way, and whole domains that serve 
ads/tracking will not be connected to, you won't notice any placeholders and 
sites will load faster.  There is a perl script around somewhere (and a pythton 
parser somewhere) that can help with converting hosts files and adblock filters 
to unbound redirects. It's not more effective than ublock, but it's another 
option.

Since you already use privoxy, I suggest blocking flash, js annoyances, web 
bugs, and third party cookies that way. Basically filter out all cruft you can 
live without via privoxy. I wouldn't try building an adblock "list" with 
privoxy though as the more stuff you filter with privoxy the slower your 
browsing experience is. 

I've noticed the same problem, ublock isn't as effective as it was and some 
sites seem to be standing up to adblockplus and the ads industry in general: 
http://uk.businessinsider.com/adblock-plus-un-invited-from-iab-conference-2016-1?r=US&IR=T

Maybe people aren't contributing to the filters as much now that XUL is coming 
to and end. There is also the privacy badger extension, but I prefer creating 
my own filters with ublock to adding more filtering in the browser. 

Firefox used to have a way to block "third party" images, or just block all 
images and then add exceptions.. not sure where those features are gone.

On Sunday, January 24, 2016 12:21 PM, Edward Bartolo  wrote:
> Hi All,
> 
> First of all, if blocking and/or filtering ads while browsing the
> Internet is not ethically acceptable by Devuan, block this email. If
> ad filtering and blocking is ethically acceptable, this is what I have
> to say.
> 
> First, how do Devuan users filter and/or block unwanted ads? I am
> noticing that AdBlock and UBlock are not as effective as they were
> several months ago. Iceweasel seems to be starting to facilitate ad
> servers promoting their ads notwithstanding users opt not to view
> them.
> 
> On my system I use privoxy and UBlock and sometimes NoScript.
> 
> Are there better approaches?
> 
> Thanks
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
-- 
Take back your privacy. Switch to www.StartMail.com
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
k...@aspodata.se writes:
> Reiner Weikusat:
>> Peter Olson  writes:
>> 
>> >> On January 23, 2016 at 1:36 PM Rainer Weikusat
>> >>  wrote:
>> >> 
>> >> Peter Olson  writes:
>> >> 5>> On January 22, 2016 at 4:34 PM Rainer Weikusat
>> >>  wrote:
>> >> 
>> >> [...]
>> >> 
>> >> >> p = buf = alloca(total);
>> >> 
>> >> [...]
>> >> 
>> >> >   the failure mode of alloca is SIGSEGV or some other malfunction and
>> >> > there is no way to test for it
>
> You should be able to cache a SIGSEGV if you are useing sigaltstack().
> Never tested it though and don't know it it is useful at all.
>
> ...
>> In this respect, there's no difference between alloca and static stack
>> allocations.
> ...
>
> Soo, the above is nearly the same as
>
>   char buf[total];
>   p = buf;
>
> Why then use alloca()?

This obviously cuts both ways: Considering that C99 style variable
arrays share all the (largely hypothetical) drawbacks of alloca but
offer less features, why use them?


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
k...@aspodata.se writes:
> Rainer Weikusat:
>> k...@aspodata.se writes:
>> > Katola2:
>> > ...
>> >> void another_print_start(char *name, char *what){
>> >> 
>> >>  char c[3] = " :";
>> >> 
>> >>  c[2] = name[0] & ~0x20;
>> >> 
>> >>  write(2, c+2, 1);
>> >>  write(2, name+1, strlen(name) -1);
>> >>  write(2, c, 2);
>> >>  write(2, what, strlen(what));
>> >> 
>> >> }
>> >
>> > Why not just use writev(2) and write it one system call ?
>
> Since people complained about allocations, I thought you could use this
> and have a static struct iovec[4];, then the only allocations done 
> would be for simple types.
>
>> The idea behind writev is to avoid userspace block memory copies
>> prior

[and unless the average block size is more than 2 times 16, this ends up
doing more copying instead of less]

> ...
>> that's 3 lines of code less which is "not great". In addition to this,
>> both write and writev may end up writing less data than requested and
>> the code for restarting a partially completed writev is more complicated
>> than the same for write.
>
> Both true.

The core of my statement was not about neligible code savings in one
place ending up as code increases in another but about causing
additional copying instead of avoiding it in case of small areas.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Readable code; making code more easily writable; Emacs, multifiles-apmod; VUE; Code Bubbles; Lisp; Inform 7; HyperCard and HyperTalk - was Re: "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
Apollia  writes:

[...]

> I think if I ever did code much in C, my code would end up looking very
> unusual and unconventional to many people, because I often like to use
> long, descriptive names for functions and variables, no matter what
> language I'm using, even Bash.

This style isn't really uncommon for people used to IDEs doing
identifier auto-completion. But that's not only a bitch to work with
without it but also difficult to read because of the sheer verbosity of
the text. Eg, using an identifier

combined-list-of-files-in-all-source-folders

doesn't really communicate more than 'all-files' or even just 'all' (if
the files is evident from the context) would.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
k...@aspodata.se writes:
> Reiner Weikusat:
>> Peter Olson  writes:
>> 
>> >> On January 23, 2016 at 1:36 PM Rainer Weikusat
>> >>  wrote:
>> >> 
>> >> Peter Olson  writes:
>> >> 5>> On January 22, 2016 at 4:34 PM Rainer Weikusat
>> >>  wrote:
>> >> 
>> >> [...]
>> >> 
>> >> >> p = buf = alloca(total);
>> >> 
>> >> [...]
>> >> 
>> >> >   the failure mode of alloca is SIGSEGV or some other malfunction and
>> >> > there is no way to test for it
>
> You should be able to cache a SIGSEGV if you are useing sigaltstack().
> Never tested it though and don't know it it is useful at all.
>
> ...
>> In this respect, there's no difference between alloca and static stack
>> allocations.
> ...
>
> Soo, the above is nearly the same as
>
>   char buf[total];
>   p = buf;
>
> Why then use alloca()?

This obviously cuts both ways: Considering that C99 style variable
arrays share all the (largely hypothetical) drawbacks of alloca but
offer less features, why use them?
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread dev1fanboy
(reposted, seem to have been filtered last time)

Not sure which methods you already know about but..
 
Another approach would be to setup unbound with redirects for those domains to 
lighttpd and just have the following in index.html:
 


 
Ads will not appear or have placeholders this way, and whole domains that serve 
ads/tracking will not be connected to, you won't notice any placeholders and 
sites will load faster.  There is a perl script around somewhere (and a pythton 
parser somewhere) that can help with converting hosts files and adblock filters 
to unbound redirects. It's not more effective than ublock, but it's another 
option.

Since you already use privoxy, I suggest blocking flash, js annoyances, web 
bugs, and third party cookies that way. Basically filter out all cruft you can 
live without via privoxy. I wouldn't try building an adblock "list" with 
privoxy though as the more stuff you filter with privoxy the slower your 
browsing experience is.

I've noticed the same problem, ublock isn't as effective as it was and some 
sites seem to be standing up to adblockplus and the ads industry in general.

Maybe people aren't contributing to the filters as much now that XUL is coming 
to and end. There is also the privacy badger extension, but Iprefer creating my 
own filters with ublock to adding more filtering in the browser. 

Firefox used to have a way to block "third party" images, or just block all 
images and then add exceptions.. not sure where those features are gone. Maybe 
some about:config option has it, or an extension. 

 
> On Sunday, January 24, 2016 12:21 PM, Edward Bartolo 
> wrote:
>> Hi All,
>>
>> First of all, if blocking and/or filtering ads while browsing the
>> Internet is not ethically acceptable by Devuan, block this email. If
>> ad filtering and blocking is ethically acceptable, this is what I have
>> to say.
>>
>> First, how do Devuan users filter and/or block unwanted ads? I am
>> noticing that AdBlock and UBlock are not as effective as they were
>> several months ago. Iceweasel seems to be starting to facilitate ad
>> servers promoting their ads notwithstanding users opt not to view
>> them.
>>
>> On my system I use privoxy and UBlock and sometimes NoScript.
>>
>> Are there better approaches?
>>
>> Thanks
>> ___
>> Dng mailing list
>> Dng@lists.dyne.org
>> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> --
> Take back your privacy. Switch to www.StartMail.com
-- 
Take back your privacy. Switch to www.StartMail.com
-- 
Take back your privacy. Switch to www.StartMail.com
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
"Dr. Nikolaus Klepp"  writes:
> Am Freitag, 22. Januar 2016 schrieb Rainer Weikusat:

[...]

>> name_len = strlen(name);
>> what_len = strlen(what);
>> total = name_len + what_len + 3;
>> 
>> p = buf = alloca(total);
>> memcpy(p, name, name_len);
>> p += name_len;
>> *p++ = ' ';
>> memcpy(p, what, what_len);
>> p += what_len;
>> *p++ = ':';

[...]

> just out of couriosity: why don't you use "strcat"?

Because strcat is A Seriously Bizarre Invention[tm].

Programmers using the strcat or wcscat function (or the
following strncat or wcsncar functions for that matter) can
easily be recognized as lazy and reckless. In almost all
situations the lengths of the participating strings are known
(it better should be since how can one otherwise ensure the
allocated size of the buffer is sufficient?) Or at least, one
could know them if one keeps track of the results of the various
function calls. But then it is very inefficient to use
strcat/wcscat. A lot of time is wasted finding the end of the
destination string so that the actual copying can start.


https://www.gnu.org/software/libc/manual/html_node/Copying-and-Concatenation.html#Copying-and-Concatenation
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread KatolaZ
On Sun, Jan 24, 2016 at 05:25:47PM +0100, k...@aspodata.se wrote:

[cut]

> ...
> > In this respect, there's no difference between alloca and static stack
> > allocations.
> ...
> 
> Soo, the above is nearly the same as
> 
>   char buf[total];
>   p = buf;
> 
> Why then use alloca()?
> 

Maybe because 
 
  char buf[total];

works only in ANSI C11. I still don't see the need for an internal
buffer to print out a formatted string, to be honest :)

HND

KatolaZ

-- 
[ Enzo Nicosia aka KatolaZ --- GLUG Catania -- Freaknet Medialab ]
[ me [at] katolaz.homeunix.net -- http://katolaz.homeunix.net -- ]
[ GNU/Linux User:#325780/ICQ UIN: #258332181/GPG key ID 0B5F062F ]
[ Fingerprint: 8E59 D6AA 445E FDB4 A153 3D5A 5F20 B3AE 0B5F 062F ]
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread karl
Rainer Weikusat:
> k...@aspodata.se writes:
> > Katola2:
> > ...
> >> void another_print_start(char *name, char *what){
> >> 
> >>  char c[3] = " :";
> >> 
> >>  c[2] = name[0] & ~0x20;
> >> 
> >>  write(2, c+2, 1);
> >>  write(2, name+1, strlen(name) -1);
> >>  write(2, c, 2);
> >>  write(2, what, strlen(what));
> >> 
> >> }
> >
> > Why not just use writev(2) and write it one system call ?

Since people complained about allocations, I thought you could use this
and have a static struct iovec[4];, then the only allocations done 
would be for simple types.

> The idea behind writev is to avoid userspace block memory copies prior
...
> that's 3 lines of code less which is "not great". In addition to this,
> both write and writev may end up writing less data than requested and
> the code for restarting a partially completed writev is more complicated
> than the same for write.

Both true.

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread karl
Reiner Weikusat:
> Peter Olson  writes:
> 
> >> On January 23, 2016 at 1:36 PM Rainer Weikusat
> >>  wrote:
> >> 
> >> Peter Olson  writes:
> >> 5>> On January 22, 2016 at 4:34 PM Rainer Weikusat
> >>  wrote:
> >> 
> >> [...]
> >> 
> >> >> p = buf = alloca(total);
> >> 
> >> [...]
> >> 
> >> >   the failure mode of alloca is SIGSEGV or some other malfunction and
> >> > there is no way to test for it

You should be able to cache a SIGSEGV if you are useing sigaltstack().
Never tested it though and don't know it it is useful at all.

...
> In this respect, there's no difference between alloca and static stack
> allocations.
...

Soo, the above is nearly the same as

  char buf[total];
  p = buf;

Why then use alloca()?

Regards,
/Karl Hammar

---
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Teodoro Santoni
Good afternoon,

2016-01-24 13:55 GMT+01:00, Edward Bartolo :
> Is there a way to avoid this new 'cool feature'?
>
> Edward

At the moment a lot of the sites I visited recently ended with
sourcing a script from cookie-script.net, thus I think that writing

cookie-script.net 127.0.0.1
cookie-script.com 127.0.0.1

in /etc/hosts may help.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
k...@aspodata.se writes:

> Katola2:
> ...
>> void another_print_start(char *name, char *what){
>> 
>>  char c[3] = " :";
>> 
>>  c[2] = name[0] & ~0x20;
>> 
>>  write(2, c+2, 1);
>>  write(2, name+1, strlen(name) -1);
>>  write(2, c, 2);
>>  write(2, what, strlen(what));
>> 
>> }
>
> Why not just use writev(2) and write it one system call ?

The idea behind writev is to avoid userspace block memory copies prior
to doing a system call which will end up copying all the memory contents
into kernel memory. In order to achieve this, a vector of struct iovec
structures each specifiyng the location and size of a single area is
used. A struct iovec is

struct iovec {
void *iov_base;
size_t iov_len;
};

On a 64-bit system, this means that an additional 16 bytes of data need
to be copied by the kernel for every area used by writev. For this to be
worthwhile, the average size of an area should be more than 33 bytes,
otherwise, writev will end up doing more copying than userspace code had
need to create a continuous area before doing the system call. And then,
there's also the userspace code needed to initialize the vector. For the
example above, this would be

iovs->iov_base = c + 2;
iovs->iov_len = 2;
iovs[1].iov_base = name + 1;
iovs[1].iov_len = strlen(name) - 1;
iovs[2].iov_base = c;
iovs[2].iov_len = 2;
iovs[3].iov_base = what;
iovs[3].iov_len = strlen(what);

compared to

name_len = strlen(name);
what_len = strlen(what);
total = name_len + what_len + 3;
p = buf = alloca(total);
memcpy(p, name, name_len);
p += name_len;
*p++ = ' ';
memcpy(p, what, what_len);
p += what_len;
*p++ = ':';
*p = ' ';

that's 3 lines of code less which is "not great". In addition to this,
both write and writev may end up writing less data than requested and
the code for restarting a partially completed writev is more complicated
than the same for write.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
Didier Kryn  writes:
> Le 23/01/2016 19:28, Rainer Weikusat a écrit :
>> Didier Kryn  writes:
>>> Le 23/01/2016 12:16, Didier Kryn a écrit :
  I'm curious of the reason why you specify
 static void print_start(char const *name, char const *what)

[...]

>>>  Sorry, I overlooked the code and read "char const *name" as if it
>>> was "char * const name". Actually the syntax you used is equivalent to
>>> "const char *name".
>> That's a habit based on an observation I made when I started to write
>> code in C: Type qualifiers are left-associative (presumably a misuse of
>> the term) unless there's nothing to the left of them,

[...]

> So, we could express it as the general declaration would be:

[...]

> But another syntax is allowed, where the qualifier[s] can be on
> the left. I'm not sure there's a BNF description of the C syntax.

It's really

declaration:
   declaration-specifiers init-declarator-list[opt] ;
   
declaration-specifiers:
  storage-class-specifier declaration-specifiers[opt]
  type-specifier declaration-specifiers[opt]
  type-qualifier declaration-specifiers[opt]
  function-specifier declaration-specifiers[opt]

Which means a type-qualifier can appear both to the left and to the
right of a type specifier.

Originally (as I wrote) the fact that

const char *

meant 'pointer to constant char' while

char const *

also meant this and 'constant pointer to char' had to be expressed as

char * const

simply annoyed me because of it's irregularity --- but now, after having
had to deal with a somewhat largish Java codebase where absolutely
everything had a final tacked onto it, thereby making it seriously
difficult to spot the acting code among all the pointless declarational
clutter, I'm presumably in the process of stopping to use const
altogether.

>>> It actually protects the string from being overwritten by the
>>> function.
>> Not really. It just asserts that the string won't be modified using this
>> pointer. In theory, this would enable a compiler to optimize such
>> accesses, eg, collapse many of them into one, however, in practice, gcc
>> doesn't do that, and the qualifier is useless.
>
> The most important goal is not to optimise the executable, it is
> to protect against programmer's errors. gcc will warn you if you try
> to modify a constant.

It won't even compile code trying to use a pointer-to-constant-something
to modify something. But this usually just means that the const ought to
be dropped. C is all about managing memory manually and this means
whenever the content of some (set of) memory location(s) is to be
modified, thought must be put into determining where this memory comes
from and which other code might use it in which way.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] "Common knowledge?"-question

2016-01-24 Thread Rainer Weikusat
Peter Olson  writes:

>> On January 23, 2016 at 1:36 PM Rainer Weikusat
>>  wrote:
>> 
>> Peter Olson  writes:
>> 5>> On January 22, 2016 at 4:34 PM Rainer Weikusat
>>  wrote:
>> 
>> [...]
>> 
>> >> p = buf = alloca(total);
>> 
>> [...]
>> 
>> >   the failure mode of alloca is SIGSEGV or some other malfunction and
>> > there is no way to test for it
>> 
>> It's supposed to allocate memory in the current stack frame which will
>> work unless the stack has already grown to the limit.
>
>>From man7.org/linux/man-pages/man3/alloca.3.html section BUGS:
>There is no error indication if the stack frame cannot be extended.
>(However, after a failed allocation, the program is likely to receive
>a SIGSEGV signal if it attempts to access the unallocated
>space.)

Calling this a bug is technical nonsense: The way stack allocation works
for a single-threaded process on UNIX(*) etc is that the code just uses
whatever it needs and that the kernel's supposed to handle faults
resulting from accessing a not-yet-valid address by making it available.
In this respect, there's no difference between alloca and static stack
allocations. If a program tries to use more stack space than can be
provided, it may end up getting a SIGSEGV. Or it may silently overwrite
memory used for something different. In either case, the code cannot
possibly work in the it was written.

OTOH, space allocated on the stack will be automatically reclaimed after
the corresponding function returned which is the best 'automatic memory
management' one can get in C. It's also good for locality as different
functions called at the same depth will keep using the same memory area.

> I have never been a fan of alloca though it obviously _can_ be used safely 
> with
> a little care.

Do you realize that Linux uses 8K kernel stacks (and can be configured
to use 4K) with no protection against overwriting whatsoever? In
contrast to this, even on the 32 bit system, the userspace stack area is
practically infinite compared to the memory requirements of small
program and this becomes even more true on 64bit systems.

With some amount criminal energy, it's possible to use the stack
'unsafely'.
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Does dunst require dbus?

2016-01-24 Thread Didier Kryn

Le 24/01/2016 11:27, Florian Zieboll a écrit :

On Sat, 23 Jan 2016 21:11:46 +0100
Adam Borowski  wrote:


>On Sat, Jan 23, 2016 at 08:10:31PM +0100, Florian Zieboll wrote:
>

> >I had played a bit with the tiling and highly (GUI) configurable
> >"Terminator" but was bounced back to xterm very quickly due to its
> >footprint and wrote the following secremote.sh script. It has not
> >been tested with more than the few defined colors but I am not
> >aware of any limitations other than that of the X11 palette.

>
>This approach breaks the moment you ssh from an existing terminal,
>especially if you ssh from box 2 to box 3.
>
>I'd instead recommend setting PS1 in .bashrc on those machines to
>something distinct.

Nice that this also works Xless / on the console:)  Although I am not
too much into working from "behind proxies", I had a closer look at the
PS1 strings Didier posted in this thread on Friday. I could find the
backslash escaped special/characters/  documented in the bash(1)
manpage. A web search for the text formatting (colors and style) of
course returned a lot of results, including several "PS1 generators",
some "Extreme Power Prompt" examples [1] and this extensive "Bash
Prompt HOWTO" [2] at TLDP. But where would I have to look "on board"
for a documentation of these powerful escape sequences?

By the way, I just noticed that packages.debian.org has the doc-linux
package listed no longer but in oldoldstable.

Ahoi,

Florian



[1]http://www.askapache.com/linux/bash-power-prompt.html
[2]http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/


Thanks for the links. Actually I think I derived my PS1 settings 
from an example found in some default .bashrc. I found the colors by try 
and fail, or maybe I looked at what ncurses was producing. Of course you 
don't want to use ncurses here since you want to keep a scrolling 
terminal. I eventually wrote a simple C programs which changes the 
color. It understands color names in english and french - easy to change 
to your prefered language.


Steve can see the use I make of indentation and curly braces 
placement is non-standard, but it makes blocks more visible :-)


#include 
#include 
#include 
#include 

static int myputc(int c)
{
  return fputc(c, stdout);
}

#define defcolor max_colors+1
#define SETCOLOR(C) tputs(tparm(set_foreground, C), 1, myputc)

int main(int argc, char **argv)
{
  const char * const couleurs[] =
  {"noir", "bleu", "vert", "cyan", "rouge", "magenta", "jaune", "gris"};
  const char * const colours[] =
  {"black", "blue", "green", "cyan", "red", "magenta", "yellow", "grey"};

  int c;
  char choix[8];

  if(isatty(1)) setupterm(NULL, 1, NULL);
  else return 0;

  if(argc>1)
{
  for(c=0; argv[1][c] && c<8; c++) choix[c] = tolower(argv[1][c]);
  choix[c] = '\0';
  for(c=0; c<8; c++)
{
  if(!strncmp(couleurs[c], choix, strlen(couleurs[c]))) break;
  if(!strncmp(colours[c], choix, strlen(couleurs[c]))) break;
}
}
  else c = defcolor;

  SETCOLOR(c);
  fflush(stdout);
  return 0;
}

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Didier Kryn

Le 24/01/2016 13:55, Edward Bartolo a écrit :

On 24/01/2016, Arnt Gulbrandsen  wrote:

Ghostery remains good.

Arnt


Hi,

Thanks for your reply. I am noticing that since some time ago websites
are starting to 'brainwash' users to use cookies. This is often done
by displaying a high contrast banner at the top threatening that by
using their website one MUST also enable cookies.

Is there a way to avoid this new 'cool feature'?

Edward
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


The problem is that there is a flaw in the design of the http 
protocol: it has no concept of session. Disconnection is normal after 
any transfer. But nowadays, far beyond simple documents, the web 
provides real applications, more and more complex applications, which 
cannot work without saving somewhere data about their state, and there 
isn't any other place to store them than the client side, i.e cookies. 
But, of course, the client, as well, has no concept of a session and, 
therefore, is unable to clear the cookies once the job is finished. 
Either forbid the cookies or avoid web applications.


Didier


___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Ad filtering and blocking

2016-01-24 Thread Edward Bartolo
On 24/01/2016, Arnt Gulbrandsen  wrote:
> Ghostery remains good.
>
> Arnt
>

Hi,

Thanks for your reply. I am noticing that since some time ago websites
are starting to 'brainwash' users to use cookies. This is often done
by displaying a high contrast banner at the top threatening that by
using their website one MUST also enable cookies.

Is there a way to avoid this new 'cool feature'?

Edward
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] Ad filtering and blocking

2016-01-24 Thread Edward Bartolo
Hi All,

First of all, if blocking and/or filtering ads while browsing the
Internet is not ethically acceptable by Devuan, block this email. If
ad filtering and blocking is ethically acceptable, this is what I have
to say.

First, how do Devuan users filter and/or block unwanted ads? I am
noticing that AdBlock and UBlock are not as effective as they were
several months ago. Iceweasel seems to be starting to facilitate ad
servers promoting their ads notwithstanding users opt not to view
them.

On my system I use privoxy and UBlock and sometimes NoScript.

Are there better approaches?

Thanks
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Does dunst require dbus?

2016-01-24 Thread Florian Zieboll
On Sat, 23 Jan 2016 21:11:46 +0100
Adam Borowski  wrote:

> On Sat, Jan 23, 2016 at 08:10:31PM +0100, Florian Zieboll wrote:
>
> > I had played a bit with the tiling and highly (GUI) configurable
> > "Terminator" but was bounced back to xterm very quickly due to its
> > footprint and wrote the following secremote.sh script. It has not
> > been tested with more than the few defined colors but I am not
> > aware of any limitations other than that of the X11 palette.   
> 
> This approach breaks the moment you ssh from an existing terminal,
> especially if you ssh from box 2 to box 3.
> 
> I'd instead recommend setting PS1 in .bashrc on those machines to
> something distinct.

Nice that this also works Xless / on the console :) Although I am not
too much into working from "behind proxies", I had a closer look at the
PS1 strings Didier posted in this thread on Friday. I could find the
backslash escaped special /characters/ documented in the bash(1)
manpage. A web search for the text formatting (colors and style) of
course returned a lot of results, including several "PS1 generators",
some "Extreme Power Prompt" examples [1] and this extensive "Bash
Prompt HOWTO" [2] at TLDP. But where would I have to look "on board"
for a documentation of these powerful escape sequences? 

By the way, I just noticed that packages.debian.org has the doc-linux
package listed no longer but in oldoldstable.

Ahoi,

Florian



[1] http://www.askapache.com/linux/bash-power-prompt.html
[2] http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng