Leave a comment

Firstboot – Time Zone Module Release 0.3

My plan for Release 0.3 is to file a bug report to bugzilla to inform them that scdate is not performing when my script calls on it. I mention in detail in my release 0.2 what I believe the problem to be within /usr/lib/python2.7/site-packages/scdate/core/timezoneBackend.py:

#from slip.util.files import linkorcopyfile

def bool(val):
if val: return “true”
return “false”

class timezoneBackend(object):
def writeConfig (self, timezone, utc=0):
timezonefile = timezone.replace (‘ ‘, ‘_’)
fromFile = “/usr/share/zoneinfo/” + timezonefile

if utc == 0 or utc == ‘false’:
utc = “false”
else:
utc = “true”

# linkorcopyfile (fromFile, “/etc/localtime”)
os.unlink(“/etc/localtime”);
os.symlink(“/usr/share/zoneinfo/EST5EDT”, “/etc/localtime”)

#Check to see if /var/spool/postfix/etc/localtime exists
if os.access(“/var/spool/postfix/etc/localtime”, os.F_OK) == 1:
#If it does, copy the new time zone file into the chroot jail
# linkorcopyfile (fromFile, “/var/spool/postfix/etc/localtime”)
os.unlink(“/etc/localtime”);
os.symlink(“/usr/share/zoneinfo/EST5EDT”, “/etc/localtime”)

Leave a comment

Firstboot – Time Zone Module Release 0.2

My Firstboot – Timezone module has been packaged and posted to the following weblink:

Leave a comment

Firstboot – Time Zone Module Release 0.1

For my class project I am working on Firstboot – Time Zone Module. The requirements for this assignment is learning to script in python and packaging. At the moment I am in the script part of my project. I’m not very verse in python and is completely new to the language.

I had some difficulties getting my timezone module to run during firstboot. For some reason it wouldn’t run and I would get a Class Module error. Took me a week to try and figure out that error. I end up deciding to redo what I wrote and for some odd reason it worked. Who knew….. That would of saved me a lot of time. I’m sure it was some typo or some small error I accidentally made. Anyway I finally got the the timezone module to work and was able to get the graphical look to my module. However, when I select a timezone it doesn’t store the selected data and implement it. I’ve been trying a number or different things but it doesn’t seem to make any improvement on what I already have.

I’ve sent an email to Martin Gracik in regards to the problem I’m having with my timezone.py script. We are currently sending responses back and forth. He mention that he has a module with the timezone setting that I could use. I am currently waiting for a response and to see where that will take me.

This is my timezone.py script:

import gtk
import os, string, sys, time

from firstboot.config import *
from firstboot.constants import *
from firstboot.functions import *
from firstboot.module import *

import gettext
_ = lambda x: gettext.ldgettext(“firstboot”, x)
N_ = lambda x: x

sys.path.append(“/usr/share/zoneinfo”)
from scdMainWindow import scdMainWindow

class moduleClass(Module):
def __init__(self):
Module.__init__(self)
self.priority = 89
self.sidebarTitle = N_(“Time Zone”)
self.title = N_(“Time Zone”)
self.icon = “system-config-date.png”

self.scd = None

def apply(self, interface, testing=False):
if testing:
return RESULT_SUCCESS

try:
rc = self.scd.firstboot_apply()
if rc == 0 and self.scd.closeParent:
return RESULT_SUCCESS
else:
return RESULT_FAILURE
except:
return RESULT_FAILURE

def createScreen(self):
self.vbox = gtk.VBox(spacing=5)
self.scd = scdMainWindow(firstboot=True, showPages=[“timezone”])
self.vbox.pack_start(self.scd.firstboot_widget(), False, False)

def initializeUI(self):
pass

Leave a comment

GIT

This week in class we learned GIT! The objective of the lab is to add our public key to a branch and upload it back to the professor to merge it to his master branch.

