Planet Open Ghana

May 25, 2013

Joachim Breitner

My first CTAN package: Typesetting Continued Equalities

I recently had a TeX itch to scratch: I am working on a paper that has several multi-line continued equalities¹ where, depending on the size of the expressions and the explanations of each step, I chose among a few layouts. But implementing the layout together with the actual code was inefficient, as switching the layout involved changing every line.

So I came up with the package conteq which allows you to typeset continued equations in a simple declarative manner, e.g.

\begin{conteq}
  e^{\pi\cdot i} \\
= -1               & Euler's formula \\
< 0                & this is an inequality \\ 
< \sqrt 3 \\
= \int e^{-x^2} dx & this is due to Gauss.
\end{conteq}

and allows you to select the layout via an parameter to the environment, or globally, or either. Also, the styling of the explanations (italics? wrapped in {...}?) can be configured simply by redefining a macro. For more details and an overview of the various styles, check out the package documentation.

If this sounds useful to you, fetch the conteq package from CTAN. But beware: It uses quite current features of the expl3 package, so you need at least the version from 2012/07/02 (TeXLive 2013 is good). You can file bug reports at the GitHub mirror of my git repository.

I’d like to thank Bruno Le Floch and Joseph Wright, who made me aware of expl3 on various TeX Exchange questions.

¹ I haven’t heard of this term before, but supposedly it is the right translation for the German word „Gleichungskette“.

by nomeata (mail@joachim-breitner.de) at May 25, 2013 02:05 PM

May 17, 2013

Henry Addo

Ushahidi Android app 3.1.6

Yesterday I successfully pushed a new release of the Ushahidi Android app to the Google Playstore. Big thanks to my colleague @AngieNicoleOD for making a huge social media push for the release. I see two forks on github for both Ushahidi Android and the Ushahidi Java SDK already and @digitalafrican for the awesome feature graphic on the Playstore

You can read more about the release on the Ushahidi blog — http://goo.gl/YOstp

I’m all set for the next milestone — http://goo.gl/93a0t. As you may or may not know, this is an open source project. Your contributions are welcome.

The post Ushahidi Android app 3.1.6 appeared first on InfoZone.

by Henry Addo at May 17, 2013 06:58 AM

May 15, 2013

Henry Addo

Slated the upcoming release for Ushahidi Android tomorrow…

Slated the upcoming release for Ushahidi Android tomorrow. Now the heat is on. Guys expect exciting news tomorrow

The post Slated the upcoming release for Ushahidi Android tomorrow… appeared first on InfoZone.

by Henry Addo at May 15, 2013 03:33 PM

May 11, 2013

Joachim Breitner

How to play Rock-Paper-Scissors online?

There was an interesting question by ‘Fool’ recently on the StackExchange site for Boardgames: How do you play a game like Rock-Paper-Scissors with friends online? Or any other game where players have to simultaneously submit their moves (e.g. Diplomacy, or Rock-Paper-Scissors-Lizzard-Spock), which, as I just learned, are simultaneous action selection games. While there are websites dedicated to playing specific games, such as webdiplomacy.net, we could not find a generic one that you can use if you, for example, invent your own variants of a game.

So I created one: At you-say-first.nomeata.de you can enter rooms and share the URL with your friends. On the one hand, you have a regular chat room there. But there is also the possibility to enter moves (whatever a move may be to you) and only when all players have done that and marked the move as final, it is shown to everyone. If you want to try it out: There is an integrated, not very fancy Rock-Paper-Scissors-playing bot. Just enter a room, join and say „I want to play!“

Note that this site can be used for more than just for games. Have you ever observed that persons would often want other to express their preference (e.g. where to dine) first to not reveal their own preference, so that they can (or pretend to) change their mind if they would contradict? In such situations simultaneous action selection can be a fairer method.

A technical note: I created this web app using meteor (a JavaScript framework building on node.js and MongoDB that allows for reactive programming), and it is also hosted on meteor.com. I chose Meteor after someone mentioned Firebase to me, which looked very slick, but was not Free Software, so I looked for alternatives. I did not do any cross-browser-testing, and the UI design could be improved, so if you want to help out (or just complain), please use the GitHub code repository and issue tracker.

