You are not logged in.
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. 
Offline
^ Great to hear the gates are open, I am sure it will be used...
Nice How To..
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
If you build it, they will come...
Words That Build Or Destroy
Offline
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
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 
Offline
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. 
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
^ I actually quite like it 
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 || Deviantart
Offline
@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 
Offline
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.
Pull requests can be denied! 
Offline
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.Pull requests can be denied!
That's one to add to the database 
Offline
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
)
Last edited by Ragnarok (2012-05-12 15:37:40)
| WordPress Blog |
Offline
(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
)
No problem at all, thank you for your contributions 
Offline
@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
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 + lineWould 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
^ Yeah, tested it too and it looks good. Well done 
Last edited by SabreWolfy (2012-05-29 08:26:47)
• Support #! • Waldorf • Debian sid • Xubuntu • siduction • Peppermint • OpenBox • Xfce • LXDE •
Offline
^ Yeah, tested it too and it looks good. Well done
Thanks 
sorry for my English. It's not my native language
Offline
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. 
John
--------------------
( a boring Japan blog , and idle twitterings )
Offline
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
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
@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
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
@omns yes you're right basically.
also
It's great to see corenominal adding some more scripts to this github
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
--------------------
( a boring Japan blog , and idle twitterings )
Offline
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
I like this idea a lot. I have some scripts that may be useful enough to submit.
dig the user fortunes idea!
Offline
Just an idea...
One good use for 'cb-fortune' would be to display short crunchbang tips for users by users.
Offline
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
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.