I will use git clone to clone a repository into a newly created directory on my own computer.
[root@challahar ~]# git clone ssh://sbr600@scotland.proximity.on.ca/~/certs
Cloning into certs…
sbr600@scotland.proximity.on.ca’s password:
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 2), reused 0 (delta 0)
Receiving objects: 100% (10/10), done.
Resolving deltas: 100% (2/2), done.

[root@challahar ~]# cd certs/

Going to read the instructions that the teacher provided
[root@challahar certs]# cat readme.txt
This GIT repo contains public certs for all SBR600 students.

Please add your public key cert, using the filename “YourMatrixID.pub”
(replace YourMatrixID with your actual Matrix ID).

To add your cert:
1. Clone this repository to your computer: git clone …
2. Create a new branch: git checkout -b …
3. Add your files: git add …
git commit …
4. Check the logs. Everything look ok? git log
5. Push your branch: git push origin YourBranch:YourBranch
[root@challahar certs]#

I will create a branch called celeste and switch to that branch with the following command:
[root@challahar certs]# git checkout -b celeste
Switched to a new branch ‘celeste’

[root@challahar ~]# cd certs/

Create a copy of my public key and rename it challahar.pub
[root@challahar certs]# cp /home/challahar/Desktop/id_rsa.pub challahar.pub
[root@challahar certs]# ll
total 12
-rw-r–r–. 1 root root 396 Feb 16 05:22 challahar.pub
-rw-r–r–. 1 root root 412 Feb 16 05:07 ctyler.pub
-rw-r–r–. 1 root root 576 Feb 16 05:07 readme.txt
[root@challahar certs]# git add challahar.pub

I will then run the command git commit which will stores the current contents of the index in a new commit along with a log message from the user describing the changes.
[root@challahar certs]# git commit -m “Added the file challahar.pub”
[celeste a4c5b6c] Added the file challahar.pub
Committer: root
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

git config –global user.name “Your Name”
git config –global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

git commit –amend –reset-author

1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 challahar.pub

[root@challahar certs]# git config –global user.email challahar@learn.senecac.on.ca
[root@challahar certs]# git config –global user.name “Celeste Allahar”

This command show the commit logs
[root@challahar certs]# git log
commit a4c5b6c069b3bd31cb9a1daaeffc2dcbd16d15b1
Author: root
Date: Thu Feb 16 05:24:00 2012 -0500

Added the file challahar.pub

commit 2bf1886ad480445e33bca5aff5251a2dc7ef986f
Author: Chris Tyler
Date: Thu Feb 16 09:55:59 2012 -0500

Edited readme.txt

commit f9dc5090b8cfa7e535473fec6d130137ef700c17
Author: Chris Tyler
Date: Thu Feb 16 09:54:29 2012 -0500

Added ctyler, edited readme

commit ed36b6aa4b27efa15e4897161f2046c6f42c41ec
Author: Chris Tyler
Date: Thu Feb 16 09:48:07 2012 -0500

Initial commit

I will then send the branch that I created back to my professor.

[root@challahar certs]# git push origin celeste:celeste
sbr600@scotland.proximity.on.ca’s password:
Counting objects: 13, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (13/13), 2.03 KiB, done.
Total 13 (delta 2), reused 10 (delta 2)
To ssh://sbr600@scotland.proximity.on.ca/~/certs
* [new branch] celeste -> celeste

Leave a comment

Koji

For this lab my first problem was that I kept saying “Kioji” and not “Koji” like it was an anime character or something. Other than my friends correcting me and laughing, it wasn’t bad working with “Koji” *yeah I said it correctly*

I only had a little problem with koji because I liked to skip ahead and not read everything clearly which resulted in the error I got:

[challahar@challahar SRPMS]$ koji build d15 –scratch httptunnel-3.0.5-1.fc15.src.rpm
Unable to log in, no authentication methods available

I forgot to run the command to get authentication.