by nomeata (mail@joachim-breitner.de) at May 11, 2013 10:26 AM

April 24, 2013

Joachim Breitner

The carbondioxide footprint of Debian's Haskell packages

By now, Debian ships quite a lot of Haskell packages (~600). Because of GHC's ABI volatility, whenever we upload a new version of a library, we have to rebuild all libraries that depend on that. In particular, if we upload a new version of the compiler itself, we have to rebuild all Haskell library packages. So we have to rebuild stuff a lot. Luckily, Debian has a decent autobuilding setup so that I just need to tell it what to rebuild, and the rest happens automatically (including figuring out the actual order to build things).

I was curious how much we use the buildd system compared to other packages, and also how long the builders are busy building Haskell packages. All the data is in a postgresql database on buildd.debian.org, so with some python and javascript code, I can visualize this. The graphs show the number of all uploads by autobuilder on the amd64 architecture, with haskell uploads specially marked, and the second graph does the same for the build time. You can select time ranges and get aggregate statistics for that time span.

During the last four days a complete rebuild was happening, due to the upload of GHC 7.6.3. During these 2 days and 18 hours building 537 packages took 48 hours of build time and produced 15kg of CO2. That is 94% of all uploads and 91% the total build time. The numbers are lower for the whole of last year: 52% of uploads, 31% of build time and 57kg of CO2. (The CO2 numbers are very rough estimates.)

Note that amd64 is a bit special, as most packages are uploaded on this architecture by the developers, so no automatic builds are happening. On other architectures have, every upload of a (arch:any) package is built, so the share of Haskell packages will be lower. Unfortunately, at the moment the database does not provide me with a table across all architectures (and I was too lazy to make it configurable yet).

by nomeata (mail@joachim-breitner.de) at April 24, 2013 11:36 AM

March 21, 2013

Henry Addo

Android Stop Shitting On My Home Screen

I don’t know if this is a feature or a bug. When you install an app from the Google play store, it annoyingly creates an app icon on your home screen. This is something I don’t mind dealing with as I organize( categorize) my icons on my home screen, so its easier to drag the icon to the right category. The annoying part happen when let say I forget to organize my icon and I uninstall the app. I expect Android to garbage collect the garbage it created on my home screen but it doesn’t. If I repeatedly uninstall, re install the same app, you can image the mess it creates. Just see the image below to see what I mean.  And oh, when you uninstall the app, and tap on the icons on the home screen, they flash a toast in your face.

Screenshot_2013-03-21-00-14-33 (1)

The post Android Stop Shitting On My Home Screen appeared first on InfoZone.

by Henry Addo at March 21, 2013 02:00 PM

SMSSync v2.0.2 Released

pending

I just made a new release of SMSSync. For those of you wondering, what in the hell is SMSSync? It’s a product by Ushahidi, which is a free and open source Android application that turns an Android device into an SMS gateway. It forwards the SMS that comes to the device to a configured web service. This is one of my projects at Ushahidi.

This release has long been coming but I’m happy to announce it’s finally here. You can install it from the Google play store or build it from the github repo.

The change log has the list of changes from previous releases and the current release. If you’re curious to know what these changes are, take a peek at the change log.

This is a an open source project. Your contributions are highly encouraged and they will be humbly accepted.

The post SMSSync v2.0.2 Released appeared first on InfoZone.

by Henry Addo at March 21, 2013 12:02 AM

March 19, 2013

Henry Addo

Add Third-party Installed App Launchers To Gnome Shell

Adding third party installed applications to Gnome Shell launcher is very easy. I’m going to show you a sample code and where to install it.
Adding a launcher will allow you to search and launch the application from the Gnome shell without having to do that from the command line or adding where you installed the app to your $PATH variable. It also allow you to favorite the application so it stays on the side menu bar.

