SEARCH

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

You are not logged in.

#1 2012-05-11 10:52:09

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

Contributing to CrunchBang via Git and GitHub

Something I want to do for the Waldorf development cycle is to get all the #! specific scripts/hacks/packages into my GitHub account, so that others can start contributing code and patches. I have now started doing this and a few packages are already available -- I have even accepted the first community contributed pull requests, w00t!

Anyhow, it occurred to me that there might be some people who would love to start contributing, but are not sure how to use Git or GitHub. To help with this, I thought it might be good to have an "easy to contribute" project set-up, so that people can play around without worrying about breaking anything.

The project I have chosen for this is 'cb-fortune'. If anyone is unaware, cb-fortune is a little python script that uses fortune to display little adages/fortunes as desktop notifications. Currently, the script just pulls from a standard database of fortunes that is installed with the fortune Debian package, but I thought it might be fun for the CrunchBang community to create its own database, which we can then use with the cb-fortune script.

To this end, I have added a new file to the cb-fortune git repository called, 'cb-user-fortunes'. It is a really simple file and I figure that everyone should be able to contribute to it, regardless of their mad coding skillz. In case it is not super-obvious, each fortune is separated by '%' signs and at the time of writing, it looks like this:

%
"Life is not a practice!"
--corenominal
%
"It's not a bug, it's a feature!"
--corenominal
%
"Thanks for trying #! CrunchBang, you rock! :)"
--corenominal
%
Q: What is pink and hard?
A: A pig with a flick knife!
--corenominal
%

To add a new fortune, you could edit the file like so:

%
"Life is not a practice!"
--corenominal
%
"It's not a bug, it's a feature!"
--corenominal
%
"Thanks for trying #! CrunchBang, you rock! :)"
--corenominal
%
Q: What is pink and hard?
A: A pig with a flick knife!
--corenominal
%
"A witty or profound statement goes here."
--your-username-goes-here
%

Once you have made your edits, you could then send a pull request. Simples.

Unfortunately, it is beyond the scope of this post to detail how to use Git and/or GitHub, but there are plenty of really helpful tutorials and screencasts available online. For example, http://www.youtube.com/watch?v=ZDR433b0 … ure=relmfu

If anyone gets really stuck, please feel free to post questions etc. I will try my best to help, if I can. smile


Ex-developer of #! CrunchBang. Follow me on Twitter smile

Offline

Be excellent to each other!

#2 2012-05-11 11:35:54

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Contributing to CrunchBang via Git and GitHub

^ Great to hear the gates are open, I am sure it will be used...

Nice How To.. smile 

Will put it in Quick References

The band is just fantastic,
that is really what I think.
Oh by the way, which one's Pink?


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#3 2012-05-11 11:53:57

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

Re: Contributing to CrunchBang via Git and GitHub

great corenominal!

however, first thing that came to mind here: what if i want to make a script to pull, for example, quotes from the Tao? would it be possible to do something with that as well, or are we currently limited to just editing that text-file?

Offline

#4 2012-05-11 11:57:49

Vansgo
#! Die Hard
Registered: 2011-05-02
Posts: 1,580
Website

Re: Contributing to CrunchBang via Git and GitHub

Q is that a pink pony on your guitar ?

A1 Why yes of course

A2 Oh that's just my avatar guitar

Offline

#5 2012-05-11 12:14:33

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

Re: Contributing to CrunchBang via Git and GitHub

rhowaldt wrote:

however, first thing that came to mind here: what if i want to make a script to pull, for example, quotes from the Tao? would it be possible to do something with that as well, or are we currently limited to just editing that text-file?

It is possible to create lots of databases for fortune, using numerous different sources, but that is not the exercise here wink


Ex-developer of #! CrunchBang. Follow me on Twitter smile

Offline

#6 2012-05-11 19:10:57

gutterslob
#! Resident Bum
Registered: 2009-11-03
Posts: 3,173

Re: Contributing to CrunchBang via Git and GitHub

I never really bothered with github specifically, though I have dabbled with other git and version control systems.
Maybe it's about time I register an account. My coding skills are pretty limited though (mostly very amateur level C, perl and bash), so I doubt I'd be able to contribute or fix bugs or anything like that. :-/

btw, @Papanom
You sure it's a good idea to have people contribute their "quotes" to cb-fortune?
Sounds like a recipe for parental control. Pretty sure Hillary Clinton will propose banning us off the face of the net. lol

Case in point:

%
"Philosophy is like masturbation. Good for nothing but self-gratification"
--gutterslob
%

...would probably incur the wrath of all philosophers out there .