[challahar@challahar SRPMS]$ /usr/bin/fedora-packager-setup
Setting up Fedora packager environment
You need a client certificate from the Fedora Account System, lets get one now
FAS Username: challahar
FAS Password:
Saved: /home/challahar/.fedora-server-ca.cert
Linking: ~/.fedora-server-ca.cert to ~/.fedora-upload-ca.cert
Wrote sparc koji config file
Wrote arm koji config file
Wrote alpha koji config file
Wrote s390 koji config file
Wrote hppa koji config file
Wrote ppc koji config file
Wrote mips koji config file
Setting up Browser Certificates
Enter Export Password:
Verifying – Enter Export Password:

Browser certificate exported to ~/fedora-browser-cert.p12
To import the certificate into Firefox:

Edit -> Preferences -> Advanced
Click “View Certificates”
On “Your Certificates” tab, click “Import”
Select ~/fedora-browser-cert.p12
Type the export passphrase you chose earlier

Once imported, you should see a certificate named “Fedora Project”.
Your username should appear underneath this.

You should now be able to click the “login” link at http://koji.fedoraproject.org/koji/ successfully.

After following those steps to import my certificates, I had a problem with logging into Koji. When I click login it would lag there for a long time and nothing would load. It would continue to say connecting. However I spoke to Chris and he said, thats fine. So I was happy to hear that.

[challahar@challahar SRPMS]$ koji build dist-f15 –scratch httptunnel-3.0.5-1.fc15.src.rpm
Uploading srpm: httptunnel-3.0.5-1.fc15.src.rpm
[====================================] 100% 00:00:01 256.93 KiB 140.32 KiB/sec
Created task: 3757647
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=3757647
Watching tasks (this may be safely interrupted)…
3757647 build (dist-f15, httptunnel-3.0.5-1.fc15.src.rpm): free
3757647 build (dist-f15, httptunnel-3.0.5-1.fc15.src.rpm): free -> open (x86-14.phx2.fedoraproject.org)
3757648 buildArch (httptunnel-3.0.5-1.fc15.src.rpm, x86_64): free
3757649 buildArch (httptunnel-3.0.5-1.fc15.src.rpm, i686): free
3757648 buildArch (httptunnel-3.0.5-1.fc15.src.rpm, x86_64): free -> open (x86-12.phx2.fedoraproject.org)
3757649 buildArch (httptunnel-3.0.5-1.fc15.src.rpm, i686): free -> open (x86-09.phx2.fedoraproject.org)
3757648 buildArch (httptunnel-3.0.5-1.fc15.src.rpm, x86_64): open (x86-12.phx2.fedoraproject.org) -> closed
0 free 2 open 1 done 0 failed
3757649 buildArch (httptunnel-3.0.5-1.fc15.src.rpm, i686): open (x86-09.phx2.fedoraproject.org) -> closed
0 free 1 open 2 done 0 failed
3757647 build (dist-f15, httptunnel-3.0.5-1.fc15.src.rpm): open (x86-14.phx2.fedoraproject.org) -> closed
0 free 0 open 3 done 0 failed

3757647 build (dist-f15, httptunnel-3.0.5-1.fc15.src.rpm) completed successfully
[challahar@challahar SRPMS]$

Leave a comment

Mock

When starting to use mock I followed the instructions that was given to add myself to the mock group:

[root@challahar ~]# usermod -aG mock challahar

This is my mock result for httptunneling:

[challahar@challahar SRPMS]$ mock -r fedora-15-x86_64 httptunnel-3.0.5-1.fc15.src.rpm
INFO: mock.py version 1.1.18 starting…
State Changed: init plugins
INFO: selinux enabled
State Changed: start
INFO: Start(httptunnel-3.0.5-1.fc15.src.rpm) Config(fedora-15-x86_64)
State Changed: lock buildroot
State Changed: clean
State Changed: unlock buildroot
State Changed: init
State Changed: lock buildroot
Mock Version: 1.1.18
INFO: Mock Version: 1.1.18
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
State Changed: cleaning yum metadata
INFO: enabled ccache
State Changed: running yum
State Changed: creating cache
State Changed: unlock buildroot
INFO: Installed packages:
State Changed: setup
State Changed: build
INFO: Done(httptunnel-3.0.5-1.fc15.src.rpm) Config(fedora-15-x86_64) 1 minutes 23 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-15-x86_64/result
State Changed: end