Let say you’ve Eclipse installed in /opt/eclipse.

  • Create a file in ~/.local/share/applications/
  • Name the file the same as the name of the binary file of the application. This will allow you to favorite the application on the side menu bar.
  • Paste the code below and modify it accordingly. I have provided the necessary comments to help you understand the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[Desktop Entry]
Encoding=UTF-8
# Name of the application for searching and labeling
Name=SublimeText2
 
# Give a blob about the application
Comment=Eclipse Integrated Development Environment
 
# Path to the binary file of the application
Exec=/opt/eclipse/eclipse
 
# The application Icon. PNG and XPM supported
Icon=/opt/eclipse/icon.xpm
 
# The Application Category to add this application to. 
Categories=Development;IDE
Version=1.0
StartupNotify=true
Type=Application
Terminal=0
  • Now save.

That is it!

The post Add Third-party Installed App Launchers To Gnome Shell appeared first on InfoZone.

by Henry Addo at March 19, 2013 11:15 AM

February 06, 2013

Joachim Breitner

Evaluation-State Assertions in Haskell

I have just uploaded a new version of ghc-heap-view to Hackage that provides “Evaluation state assertions” in the module GHC.AssertNF.

Imagine you are writing a web application in Haskell that sports a global number-of-visitors counter in an IORef Int. For every request, you call modifyIORef (+1). Eventually, you notice your very popular web site to hog more and more memory. So you browse to the internal page that shows the counter, and you have to wait for a long time until you eventually see the result (or get a stack overflow). The reason: The applications of  (+1) were not performed until you looked at the number; instead, a long chain of such computation first filled your heap and then your stack.

So you have learned the hard way that you might want to avoid space leaks, and want calculations to be done during the request that caused them, and want the IORef to always contain fully evaluated data. So you stumble about modifyIORef' in Data.IORef and indeed, this fixes your problem.

Later, you notice that you want to count POST and GET requests separately. You change the type to IORef (Int, Int) and call modifyIORef' (first (+1)) or modifyIORef' (second (+1)). And suddenly, the space leak is back (which you only notice after the next push to the real site, because your local tests never caused enough requests to make it noticeable). So you not only want to fix it, you also want to ensure that it does not break again.

In other words, you want to ensure the policy that values stored in an IORef are always in normal form. You achieve this with the following alternative to modifyIORef':

modifyIORef'Assert :: IORef a -> (a -> a) -> IO ()
modifyIORef'Assert ref f = do
    x <- readIORef ref
    let x' = f x
    x' `seq` return ()
    assertNF x'
    writeIORef ref x'

Using this instead of modifyIORef' will print this warning to standard error output right the first time you call modifyIORef'Assert (first (+1)):

