Archive

Posts Tagged ‘rest’

Network Manager on Slackware 13.0, the dirty and easy way

December 4th, 2009 bodom_lx 2 comments

I love to be back to Slackware, my very first distribution. However, there are a couple of things that I’m missing from the other more comfortable distributions. From among them, I totally miss Network Manager.
I saw many people asking in forums on how to install Network Manager in Slackware 13.0. There is Wicd, already present in Slackware “repositories”. Every Slackware maniac will tell you that it does the same job of Network Manager, but I don’t agree. It does not always work and is more complicated to be configured than NM.

Anyway, I’m going to explain to Slackware newbies the dirty way to have a fully working Network Manager on Slackware 13.0. This method is totally against Slackware philosophy and will also replace some important libraries of the system! Anyway, the packages being replaced are prepared from the guys behind GNOME SlackBuild, a project to bring Gnome in every Slackware release.
You have two way to have Network Manager in your Slackware: either install the entire Gnome from them (or any other similar project) or use slapt-get against their repositories and just install Network-Manager. Here are the instructions. All the following actions must be performed as root user:

  1. Download, install and configure slapt-get. Instructions are provided on their website.
  2. Update your system with:

    slapt-get –update
    slapt-get –dist-upgrade

  3. Add GNOME SlackBuild repository in /etc/slapt-get/slapt-getrc:

    SOURCE=http://mirror.switch.ch/ftp/mirror/gsb/gsb-current/

  4. Update the list of available packages and replace some system packages:

    slapt-get –update
    slapt-get –add-keys
    slapt-get –install –reinstall alsa-lib bluez glib2 gtk+2 libwnck

  5. Now install Network Manager and its GTK applet:

    slapt-get –install NetworkManager network-manager-applet

  6. Be sure that dbus, hal and NetworkManager daemons will be loaded at boot time:

    chmod +x /etc/rc.d/rc.messagebus /etc/rc.d/rc.hald /etc/rc.d/rc.networkmanager

  7. Add your user to the plugdev group. Edit /etc/group, find the line

    netdev:x:86:root

    Add your username after root (bodom_lx is my case)

    netdev:x:86:root,bodom_lx

  8. You are quite finished now! Log back as normal user and create a startup script for network-manager-applet:

    cd ~/.kde/Autostart/

    Create a file called nm-applet.sh with the following content:

    #!/usr/bin/bash
    nm-applet –sm-disable &

    Give it execution permission:

    chmod +x nm-applet.sh

    .

Reboot your system. Everything should work fine now.