Leave a comment

RPM Build

When I first started to create RPM packages, I was and slightly still am a bit lost. I had no clue what I was doing when starting. The first set of commands we’re pretty straight forward and easy enough to understand what it was doing. However when creating the spec file that was mess. After trying to fill in the each parameter that was left blank, I got a bunch of errors.
I’ve never seen so many errors in my life. However I realize that “tabbing” is the cause for most of the errors and not correctly filling out the changelog accordingly.The errors I had left, had me stumped:

***Note-to-self: make sure when labelling the name of a package that its exactly the same as the one your got from source.***

rpmbuild -ba httptunnel.spec

error: Installed (but unpackaged) file(s) found:
/usr/bin/htc
/usr/bin/hts
/usr/share/man/man1/htc.1.gz
/usr/share/man/man1/hts.1.gz

RPM build errors:
Installed (but unpackaged) file(s) found:
/usr/bin/htc
/usr/bin/hts
/usr/share/man/man1/htc.1.gz
/usr/share/man/man1/hts.1.gz

I later realize that reading is important because everything to explain these errors, are on the website. However with some help from my peers, I was able to fix my errors. The reason for my errors was because I didn’t place any predefine macros in my spec file. By doing so These errors were fixed.

I ran the commands to test the RPMs that I built:
[challahar@challahar SPECS]$ rpmlint ~/rpmbuild/SPECS/httptunnel.spec
/home/challahar/rpmbuild/SPECS/httptunnel.spec:4: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 4)
0 packages and 1 specfiles checked; 0 errors, 1 warnings.

After fixing my spacing and tabbing errors:
[challahar@challahar SPECS]$ vi httptunnel.spec
[challahar@challahar SPECS]$ rpmlint ~/rpmbuild/SPECS/httptunnel.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.

Needed to change the License that was written to fix this error:
[challahar@challahar SPECS]$ rpmlint ~/rpmbuild/SRPMS/httptunnel-3.0.5-1.fc15.src.rpm

httptunnel.src: W: invalid-license GPL
httptunnel.src:4: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 4)
1 packages and 0 specfiles checked; 0 errors, 2 warnings.

Leave a comment

Building From Source

The programs that I choose to build from source is nettle, http tunneling and smalltalk.

Nettle Steps:

Step 1. wget http://ftp.lysator.liu.se/pub/security/lsh/nettle-2.1.tar.gz
Step 2. tar xvzf nettle-2.1.tar.gz
Step 3. cd nettle-2.1
Step 4. ./configure
Step 5. time make

real 0m14.072s
user 0m9.779s
sys 0m2.994s

Http Tunneling Steps:

Step 1. wget http://www.nocrew.org/software/httptunnel/httptunnel-3.0.5.tar.gz
Step 2. tar xvzf httptunnel-3.0.5.tar.gz
Step 3. cd httptunnel-3.0.5
Step 4. ./configure
Step 5. time make

real 0m1.127s
user 0m0.744s
sys 0m0.175s

Smalltalk Steps:

Step 1. wget http://ftp.gnu.org/gnu/smalltalk/smalltalk-3.2.4.tar.gz
Step 2. tar xvzf smalltalk-3.2.4.tar.gz
Step 3. cd smalltalk-3.2.4
Step 4. ./configure
Step 5. time make

    real 0m55.418s
    user 0m48.178s
    sys 0m5.627s
Leave a comment

Getting Started

Hello, My name is Celeste Allahar. I am currently a semester 6th student at Seneca College. I am excited to be working on the Raspberry PI Project as well as working with the open source community, where I will get a better insight on how the community works together.

Week 1

Communication Lab
1. Sign up for Fedora: My Fedora Webpage
2. Sign up for Wiki: My Wiki Webpage
3. Create IRC username: Challahar