Parameter not in normal form: 2 thunks found:
let x1 = (S# 1,S# 1)
in _bh (_thunk x1 (_bco (S# 1)),_sel x1)

(Otherwise, the program runs as usual.) So obviously, you need to use a strict variant of first (or strict pairs):

first' :: (a -> b) -> (a, c) -> (b, c)
first' f (x,y) = let { x' = f x; r = (x', y) } in x' `seq` r `seq` r

With this, the warning goes away. Whenever you now change the type of the IORef or modify it in a too-lazy-way, you can be sure that you’ll be warned about it, before the space leak itself becomes noticeable.

In the production code, you might want to disable the check. For that, simply put disableAssertNF somewhere in your main function.

Why is this better than just calling deepseq in modifyIORef'Assert? Because this way, the code still creates unwanted thunks that are then evaluated before storing them in the IORef, whereas with assertNF you are told about the thunks and can prevent them from being created in the first place. Also, assertNF does not add a type class constraint.

This is just one example application for assertNF (and its variants assertNFNamed, which includes a name in the warning to better spot the cause, and $assertNFHere, which uses Template Haskell to include the current source code position in the warning), and I hope that there are more. If you happen to make use of it, I’d like to hear your story.

by nomeata (mail@joachim-breitner.de) at February 06, 2013 09:33 AM

January 31, 2013

Joachim Breitner

Going to FOSDEM after all

Earlier this week, things were looking different, and I did have to cancel a Haskell talk in Freiburg on Monday due to illness. But I’m back on track and will be travelling to Brussels tomorrow.

I’ll be holding a talk on how we package Haskell in Debian, on Suday at 15:30. I hope it will be useful to Debian users (who will better understand the packaging), other Debian Developers (who’ll learn about the peculiarities of Haskell and the implications for the Debian infrastructure), other distro’s maintainers (to compare best practices) and Haskell developers (to learn about the needs and worries of downstream packages). The talk will be based on my DebConf 11 talk on the same topic. I’m also happy to answer questions about Haskell, Haskell in Debian or any other topic that you want to hear my opinion about, so just talk to me during FOSDEM.

In related news: GHC 7.6.2 was uploaded to Debian experimental the day it was released; the rebuilding of all libraries is still in progress (~370 of ~570 done).

by nomeata (mail@joachim-breitner.de) at January 31, 2013 08:03 PM

October 30, 2011

Odzangba Dake

Iotop Crashes When Not Run As Root

Welcome to another an-update-broke-me-box post. Iotop now requires root access:

:~$ iotop -o
Traceback (most recent call last):
File "/usr/bin/iotop", line 16, in <module>
main()
File "/usr/lib/pymodules/python2.6/iotop/netlink.py", line 229, in recv
raise err
OSError: Netlink error: Operation not permitted (1)

To fix it, run iotop as root:

sudo iotop -o

There’s a lively debate here between the iotop author, Guillaume Chazarain, and Linus Torvalds  on the pros and cons of requiring root access for throughput statistics. It’s another linux developer classic with Linus using words like abortion, castration, disaster, utter crap… makes for a few laughs if you can spare a couple of minutes.


by Odzangba at October 30, 2011 06:01 PM

October 18, 2011

Odzangba Dake

How To Download Flash Videos On Ubuntu 11.04

It seems Adobe is on a mission to make downloading Flash videos as difficult as possible for those of us used to grabbing them from /tmp. A few weeks ago, I noticed Flash videos were no longer being saved in the /tmp directory. Instead, they were being placed in the browser’s cache folder… minor inconvenience, life goes on. After a recent update however, the files  are no longer being saved in the cache folder. A quick

lsof | grep -i flash

gave me:

plugin-co 26044          o   17u      REG        8,1  2020248     393786 /tmp/FlashXXxaK1Jq (deleted)

You guessed it… there is no file called FlashXXxaK1Jq in the /tmp directory. I see what you did there Adobe, nice one. I’ll spare you most of the technical details but the output indicates that the file is somewhere in the /proc directory. Using the process id 26044 (the second field in the output of the lsof command), we can hunt down the file FlashXXxaK1Jq in the /proc directory. So:

cd /proc/26044/fd ; ls -l | grep FlashXXxaK1Jq

will give you something like:

lrwx------ 1 o o 64 2011-10-18 10:30 17 -> /tmp/FlashXXxaK1Jq (deleted)

So the flash video is named 17 and being symlinked in a sneaky manner to /tmp/FlashXXxaK1Jq (deleted). Now do something like:

cp 17 ~/Videos/funny-youtube-video.flv

and you’re done. Go back to your Videos folder and watch that cat playing the piano to your heart’s content.

And now, I must cover my tuchis so here goes… downloading copyrighted material may be illegal where you live.


by Odzangba at October 18, 2011 12:11 PM

May 15, 2011

Odzangba Dake

How To Ping NETBIOS Names On Ubuntu

I make heavy use of the ping utility on a daily basis and it absolutely galls me that Ubuntu cannot ping hostnames by default. I need to use the nmblookup utility to find the ip address of the machine I want to ping and then ping that ip address… primitive, silly, unnecessarily complex… I feel a rant about idiotic default settings and legal gymnastics surrounding the universe repository coming up so I’ll just get on with the post. :D

1) Back up and edit the /etc/nsswitch.conf file by copying and pasting the following commands:

sudo cp /etc/nsswitch.conf /etc/nsswitch.conf.original

gksu gedit /etc/nsswitch.conf

2) Add wins to the hosts directive:

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4

3) Install WINBIND:

sudo apt-get install winbind

4) Ping away. :)