To uninstall Network Manager and restore the system as it was before the installation follow these instructions, as root::

  1. remove any GNOME SlackBuild package using:

    removepkg /var/log/packages/*gsb

  2. Comment GNOME SlackBuild entry in /etc/slapt-get/slapt-getrc:

    #SOURCE=http://mirror.switch.ch/ftp/mirror/gsb/gsb-current/

  3. Update your slapt-get sources and re-install the replaced Slackware packages:

    slapt-get –update
    slapt-get –reinstall –install glib2 libwnck alsa-lib gtk+2

  4. Toggle execution permission to the auto-started network-manager-applet. Log back as normal user and type:

    chmod -x ~/.kde/Autostart/nm-applet.sh

Feel free to comment any suggestion.

Related posts

On the automation of API writing and XML-RPC serving for Python Django

November 10th, 2009 bodom_lx No comments

While searching for solutions on adopting Django for the server side of our Dynamic Car Pooling system, I found two very interesting projects:

  • WAPI – a framework which abstracts the details involved in publishing an API and translates class methods to API methods, serializing the objects returned when possible. WAPI handles authentication, too, and other advanced functions. It’s an amazing, fully Django compatible system that currently works over ReST (JSON, XML, YAML) but not with XML-RPC. Therefore, I contacted the author to have some information about the status of the project. It would be very interesting in our system, to provide API and XML-RPC services just by using his layer
  • RPC4Django – provides XML-RPC and JSON-RPC support to an existing Django project. It promises a XML-RPC interface by just adding the decorator @rpcmethod to an existing python function. It also fully integrates with Django authentication framework

I’m going to experiment with these two tools. Obviously the first one is the most interesting because of its ability to “export” services in more formats. But the most important protocol for us is missing. Let’s hope it will be added soon!

Related posts

Update: first UML diagrams, some implementation thoughts

October 29th, 2009 bodom_lx No comments

My third meeting at FBK is about to end. Today we discussed about some use-case, sequence and class diagrams I wrote during the week. Obviously there were lots of changes after the discussion and I will post them as soon as I’ve updated them. For the next time I will take a look at some implementation issues. The client side could be written using Android while for the server side we are seriously looking at Python and Django. It would be very interesting! For the communication, we are reasoning about XML-RPC, SOAP or a personalized Restful API. OpenTrip protocol might not be included in our implementation, as we don’t have the time to parse non-standard XML and adapt the system to use it. But this is not a final decision.
I will also write some simple mockups to test all the possible combinations.

Related posts

BD-review

July 29th, 2009 bodom_lx No comments

BD-review is a dynamic website to allow people to review releases (albums, demos, EPs, singles) of (young, unsigned) music bands. The project is the outcome of the Internet Technologies course at the Faculty of Computer Science of the Free University of Bolzano.  The requirements of the project were to build a website using a small subset of JavaEE technologies, without the use of web-frameworks.

Therefore, this project is not really meant for production use. It was made as a strong, working and correct base for studying JavaEE academically. It should be useful for every student (also non-student) willing to have an overview on JSP and study it. The code is well-written, uses MVC, and the whole project is documented in detail in a 20+ pages report.

A screenshot of a Review

A screenshot of a Review

I encourage to read the PDF report of the project. It contains detailed information about the analysis and design phases, as well as the architecture description, screenshots, problems found etc. Please read also the README file. It contains configuration instructions.

There is a running demo located on the evaluation server of the course, but I think it will be removed soon.

Quick Jump:

Vision

Requirements Implemented

Technologies Overview

Download

License

Vision

The aim of the project is to build a dynamic website to allow people to review releases (albums, demos, EPs, singles) of (young, unsigned) music bands. Users will be able to signal interesting materials and review them, while other users will be able to comment the reviews, too.
This web 2.0-oriented application should allow unknown talented musicians to achieve a higher notoriety but also to improve their productions.

Screenshot of the personal user page

Screenshot of the personal user page

Requirements Implemented

I report here the requirements of the course, all implemented by BD-review:
What BD-review implements is:

  • User Management
    • List existing users of the system
    • Creation of a new user
    • Deletion of the existing user
  • List and modify access rights of the users
    • check boxes with some capabilities (min 3)
  • User registration and login to the system
  • Items management
    • Users add, edit or remove items
    • Users comments or reviews items
    • Administrator can manage the comments (edit,remove, add)
  • Personalization
    • Salutation for a returning user
    • List resources that are new from the last visit
    • Customization of the layout for a class of users.
  • Techniques – MUST be used
    • Static HTML
    • CSS: all the look and feel must be in CSS files
    • Javascript: check input and manage menus
    • Servlet: Reading (parameters and headers) and writing headers and resulting page
    • Servlet: Session management with cookies and session object
    • Servlet: Redirect the client
    • Servlet: Forward to another page or servlet
    • JSP: Expressions, scriptlets and declarations Beans
    • DBMS access trough JDBC
    • Integration of JSP and Servlets (forward and include) using MVC pattern.

In addition, BD-review implements two Filters and plays with Regular Expressions.

Technologies Overview

  • J2EE technologies (JSP, Servlets and JavaBeans)
  • Database support (PostgreSQL 8.3) through JDBC 4
  • XHTML Strict 1.0 + Cascading Style Sheets 2.1 for presentation
  • Apache Commons for conversion and Bean population routines
  • Some utility methods found on Books and Internet (their provenience is cited in the sourcecode)
  • Javascript for confirmation system and form validation
  • Regular Expressions
  • TinyMCE rich WYSIWYG HTML editor
Screenshot: modifying a Review

Screenshot: modifying a Review

Download

PDF report of the project
Complete Source Code and Documentation (as Netbeans Project)

The Future

There will not be future developments for the project. It was not a real-life project but I will be very proud if you find it an useful example for learning JSP. You can also use it as a basis for developing a real project (also a University Project). You can do anything you want with BD-review, but please respect the license. I would be happy if you send me an email about your experience in using BD-review.

License

BD-review is released under The Gnu Affero GPL version 3! This is different from the license of the contents of the blog

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see < http ://www.gnu.org/licenses/ >.

Related posts

A useful list of Mind-Mapping tools for college students

July 28th, 2009 bodom_lx No comments

It has been brought to my attention an  article containing a list of 50 Mind-Mapping tools for college students.

The list is categorized (free/open, collaboration, project management, multitasking, misc) to assist the reader in the decision. I know five of the programs reported and I have always used Freemind, therefore I find the post very interesting. Students should at least try to use Mind-Mapping tools as an alternative to summarize texts. Give it a try!

Related posts

BD-incollo 0.9 is out!

July 26th, 2009 bodom_lx No comments

It took me about one year to find some time to enhance my project BD-incollo. I worked hard for 5 days and to add new features and fight the (huge) amount of spam that was wasting my database space. Now I’m very proud to announce bd-incollo 0.9, a free, light, speedy, anonymous Pastebin clone written in Python Django. This version introduces a lot of new features, including the possibility to make diffs between pastes, and fights spam using Akismet. Read more about the features on the project page and on the new News section on the website that makes use of BD-incollo, incollo.com .

BD-incollo 0.9 is free software as always, under the Gnu Affero General Public License 3.

Currently, you can:

  • Copy, Paste and store a text / source code snippet to the system
  • NEW! Give other people the possibility to discover your Paste (make a Paste either public or private)
  • Decide to colorize the syntax of the Paste
  • Share it using its URL
  • NEW! Enhance Pastes! Create a Paste starting from an old one
  • NEW! View differences! Makes use of the powerful diff-match-patch by Neil Fraser to see differences between two Pastes
  • NEW! Antispam protection using Akismet and akismet.py by Michael Foord
  • Download it as plain text
  • View it as plain text
  • Search something interesting through other pastes!
  • Report abuses to site admins

It also uses a very smart hash system that automatically re-computes a hash key in case of collision.

Here is an example of Paste: http://incollo.com/f341e6a4b
Here is an example of enhancement of the Paste: http://incollo.com/ba22929ac
Here is a full-screen diff of the Pastes: http://incollo.com/compare/f341e6a4b/ba22929ac

Play with them! Use incollo.com, spread it!

Road to 1.0

1.0 development will start after my next examination session (on September) and will surely include:

  • Some asynchronous improvements
  • The possibility to teach Akismet about Spam and Ham in Pastes (when admin user is logged in)
  • More cleaner code
  • The possibility to associate a user to its Pastes via a Cookie (always anonymous) and let him delete them
  • Comments to snippets?
  • What else? Contact me if you’ve got ideas!

Related posts