Saturday, November 22, 2008

How to install flex-mojo

Add repository to ~/.m2/settings.xml:

<settings>
<profiles>
<profile>
<id>flex-mojos</id>
<repositories>
<repository>
<id>flex-mojos-repository</id>
<url>http://svn.sonatype.org/flexmojos/repository/</url>
<snapshots> <enabled>true</enabled> </snapshots>
<releases> <enabled>true</enabled> </releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local</id>
<url>http://svn.sonatype.org/flexmojos/repository/</url>
<snapshots> <enabled>true</enabled> </snapshots>
<releases> <enabled>true</enabled> </releases>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>flex-mojos</activeProfile>
</activeProfiles>
</settings>


Invoke the following command:

mvn info.flex-mojos:install-mojo:install-sdk -Dflex.sdk.folder="C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.1.0" -Dversion=3.1.0



You can find additional information on google code site http://code.google.com/p/flex-mojos/ and blog http://blog.flex-mojos.info/

Friday, June 20, 2008

Spamgourmet

The Molotov Cocktail for the war on spam is here

Saturday, April 26, 2008

Tuesday, April 15, 2008

Audacious. Gnome. Multimedia keys.

Unfortunately, multimedia keys don't work in Audacious plug-ins like global hotkeys if ones were binded in gnome-keybinding-properties application. I wrote the following plug-in to enable multimedia keys (play, stop, prev, and next) in Audacious player. The plug-in was tested in Ubuntu 7.10. Here is it:
Audacious - Gnome Mmkeys

Friday, April 11, 2008

Ubuntu 7.10 + Jabra BT620s + Jabra 320s

I have bought bluetooth headphones and adapter. Here is an instruction how to configure bluetooth audio under Ubuntu 7.10. Maybe it will be helpful for other distros.

At first you should obtain MAC for you bluetooth audio device:

hcitool scan

Obtained address you should replace in scripts and configuration below instead of "XX:XX:XX:XX:XX:XX".

Create the following file in home directory to configure alsa plug in:
~/.asoundrc
pcm.bluetooth {
type bluetooth
device XX:XX:XX:XX:XX:XX
profile "auto"
}

Then create python scripts. The first script turns on headset profile, the second one turns on A2DP profile for stereo streaming.

Headset proifle (headset.py file):

#!/usr/bin/env python

import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')

bus_id = manager.ActivateService('audio')
audio = dbus.Interface(bus.get_object(bus_id, '/org/bluez/audio'), 'org.bluez.audio.Manager')

path = audio.CreateHeadset('XX:XX:XX:XX:XX:XX')
#audio.ChangeDefaultHeadset(path) #change the device to be used by default
headset = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.audio.Headset')

#Connect and Play are not required in PCM mode
headset.Connect()
headset.Play()

A2DP profile (a2dp.py file):

#!/usr/bin/env python

import dbus
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')

bus_id = manager.ActivateService('audio')
audio = dbus.Interface(bus.get_object(bus_id, '/org/bluez/audio'), 'org.bluez.audio.Manager')

path = audio.CreateDevice('XX:XX:XX:XX:XX:X')
#audio.ChangeDefaultDevice(path) #change the device to be used by default
sink = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.audio.Sink')

sink.Connect()

Okay. bluetooth-applet should be run. To turn on A2DP profile you should execute a2dp.py and to turn on Headset profile you should execute headset.py. Now you can test sound via audacious: options->preferences->Audio->Current Output Plugin->ALSA
Output Plugin Preferences->Device Settings->audio device: "bluetooth". In other players you should select "bluetooth" device instead of default or any other. See here how to set bluetooth support to another players.

Another way to set bluetooth support is to install Blueman manager.

URLs:
UPD: Audacous writes to console: ALSA lib pcm_bluetooth.c:238:(playback_hw_thread) poll error: Interrupted system call (4). I don't know what it means...

Monday, April 07, 2008

#! /bin/bash
# eth0 - local network
# ppp0 - internet
# eth1 - home wnetwork

IPTABLES=/sbin/iptables

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

# Clearing
$IPTABLES -P INPUT ACCEPTs
$IPTABLES -F INPUT
$IPTABLES -P OUTPUT ACCEPT
$IPTABLES -F OUTPUT
$IPTABLES -P FORWARD DROP
$IPTABLES -F FORWARD
$IPTABLES -t nat -F

$IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

$IPTABLES -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A FORWARD -i eth1 -o eth0 -j ACCEPT
$IPTABLES -A FORWARD -i ppp0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A FORWARD -i eth1 -o ppp0 -j ACCEPT

Sunday, March 23, 2008

Network card don't work after unplug/replug

ifplugd is a Linux daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected.

http://0pointer.de/lennart/projects/ifplugd