by Odzangba at May 15, 2011 12:40 AM

May 14, 2011

Odzangba Dake

How To Restore GRUB On Ubuntu 11.04

Since version 9.10, Ubuntu uses the GRUB2 boot loader and manager on clean installs. This means my earlier post on how to restore GRUB will not work properly. To restore the boot loader on these versions of Ubuntu (and possibly any debian-based linux distribution that uses GRUB2), you need an Ubuntu 11.04 live disk. The 10.10 live disks will work too… any ubuntu live disk that uses GRUB2 will work. Fire up a terminal once the live disk finishes loading and enter the following commands:

I) Let’s find where Ubuntu is installed on your hard disk:

sudo fdisk -l

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2611 20972826 83 Linux
/dev/sda2 2612 60279 463218210 83 Linux
/dev/sda3 60280 60801 4192965 82 Linux swap / Solaris

My ubuntu partition is /dev/sda1 (it has the asterisk under Boot).

II) Armed with this information, mount the Ubuntu partition:

sudo mount /dev/sda1 /mnt

III) Install the GRUB2 boot loader:

sudo grub-install --root-directory=/mnt /dev/sda

That’s /dev/sda — the hard disk itself, not the ubuntu partition – /dev/sda1.

IV) Unmount the Ubuntu partition and restart the computer like so:

sudo umount /dev/sda1 ; sudo reboot

V) If you have more than one OS installed, re-detect OSes like so:

sudo update-grub

That’s it.


by Odzangba at May 14, 2011 11:37 PM

January 11, 2011

Odzangba Dake

Manage Multiple Computers With Synergy

It’s lightweight, cross-platform and allows me to share one keyboard and mouse among several networked computers…

Synergy Desktop

and it’s called Synergy. Visit the download page and grab the appropriate installers. Click here for instructions on how to configure your dekstops. Ubuntu users can avoid a text configuration file by installing a GUI configuration app like so:

sudo apt-get install quicksynergy

Have fun. :)


by Odzangba at January 11, 2011 05:02 PM

June 29, 2010

Kofi Boakye

I love my country

It had to take the on going world cup to really bring the fact home to me …but i really love my country, mother land and land of my birth , the black star of Africa…GHANA…GHANA (GH) totally rocks…Go Black Stars and make the whole Africa proud


by kdex at June 29, 2010 02:21 PM

November 16, 2009

George Gyau

Is been a long time

Is been like ages since i blogged. Is been crazy for me since i got back to Ghana, land of my birth. but i am finally in control and want to start blogging seriously. expect more now.

Currently moved this BLOG to http://www.egoleo.net


by egoleo at November 16, 2009 10:58 AM

October 06, 2009

Kofi Boakye

The Global Village

If the world is now a global village, then I guess Aunt Araba can go and spy on what Mrs Obama is cooking for supper nd we the village elders sit and drink some pito with Osama and Gordon Brown while the German chancellor plays ampe with Sirleaf Johnson.Now where r the power chaskele boys , Mugabe and Wen Jiabao??

ah these boy paa !!

(Memoirs of a global village elder)


by kdex at October 06, 2009 02:19 PM

Karmic Kaola Goodness !!

Wow!!

Just spent over three hours downloading the Karmic Kaola beta  over a crappy wireless connection.

And I just got to shout “Wow!!”. Beta saf be this. Man, they really put some good work into this stuff.Little touches here and there . And I think my screen display just increased or something cuz there seems to be more space on the desktop. No kidding !! It is really worth the long wait , short fevered naps and the ever present angelically annoying mosquitoes buzzing and taking painful dives at my body…Karmic Kaola rocks , though there’s still more work to be done..And this time I hope to be part of it contributing my quota to it!!

Screenshot


by kdex at October 06, 2009 06:50 AM

September 19, 2009

Kofi Boakye

From Gnome to KDE and back again

First cut is the deepest as they say and its really

I tried KDE 4.3 over the week and I must admit they got some bling,bling. Wow!! Great work, guys and ladies.. The panel looked more spacious and the various effects and widgets/ plasmoids were just amazing !! And the preview effects in Dolphin were just over the top. (Top that if u can, Windows 7)

But then ,bam, without any warning stuff just started to mess up .First it was my Intel graphics cards not agreeing with compiz.(though KDE still looked good and handled ok without the bling,bling) Then KPackage Kit just made me boil with its interface. I mean, if I want to go through the list of available and installed software I d**n well want to see it all without typing keywords to get a list. sheesh!! Of course it just made me love Synaptic all the more)

Finally I just gave up and guiltily run back to Gnome. So simple!

Of course I’m waiting with huge anticipation for the final version of Karmic Kaola. Even the Alpha releases do show some serious improvements that  make me swell extra extra with pride at being a linux user. Go Karmic Kaola team!! All the best !!

After Karmic , I’m definitely gonna become a full time evangelist for Linux Usage in Ghana….


by kdex at September 19, 2009 10:05 PM

July 01, 2009

Kofi Boakye

Back Again !!

Hello World

Its sure been a while since i last posted on this blog.

However i’m back and this time i hope to put up new stuff everyday about what i’m currently doing .Hoping to start releasing some serious apps for the linux world soon.

Adios amigos


by kdex at July 01, 2009 05:47 PM

March 05, 2009

Kwasi Kwakwa

What else I’ve been watching

I started this post when I was talking about The Wire, I figured I’d put out a list of what else has been keeping my attention TV wise these days. Its late, but I already wrote most of it so I figured why not. I’m not really a huge TV person, never have been. I tend to time-shift my shows and then watch them when I’m not doing anything else, which usually ends up being late at night.

  • Battlestar Galactica: This has been one of my favourite television shows of the last few years and is now heading towards an ending. If you haven’t seen any of it, you should have. Its really, really good. Basically its a rimagining of on old science fiction show in which the human race is wiped out my a race of machines we’ve created and the survivors are forced to run for their lives while being hunted by the same machines. Along the way thugh it becomes a great meditation on the nature of humanity, morality, religion etc. Its science fiction at its upper end. I recommend highly.
  • Big Bang Theory: This I was determined not to like. Its a sitcom about a pair of socially awkward physicists and their friends. I pretty much expected that the writers would settle for the dumbest possible nerd stereotypes, add no real depth and screw the story up. Instead, they kept the stereotypes but managed to add enough depth and authenticity to make them real people. Interestingly enough, there are quire a few scientists I know who are followers of the show because of how well its written and the inside jokes it throws our way. Also recommended
  • The Unit: Dennis Haysbert shooting people and looking cool in the process. Need I say more? Its a bit on heavy handed in its stance at times,but its great pulp action and good acting. All things I’m partial to.

Other stuff I’m watching but not so keen on writing a short paragraph about, Mobile Suit Gundam 00 and  the new season of Hajime No Ippo (yes, I like anime. It doesn’t say geek up there because I couldn’t come up with another name)

I was also watching Dr. Who and Torchwood until both seasons ended. I’m really, really waiting for them to start back up again, even though they shall no longer be servicing my Freema Agyeman crush. Again, if you are a science fiction fan and not watching these, your loss. Majorly.


by kwasi at March 05, 2009 11:00 PM

March 04, 2009

Kwasi Kwakwa

In which the absentee host returns. Again

A very belated happy new year to you people. Apologies for the long absences. Again. At this point I’m pretty sure I’m down to just the people who forgot to remove me from their feed readers.

Quick Updates on what I’ve been up to:

I was officially awarded my Masters by Research in Physics. My parents and big sister were in town for my graduation and that will easily pass for my best day this year. Since then I’ve gotten accepted into a physics PhD program with the same advisor at the same university. 3 more years of this and I get to walk across a stage again in a gown with a hood on it and put ‘Doctor’ on my business cards.

On the Physical side. I persist with my judo and have now logged hundreds of hours of being thrown around, pinned, choked and armlocked. On good days I get to do the same to other people. In a little under 2 weeks I get to compete in the BUCS(British Universities and Colleges Sport) kyu grade competition. Hopefully all that work will end up in me getting a few good throws. Either way there will be pictures and maybe even video. At some point before I get the PhD I want to get my first dan(black belt)

Otherwise, I live in London, I study, I train, I hang out with friends, I still read too much, I watch the odd movie and life continues.

There’s a bit of a backlog of topics I was planning to write about but never got around to. Some will make it out in the coming weeks, some won’t. Either way, keep me in your readers people. If nothing else I need the touch typing practice


by kwasi at March 04, 2009 11:43 PM

November 05, 2008

Kwasi Kwakwa

HE WON!!!!!

The next first family of the USA

Yes, I stayed up all night to watch the results come in. I’m still not entirely sure it happened though.

We are officially living in interesting times people. Lets see how it goes


by kwasi at November 05, 2008 12:19 PM

November 03, 2008

Kwasi Kwakwa

*Hat tip*

H & H

H & H

Great race. And hopefully a good omen.


by kwasi at November 03, 2008 10:55 AM

October 15, 2008

Kwasi Kwakwa

Recent additions to the bookshelf

One of the advantages of this past year has been a commute from the south of London to the center of the city daily that meant I had between 1 1/2 and 2 hours sitting or standing while waiting to get where I was going. Sometimes that went to reading academic papers for my masters, but a lot of the time it went to recreational reading. Add that to the fact that I got a library card as soon as I could(making this the sixth city on the third continent where I have paid library fines) and I was able to get through quite a few books. Well, considering that I was in school at the time.

The highlight list includes:

That’s not a fully complete list, but those are most of the books I remember. Well, there’s also a bunch of classic science fiction books, but I’ll talk about those later


by kwasi at October 15, 2008 09:46 PM

September 08, 2008

George Gyau

How do I disable the ping response?

Usually a ping is used to check if a machine is up and to check the network status.

It is a small network packet sent to the machine. If the machine is up, an answer will be sent. The time needed to get the answer is called ping time or round-trip time.

The ping response from an IP indicates the machine is up.

Unfortunately this can be used to quickly scan an IP-range for reachable hosts.

This can be used to find potential hackable machines. If your machine doesn’t answer to pings, your chance to be seen is reduced. (That doesn’t mean your machine is more secure, the machine is just not that easy to be seen from the internet. Nothing more.)

Add the following line to your init script for the network (the name depends on the distribution you use):

echo 1 >/proc/sys/net/ipv4/icmp_echo_ignore_all

This disables ping responses.

To reenable, use the following command:

echo 0 >/proc/sys/net/ipv4/icmp_echo_ignore_all

To make this permanent set the following into /etc/sysctl.conf (if you have such a file)

net.ipv4.conf.icmp_echo_ignore_all = 1


by egoleo at September 08, 2008 03:37 PM

Custom teaser length by View using node.tpl.php

I have been working on this project, http://www.newsafrican.com which is a news site which focuses on everything african news. This project is been built on the Drupal CMS which is very flexible arguably.

I got into a situation where i have to customise the teaser length by View which happens to be one of the Drupal modules using node.tpl.php.

One way to vary teaser lengths is to check the current View with a modified node.tpl.php modify the output based on this

In this example a teaser of length 75 or 150 will be shown for the Views “frontpage” and “ghana_page” respectively.

I worked on this for Drupal 5 with the help of the good guys in the drupal IRC rooms, my solution is below. But this is a solution for Drupal 6 by friends on the drupal-support channel of IRC.

<div class="node<?php print ($sticky) ? " sticky" : ""; ?>">
<?php if ($page == 0): ?>
<?php else: ?>
<?php print $picture ?>
<em class="info"><?php print $submitted ?></em>
<?php endif; ?>