*runs*


Point & Squirt

Offline

#7 2012-05-11 19:18:50

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 4,534

Re: Contributing to CrunchBang via Git and GitHub

^ I actually quite like it lol


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#8 2012-05-11 19:59:27

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

Re: Contributing to CrunchBang via Git and GitHub

@gutterslob: ha, that's a great quote!

i'd love to see a big community-built quote-db. we have a 'quote of the month' thread still somewhere, so maybe we could also quote each other when people say crazy/funny/silly stuff smile

Offline

#9 2012-05-11 20:18:49

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

Re: Contributing to CrunchBang via Git and GitHub

gutterslob wrote:

btw, @Papanom
You sure it's a good idea to have people contribute their "quotes" to cb-fortune?
Sounds like a recipe for parental control. Pretty sure Hillary Clinton will propose banning us off the face of the net. lol

Pull requests can be denied! wink


Ex-developer of #! CrunchBang. Follow me on Twitter smile

Offline

#10 2012-05-11 20:46:07

anticapitalista
#! Member
Registered: 2010-08-03
Posts: 93

Re: Contributing to CrunchBang via Git and GitHub

corenominal wrote:
gutterslob wrote:

btw, @Papanom
You sure it's a good idea to have people contribute their "quotes" to cb-fortune?
Sounds like a recipe for parental control. Pretty sure Hillary Clinton will propose banning us off the face of the net. lol

Pull requests can be denied! wink

That's one to add to the database smile

Offline

#11 2012-05-12 14:57:24

Ragnarok
#! Member
Registered: 2011-11-29
Posts: 69

Re: Contributing to CrunchBang via Git and GitHub

This seems really cool. This makes it easy for anyone to contribute to Waldorf before it's finally released.

