SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-05-09 14:16:29

gearge
New Member
From: Middle of Nowhere
Registered: 2012-05-07
Posts: 9

Suggestion and a possible bugfix for 'cb-welcome'

'cb-welcome' script fails to detect internet connection under certain conditions.

Analysis: A component of cb-welcome, '/usr/lib/lib-cb-welcome/check-internet-connection' script, uses ping to check availability of the remote repository. This method is unreliable as ICMP traffic is usually blocked inside corporate networks; though HTTP and FTP access is usually permitted.

Solution: Reimplement the internet connection check, as proposed in the provided script file:
https://www.box.com/s/5935166ff813996cd7f4

Suggestion

The default character repeat rate and delay settings in CB seem much different from defaults provided in most major distributions. As a new convert to CrunchBang I found this somewhat uncomfortable.

"Keyboard Settings" page on CrunchBang wiki describes how to change these settings; though "GUI Method" section needs updating for "Waldorf" release, as xfce-mcs-settings package in no longer available.

I want to suggest adding a section for keyboard configuration to the default Openbox autostart script (/home/user/.config/openbox/autostart). An updated version with reasonable defaults is provided below:
https://www.box.com/s/9c6e37d13e1fad3f0712

The exact values for repeat rate and delay may be adjusted as the community sees fit. What's important is to provided users an option to easily configure these settings (out of the box, so to say). As pling wrote on the wiki, "the developers of Openbox forget about the keyboard". One must agree.

Thanks.

Last edited by gearge (2012-05-09 14:19:38)


[Debian] With a wee bit of vinegar.

Offline

Be excellent to each other!

#2 2012-05-09 14:24:59

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Suggestion and a possible bugfix for 'cb-welcome'

see here: http://crunchbanglinux.org/forums/topic … l-scripts/ for the internet connection check.

Offline

#3 2012-05-09 14:55:52

gearge
New Member
From: Middle of Nowhere
Registered: 2012-05-07
Posts: 9

Re: Suggestion and a possible bugfix for 'cb-welcome'

xaos52 wrote:

Perhaps 'wget' a small file from a debian server and test the return code?

It seems I implemented exactly what xaos52 was suggesting :)

This is a trustworthy method and if it fails, we can honestly assume that (1) no internet connection is available - down or not configured - or (2) that the remote server is down or has some other issues.

I can easily implement a mechanism to allow the user to skip consecutive connection checks, if the first one fails (a simple elif statement should do it), but it wouldn't make sense because of any of the two conditions described above.

Though, it is possible to display different error messages to the user, based on the error code returned by wget. No hassle to implement, BTW.

Last edited by gearge (2012-05-09 14:59:01)


[Debian] With a wee bit of vinegar.

Offline

#4 2012-05-10 07:23:27

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,037
Website

Re: Suggestion and a possible bugfix for 'cb-welcome'

gearge wrote:

'cb-welcome' script fails to detect internet connection under certain conditions.

Analysis: A component of cb-welcome, '/usr/lib/lib-cb-welcome/check-internet-connection' script, uses ping to check availability of the remote repository. This method is unreliable as ICMP traffic is usually blocked inside corporate networks; though HTTP and FTP access is usually permitted.

Solution: Reimplement the internet connection check, as proposed in the provided script file:
https://www.box.com/s/5935166ff813996cd7f4

cb-welcome is now in my GitHub account, please see: https://github.com/corenominal/cb-welcome

Pull requests welcome smile

Offline

#5 2012-05-10 20:00:05

gearge
New Member
From: Middle of Nowhere
Registered: 2012-05-07
Posts: 9

Re: Suggestion and a possible bugfix for 'cb-welcome'

Thanks corenominal,

Pull request sent to the original author smile

What about my suggestion about autostart?


[Debian] With a wee bit of vinegar.

Offline

#6 2012-05-10 21:08:34

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,037
Website

Re: Suggestion and a possible bugfix for 'cb-welcome'

gearge wrote:

Thanks corenominal,

Pull request sent to the original author smile

Excellent. Pull request accepted, I'll repackage soon. Thank you smile

What about my suggestion about autostart?

Yes, looks good to me and would be a welcome addition. Thank you again smile

Offline

#7 2012-05-18 19:47:17

gearge
New Member
From: Middle of Nowhere
Registered: 2012-05-07
Posts: 9

Re: Suggestion and a possible bugfix for 'cb-welcome'

Thank you corenominal,

As expected, I also updated relevant pipemenus. Download:
https://www.box.com/s/b9d4cc9708f1dc0620b3

Changes:

* Modified 'connectiontest' function to use reliable wget instead of unreliable ping (as reported previously)
* Moved 'connectiontest' function to a new file (cb-include.cfg), that can be sourced inside any bash script and used to store common variables and functions
* Modified relevant /usr/bin/cb-* scripts to reflect this change
* Modified '/usr/bin/cb-x-www-browser-pipemenu' script to use vendor supplied URLs as primary sources of APT keys; but implemented fallback to packages.crunchbang.org if primary sources fail. This concerns Opera and Google Chrome options.

I'll be happy to fork, if you manage to place /usr/bin/cb-* files on GitHub. :-)

Thanks again.

Last edited by gearge (2012-05-18 19:52:52)


[Debian] With a wee bit of vinegar.

Offline

#8 2012-05-18 19:57:39

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,037
Website

Re: Suggestion and a possible bugfix for 'cb-welcome'

Excellent, I will get the pipemenu package into my GitHub account. Thank you smile

Offline

#9 2012-05-18 20:07:27

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,037
Website

Re: Suggestion and a possible bugfix for 'cb-welcome'

corenominal wrote:

Excellent, I will get the pipemenu package into my GitHub account.

All done. smile

Offline

#10 2012-05-18 21:05:37

z_skie
#! Member
From: Slovenia
Registered: 2012-05-17
Posts: 90

Re: Suggestion and a possible bugfix for 'cb-welcome'

my suggestion is to maybe include some other window managers like awesome or fluxbox, but whatever big_smile


Live and let love in.

Offline

#11 2012-05-19 16:52:51

gearge
New Member
From: Middle of Nowhere
Registered: 2012-05-07
Posts: 9

Re: Suggestion and a possible bugfix for 'cb-welcome'

corenominal,

Pull request issued for both 'cb-pipemenus' and 'cb-welcome'.


[Debian] With a wee bit of vinegar.

Offline

#12 2012-05-19 17:47:41

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,037
Website

Re: Suggestion and a possible bugfix for 'cb-welcome'

Excellent work. Seriously, thank you for your contributions, I really appreciate the help smile

I have accepted the pull requests and will repackage the scripts next week.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo