Archive for the 'Uncategorized' Category

Ugly icons after upgrading

I was doing some day the usual dist-upgrade to kep  recent my Debian squeeze. Everything went well, but there was a surprise next reboot and login. All the icons were ugly. The whole new style does not fit me, but the logout and shutdown button was disturbing ugly.

Here is how did it look before the upgrade:

The pretty icons

The pretty icons

And this is how did it look after:

The ugyli icons

The ugly icons

After the changes, I have tried all the other icon themes (by customizing the current theme) but most of them did not have an own version of these icons, nor were pretty. After that, I did a search for gnome icon themes, but I could not find this older theme or some other pretty (which has own versions of these icons). So I have realized that I have to hack something.

So, I have downloaded some previous gnome-icon-theme from the Gnome ftp site:

wget http://ftp.gnome.org/pub/GNOME/sources/gnome-icon-theme/2.26/gnome-icon-theme-2.26.0.tar.gz

After this, I have unpacked it, and did a make. For doing that, some devel packages are needed. I had to install icon-naming-utils, intltool and automake, autoconf.

apt-get install icon-naming-utils intltool automake autoconf

After that, I have compiled it :

cd gnome-icon-theme-2.26.0

./configure –prefix=/home/user/temp/somedir

make

make install

All I had to do was to tarzip the icon directory from the install directory

cd /home/user/temp/somedir/share/icons/gnome/

tar cf – . | gzip -f9 > ../gnome-icon-theme-2.26.tar.gz

Then I could install it within the Appearance preferences easily, and my pretty icons were back :)

No Comments »

admin on May 19th 2010 in Uncategorized

Sharing mobile net through router

Last weekend some horrible thing happened : Our internet service was deactivated for some silly reason. As some basic “internet feature” like mail, news are basic requirements for daily life, I had to solve this situation. Fortunately I have a pretty mobile internet connection so the idea has just came up to share the mobile net over the router so everybody can use the net without any changes made.

Setting up mobile connection through bluetooth:

Setting up the mobile connection on Debian is pretty easy. Under GNOME there is a pretty bluetooth applet called blueman which you can use to set your phone as a bluetooth modem. I have used bluetooth connection for the modem, because I can not charge and use the data cable at the same time. And then I did not have the data cable at home. Installing blueman:

apt-get install blueman

With this applet, I could easily set up modem service through bluetooth. Just search your device, right-click on it, and select Dial-up networking  from topmost Connect to menu.
Now you can add your mobile broadband connection. Click on Network Monitor applet and select configure. Select Mobile broadband. Add your connection, which generally means setting the APN ( the same way as you set in your mobile phone). When done, you can use your new mobile broadband connection.

Sharing it:

So, after my mobile net connection was set up, the only thing was missing to share it. Unfortunately, I could not find any easy tool to set up ip forwarding rules correctly, so I searched for related articles. I have found a great description on Debian Administration. I have slightly changed eth1 to ppp0 according to my needs. Here is my version:

#!/bin/sh

PATH=/usr/sbin:/sbin:/bin:/usr/bin

#
# delete all existing rules.
#
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X

# Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT

# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW ! -i ppp0 -j ACCEPT
iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT

# Masquerade.
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

# Don't forward from the outside to the inside.
iptables -A FORWARD -i ppp0 -o ppp0 -j REJECT

# Enable routing.
echo 1 > /proc/sys/net/ipv4/ip_forward

Before executing the script, I had to configure eth0. Because it was set to dhcp I changed it to static address in /etc/network/interfaces :

iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
broadcast 192.168.1.255

Then I just executed the script and it just worked.

Configuring the router:

The only thing was left is to configure the router. This was easy too. I have modified the WAN settings from pppoe (yes, an ADSL connection) to static ip. The ip can be anything in the subnet of eth0, the netmask is the same, and the gateway is ip of eth0. And first I have set DNS to Google’s dns (8.8.8.8).

So, every 4 machines could use the net without any configuring and without an active ADSL service :)

No Comments »

admin on April 20th 2010 in Uncategorized

Improving productivity by useful collaborative webapps

I work for a multinational company which means there are more sections collaborating, each with numerous people. Workplaces such like this aren’t famous for their well-organized structure, optimized resource usage, etc. Nowadays we’ve faced the problem of effective information sharing.

First attempt : MoinMoin

There was an attempt to build an usable knowledge base by using wiki so we’ve installed MoinMoin Wiki on our application server. Moin is a great python based wiki, installing under Debian is very easy:

Installation:

apt-get install python-moinmoin
mkdir /var/www/monkeywiki
cp usr/share/moin/data /var/www/monkeywiki/
cp usr/share/moin/underlay /var/www/monkeywiki/
chown root:www-data /var/www/monkeywiki -R
chmod 775 /var/www/monkeywiki -R

In /etc/moin/ copy the basic mywiki.py an edit it according to your needs (fore example monkeywiki.py ). Change the “datadir” to “./data”. Then edit farmconfig.py and add your wiki to the wikilist.

With the following apache siteconfig, everything works:

ScriptAlias /monkeywiki “/var/www/monkeywiki/moin.cgi”
alias /moin_static182 “/usr/share/moin/htdocs”
alias /wiki “/usr/share/moin/htdocs”
<Directory /usr/share/moin/htdocs>
Order allow,deny
allow from all
</Directory>

Enable it:

a2ensite pastebin
apache2ctl restart

How it looks:

MoinMoin Wiki

MoinMoin Wiki

But … there are a lot of internal sites which are hardly searchable if you don’t know what you exactly are searching. And quick sharing different type of information (example code snippets, logs, configs, links, etc) is also uneasy, slow. So this is not a perfect solution, but it is useful for writing articles.

The killer tool : Scuttle

Then, I’ve found Scuttle. Anyone who knows delicious will like scuttle. It is an open source delicious like social bookmarking system. It is even mostly compatible with delicious API so anything uses delicious by it’s API will probably work with a scuttle installation.The idea was to install scuttle and let everyone use it for bookmarking and tagging every useful page so they will be searchable by everyone. It was considered that one common user is enough, because there are no need of private and non-work related bookmarks.

Installation:

Scuttle is also available as a debian distribution package (talking about unstable sid) so the installation is very easy:

apt-get install scuttle

It puts things under /usr/share/scuttle, creates a database for it and configures apache2. The only thing I’ve ‘fine-tuned’ is the /usr/share/scuttle/www/register.php because it checks the e-mail address validity by default and I don’t want to set up any valid (and especially internal) e-mail address to this tool.

This is how does it look after adding some pages:

Scuttle

Scuttle

For firefox users, there are extensions for scuttle, which aren’t as good as the delicious bookmark extension, but very useful. I’ve found this (for firefox 3) a very interesting, it adds a “scuttle this” option in the right click menu, and a link for the homepage, which are also available as buttons. So all the user has to do is to use this extension or add a keyword to the scuttle search.

And the crown : Pastebin

So the easy and fast searching and sharing links part of the requirement has been done. Then I’ve found pastebin. It is a “collaborative debugging tool” which means it is very easy to share and edit code snippets, logs, config files, etc. It can do syntax highlighting and has the option to automatically delete snippets if you don’t need it forever. It is very useful if you want to share some log with a collague (instead sending the whole thing in a mail attachment you send only the link and pastebin will automatically delete the thing – if you want). And together with scuttle it is more useful. If you want to share some useful code, script, etc you just upload (paste) into pastebin and share the link with scuttle the same moment.

Installation:

Download pastebin from the site. Unzip into somewhere.

mkdir /var/www/pastebin
cp /tmp/pastebin/lib /var/www/pastebin/
cp /tmp/pastebin/public_html /var/www/pastebin/

For installing the database, create a new database, example “pastebin” and execute the following sql commands. I recommend phpmyadmin to do anything in mysql:

CREATE TABLE pastebin (
pid int(11) NOT NULL auto_increment,
poster varchar(16) default NULL,
posted datetime default NULL,
code text,
parent_pid int(11) default ‘0′,
format varchar(16) default NULL,
codefmt mediumtext,
codecss text,
domain varchar(255) default ”,
expires DATETIME,
expiry_flag ENUM(’d',’m', ‘f’) NOT NULL DEFAULT ‘m’,

PRIMARY KEY (pid),
KEY (domain),
KEY (parent_pid),
KEY (expires)
);

CREATE TABLE recent
(
domain varchar(255),
pid int NOT NULL,
seq_no int NOT NULL,

PRIMARY KEY(domain,seq_no)
);

Now the configuring:

In the pastebin/config/default.conf.php I’ve changed the mysql password, the script path and the url format and also commented out the google adsense line:

$CONF['dbpass']=’password1234′;

$CONF['url_format']=’/pastebin/%s’;

$CONF['this_script']=’/pastebin/pastebin.php’;

#$CONF['google_ad_client']=’pub-3281640380846080′;

Now only the apache2 configuration is left. I’ve configured it with url rewriting (mod_rewrite) because it’s cool, if you don’t want (or can’t) to use mod_rewrite then change the url format to something like this:

$CONF['url_format']=”/pastebin/pastebin.php?show=%s”;

This is the apache2 site config (/etc/apache2/sites-available/pastebin):

<Directory /var/www/pastebin>
RewriteEngine on
RewriteBase /pastebin/
RewriteRule ^([0-9]+)$ pastebin.php?show=$1
DirectoryIndex pastebin.php
</Directory

Enable it:

a2ensite pastebin
apache2ctl restart

I have made some some customized css file (blue and green ), because the basic theme does not fit me (Sorry Paul :) ). This is the green one:

Pastebin with green theme

Pastebin with green theme

I hope you like these ideas and you can use this post to set up an efficient knowledge base on your environment!

No Comments »

admin on August 2nd 2009 in Uncategorized