(Note to corenominal: Sorry about that second pull request. It was only meant to have the commit that removed the unused import. I'm not used to Git/Github or version control at all for that matter tongue)

Last edited by Ragnarok (2012-05-12 15:37:40)

Offline

#12 2012-05-12 21:01:03

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

Re: Contributing to CrunchBang via Git and GitHub

Ragnarok wrote:

(Note to corenominal: Sorry about that second pull request. It was only meant to have the commit that removed the unused import. I'm not used to Git/Github or version control at all for that matter tongue)

No problem at all, thank you for your contributions smile


Ex-developer of #! CrunchBang. Follow me on Twitter smile

Offline

#13 2012-05-15 16:51:09

SabreWolfy
#! Die Hard
Registered: 2009-03-09
Posts: 1,285

Re: Contributing to CrunchBang via Git and GitHub

@gutterslob: Is there a way to flag some of the entries for use with "fortune -o" or "-a" only? I think "fortune" shows non-offensive epigrams, "-a" shows all and "-o" shows offensive only.

Last edited by SabreWolfy (2012-05-15 16:52:18)


Support #!Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •

Offline

#14 2012-05-29 07:05:35

bj
Member
From: Hong Kong
Registered: 2011-12-10
Posts: 13

Re: Contributing to CrunchBang via Git and GitHub

A question about simplify cb-fortune. There is a loop in the script:

p = os.popen("fortune -s | sed 's/^[ \t]*//'|sed 's/[ \t]/ /'|sed 's/^A:/\\nA:/'|sed 's/^--/\\n--/'","r")
message = ""
while 1:
            line = p.readline()
            if not line:
                break
            message = message + line

Would it be clearer to change the code to the following?

p = os.popen("fortune -s | sed 's/^[ \t]*//'|sed 's/[ \t]/ /'|sed 's/^A:/\\nA:/'|sed 's/^--/\\n--/'","r")
message = p.read()

I have tested it in statler and it works fine. I am new to python. I don't know if it would make any problem.


sorry for my English. It's not my native language

Offline

#15 2012-05-29 08:26:02

SabreWolfy
#! Die Hard
Registered: 2009-03-09
Posts: 1,285

Re: Contributing to CrunchBang via Git and GitHub

^ Yeah, tested it too and it looks good. Well done smile

Last edited by SabreWolfy (2012-05-29 08:26:47)


Support #!Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •

Offline

#16 2012-05-29 09:26:56

bj
Member
From: Hong Kong
Registered: 2011-12-10
Posts: 13

Re: Contributing to CrunchBang via Git and GitHub

SabreWolfy wrote:

^ Yeah, tested it too and it looks good. Well done smile

Thanks smile


sorry for my English. It's not my native language

Offline

#17 2012-07-11 17:41:20

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 3,887
Website

Re: Contributing to CrunchBang via Git and GitHub

Omns' mild rebuke made me feel guilty enough to finally head over to github and try to see what it was about. Having no prior knowlege of other version control systems like subversion may have helped or hindered, but if you join up then github shows you links to some fairly simple startup tutorials. Finally managed to set up a fork of the repository and send off a pull request for a couple of probably unusable fortunes...

@omns Don't be too hard on us! Git (or is it github?) is really quite sophisticated, and while the process of editing one file and sending a pull request isn't that difficult, the overall complexity is quite off-putting at first. Also, when it comes down to it, thinking of a witty/profound contribution to the cb-fortunes data base is maybe not quite as easy as Uncle Core might have thought at first.

@everyone Even so, don't be afraid to jump in and have a go! The long-term goal of a pool of people somewhat familiar with the tools of git and able to help support the CrunchBang project is surely worth attaining. cool


John     Please help us keep your forums manageable.   Don't Break Debian
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#18 2012-07-11 19:15:11

zalew
#! Junkie
From: Warsaw, .PL
Registered: 2012-03-28
Posts: 374

Re: Contributing to CrunchBang via Git and GitHub

finally I can realize my idea for the cb-welcome python stack

learning git (assuming you know what a version control system is):
http://git-scm.com/
http://git-scm.com/book
although I guess anybody who isn't a programmer working on bigger projects will have the need to go beyond basics like: clone, pull, commit, push.

Offline

#19 2012-07-12 17:18:09

safetycopy
urban legend
From: The Chatsubo
Registered: 2010-04-03
Posts: 1,311

Re: Contributing to CrunchBang via Git and GitHub

A really good introduction to git is http://www.codeschool.com/courses/try-git.


i wonder if i missed the warning
Skinny Puppy, Love in Vein

Offline

#20 2012-07-12 21:41:22

omns
#! wanderer
From: ~/
Registered: 2008-11-25
Posts: 5,131

Re: Contributing to CrunchBang via Git and GitHub

johnraff wrote:

@omns Don't be too hard on us! Git (or is it github?) is really quite sophisticated, and while the process of editing one file and sending a pull request isn't that difficult, the overall complexity is quite off-putting at first.

It's great to see corenominal adding some more scripts to this github smile Not sure I'd say I was being harsh. My observation was that people have asked to be able to contribute to development in the past and when given the opportunity hadn't done so. Contributing at this level requires a certain amount of knowledge that if you're so inclined, shouldn't be to daunting. Development isn't for everyone, it just surprised me that there had been so little response in the context of all the advice in that thread about how the distro should be developed, composed and released.

Offline

#21 2012-07-13 05:04:44

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 3,887
Website

Re: Contributing to CrunchBang via Git and GitHub

@omns yes you're right basically.

also

omns wrote:

It's great to see corenominal adding some more scripts to this github smile

Yes!

By the way, what would be the best channel to discuss a possible pull request if the contributor isn't sure it would be wanted? The Git system? this forum? private messages to other developers?


John     Please help us keep your forums manageable.   Don't Break Debian
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#22 2012-08-25 20:03:36

einfarben
New Member
Registered: 2012-07-28
Posts: 3

Re: Contributing to CrunchBang via Git and GitHub

For those who want to contribute to the #! code via git/github, and want it to use a solid branching model and workflow to make it easy for everyone to keep track of what the changes to the codebase are, there is a great model available here: http://nvie.com/posts/a-successful-git-branching-model/.

So yeah... keep your git commit record clean and readable.


lenin: #! waldorf i686
shelly: arch x86_64
monster: Mac OS10.6.?

Offline

#23 2012-11-16 20:40:04

kbmonkey
#! Die Hard
From: South Africa
Registered: 2011-01-14
Posts: 878
Website

Re: Contributing to CrunchBang via Git and GitHub

I like this idea a lot. I have some scripts that may be useful enough to submit.

dig the user fortunes idea!

Offline

#24 2012-11-25 01:10:30

mishle
#! CrunchBanger
From: Bitterroot Valley
Registered: 2010-07-20
Posts: 167

Re: Contributing to CrunchBang via Git and GitHub

Just an idea...

One good use for 'cb-fortune' would be to display short crunchbang tips for users by users.

Offline

Be excellent to each other!

#25 2012-11-26 19:55:50

jmad2011
#! Junkie
From: newton falls ohio
Registered: 2011-12-25
Posts: 344

Re: Contributing to CrunchBang via Git and GitHub

Cb-Fortune Says: wise man will backup 100gigs of music before playing with slim


Say your prayer's,Eat your vitamins....AND WHAT YOU GONNA DO BROTHA

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