<?php
global $current_view;
if(
$teaser) {
if(
$current_view->name == ‘frontpage’)
{
?>

<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item['view'] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content['body']['#value'];
}

if($current_view->name == ‘ghana_page’)
{
?>
<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item['view'] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content['body']['#value'];
}

if($current_view->name == ‘africa_page’)
{
?>
<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item['view'] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content['body']['#value'];
}
if(
$current_view->name == ‘business_page’)
{
?>

<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item['view'] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print $node->content['body']['#value'];
}

if($current_view->name == ‘gh1′ || $current_view->name == ‘gh2′)
{
?>
<?php foreach ((array)$node->field_news_image as $item) { ?>
<div class=”field-item”><?php print $item['view'] ?></div>
<?php } ?>
<h2><a href=”<?php print $node_url ?>” title=”<?php print $title ?>“><?php print $title ?></a></h2>
<?php print substr($node->content['body']['#value'], 0, 90). ‘&nbsp;’;
?>
<a href=”<?php print $node_url ?>” title=”read more”>read more</a><?php
}
} else {
print
$content;
}
?>


by egoleo at September 08, 2008 05:23 AM

September 02, 2008

George Gyau

S Leone president declares assets

President Ernest Bai Koroma has become the first head of state in Sierra Leone to declare his assets to the country’s Anti-Corruption Commission.

As i read this news item, i was wondering when all other African leaders will do follow this. Expecially in Ghana were there is been much talk about such a thing. We always here leaders saying i already had my money or wealth before i came to power.

Koroma, i hope this will not be a nine day wonder, but to go beyond that let things work in S-Leone.


by egoleo at September 02, 2008 05:11 AM

Google launches internet browser

Google is launching an open source web browser to compete with Internet Explorer and Firefox.

The browser is designed to be lightweight and fast, and to cope with the next generation of web applications that rely on graphics and multimedia.

Called Chrome, it will launch as a beta for Windows machines in 100 countries, with Mac and Linux versions to come.

“We realised… we needed to completely rethink the browser,” said Google’s Sundar Pichai in a blog post.

The new browser will help Google take advantage of developments it is pushing online in rich web applications that are challenging traditional desktop programs.

Just waiting to try it out. :)


by egoleo at September 02, 2008 05:00 AM

December 22, 2006

Lorenzo E. Danielsson

Sign this

I finally did the right thing by going here and signing Bruce Perens’ petition against the Novell-Microsoft deal which everybody is talking about. If you value the freedom to write and share software, please read up carefully on the implications of this deal and, if you feel that Novell’s deal with Microsoft is a threat to those freedoms, do sign the petition as well.


by lorenzod at December 22, 2006 09:04 AM

Seasonal greetings

Today is the last work day before the holidays so Happy Yule everybody.


by lorenzod at December 22, 2006 07:32 AM

December 21, 2006

Lorenzo E. Danielsson

Vad i helvete..?

Idiot!

Hur kan någon vara så genomkorkad? Jag är givetvis 100% emot dödstraff, men om det skulle bli infört hoppas jag att “författare” som David Anderson blir de första in i gaskammaren. Men lyckligtvis kommer inte dödstraffet tillbaka så jag rekommenderar instället tjära och fjädrar.

Så vilka brott skulle dödstraff utdömas för? “De allra grövsta brotten”. Terrorism är ett exemples som ges. Okej, det kan jag gå med på att det är ett grovt brott. Och i så fall borde vi omedelbart hänga två superterrorister, nämligen Busken och hans pudel, Tony B. Liar.

För övrigt anser Anderson att landsförräderi och högförädderi är grova brott för vilket dödstraff borde utdömas. Eh, ursäkta mig? Landsförräderi???? Det är ju så idiotiskt att jag saknar ord. När blev det ett grovt brott? Nu när jag kommer att tänka på det, när blev det ett brott över huvudtaget?

Förbannade idiot!


by lorenzod at December 21, 2006 07:57 AM

December 18, 2006

Lorenzo E. Danielsson

Hilarious

Yeah, yeah, so God hates Sweden, so what? Sweden hates God as well.


by lorenzod at December 18, 2006 08:39 AM

December 14, 2006

Lorenzo E. Danielsson

Regn export

Eftersom ni i Sverige har överskott på regn, kan ni inte skicka lite till oss? I Ghana är det hett och torrt. Lite regn skulle verkligen hjälpa.


by lorenzod at December 14, 2006 08:17 AM