Tag Archives: Dmitrijs Ledkovs

Dmitrijs Ledkovs: avahi + apt-cacher-ng + sbuild ?!

Laptop enters the WiFi network and decides that it wants to build some packages using sbuild.
At the same time, on this network there is apt-cacher-ng operating with most of packages cached.
On the other hand, there is a project squid-deb-proxy which provides yet another apt proxy, but with the added bonus of avahi discovery.

Can we throw all of this stuff together and make it work? Well let’s try =)

On ubuntu:


$ sudo apt-get install apt-cacher-ng squid-deb-proxy-client

On debian:

Squid-deb-proxy-client is not packaged just fetch and install it. It’s really just one python script & one conffile. Or I have published the python script and the config as part of this posts gist.

Next all of the avahi magic, really is just publishing a service file & letting the python-script from the squid-deb-proxy-client package find it, and adding apt-conf.d snippet which calls the above mentioned script and generate correct proxy line.

But we are running apt-cacher-ng! So on the server where apt-cacher-ng is running drop this:

/etc/avahi/services/apt-cacher-ng.service


<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
 <name replace-wildcards="yes">apt-cacher-ng proxy on %h</name>
 <service protocol="ipv4">
  <type>_apt_proxy._tcp</type>
  <port>3142</port>
 </service>
</service-group>

Now on any host that you want automatic apt-proxy discovery, simply install squid-deb-proxy-client & your apt-cacher-ng will be auto-discovered.

What about sbuild? Well, you don’t really want to install avahi-daemon and start it inside the chroot, so we can cheat with creating an executable hook:


/etc/schroot/setup.d/51aptproxy
#!/bin/sh
set -e

. "$SETUP_DATA_DIR/common-data"
. "$SETUP_DATA_DIR/common-functions"
. "$SETUP_DATA_DIR/common-config"

APT_AVAHI_DISCOVER=/usr/share/squid-deb-proxy-client/apt-avahi-discover

if [ $STAGE = "setup-start" ] || [ $STAGE = "setup-recover" ]; then
    if type apt-avahi-discover 1>/dev/null; then
        APT_AVAHI_DISCOVER=apt-avahi-discover
    fi
    APT_PROXY=`$APT_AVAHI_DISCOVER`
    if [ -n "$APT_PROXY" ]; then
        info "Setting apt-proxy to avahi proxy at ${APT_PROXY}"
        printf 'Acquire::http { Proxy "%s";};n' ${APT_PROXY} > "${CHROOT_PATH}/etc/apt/apt.conf.d/30schrootautoproxy"
    fi
fi

Tadah. Now I’m using my apt-cacher-ng whenever I’m on my home WiFi =)

Please advertise your apt-cache proxies!
Now to integrate this properly:
  • apt-cacher-ng should auto-create avahi service file in it’s init script
  • apt-get or some other package should ship apt-avahi-discover script (there is also a C implementation available)
  • apt-get or some other package should ship the apt.conf.d snippet
  • sbuild / pbuilder / cowbuilder / mk-sbuild / [p|cow]builder-dist should have hooks to retrieve hosts’ apt proxy settings and use them in the chroots
For full sources see lp:squid-deb-proxy and my gist with all other config snippets.

…read more
Source: FULL ARTICLE at Planet Ubuntu

Dmitrijs Ledkovs: X-Chat power-user upload

xchat (2.8.8-7ubuntu2) raring; urgency=low

  * Optimise default settings for efficient chatting
    + Make tab completion by default use last-used order, not alphabetical.
      This way for example if one is chatting with cjwatson, typing
      "cj" will complete to cjwatson and not cjohnston.
      Manual migration: ~/.xchat/xchat.conf: completion_sort = 1
    + Do not focus channel upon entering, as that clears highlights when using a znc proxy.
      To be honest, there should be a distinction between manually joining
      new channels & auto-joining. (LP: #189222)
      Manual migration: ~/.xchat/xchat.conf: tab_new_to_front = 0
    + Do not clear buffer with Ctrl-L shortcut. (LP: #304477)
      That shortcut is dominated by web-browsers changing URLs and causes
      context loss if the focus was accidently left on xchat.
  * Fix ftbfs, should link against gmodule.
  * Add xchat-indicator to recommends. (LP: #1048335)
  * Include svg icon (LP: #840673)
 -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com>   Sun, 24 Feb 2013 23:03:52 +0000
This upload should make xchat more pleasant to work with for avid irc chatters. Note that since xchat doesn’t track what is default vs custom set, one may want to adjust to the new default settings:
  • tab_new_to_front = 0
  • completion_sort =1
The first one prevents focusing channels upon (auto-)joining. This prevents loosing highlights and backscroll marker on high velocity channels as well as when using an irc proxy like ZNC.

The second one makes tab completion to prefer recently used nicks, over alphabetically sorted once. In practice this means highlighting the wrong people less.

I hope you enjoy this upload. It seems like these fixes also affect hexchat… I do wonder if that one should be uploaded into ubuntu/debian. Duplicate code/bugs for some parts…

…read more
Source: FULL ARTICLE at Planet Ubuntu

Dmitrijs Ledkovs: Android Debug Bridge (adb) update for 4.2.2

To use adb against android 4.2.2 device one needs updated adb tool. This is now published in raring archive. If you are using quantal or precise, there is a backport published in the usual location of the nexus7-installer.
add-apt-ppa -y ppa:ubuntu-nexus7/ubuntu-nexus7-installer
Here are the instructions about the new adb from the android development website:

When you connect a device running Android 4.2.2 or higher to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you’re able to unlock the device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or higher.

 — ADB 

…read more
Source: FULL ARTICLE at Planet Ubuntu

Ubuntu Classroom: Ubuntu Developer Week: Review of Day 3

Unfortunately 13.04′s Ubuntu Developer Week is over. All the logs and videos are linked from the timetable, so you can still enjoy the sessions again and again. We hope you had a great time and we will see you soon again in one of our Ubuntu development channels.

Here’s what happened on day 3:

  1. Automated Testing in Ubuntu & Automated Testing TechnologiesMartin Pitt did a great job of summarising the current work in the Quality Assurance team. It’s getting more and more important to automatically assure us that software we rely on still provides the functionality we expect and nothing breaks. Check out the log and get an idea of how diverse the activities are and where you can get involved.
  2. Syncing your app’s data with u1dbStuart Langridge has been involved in Ubuntu One since ages and knows how to make app authors happy. If you want simple data storage and syncing without headaches, have a look at u1db and Stuart’s introduction to u1db!
  3. Interacting with Debian’s Bug Tracking System — You explain things best if you talk about things you make use of every day. As Stefano Rivera is both a Debian and Ubuntu developer, this talk was quite easy to deliver for him. Debian’s Bug Tracking System is a central place of exchange between the two projects and Stefano’s session will surely make it clearer to you.
  4. Building Ubuntu images & The Ubuntu Nexus 7 imagesOliver Grawert has been building Ubuntu images for various platforms for quite a few cycles already, so he knows the problems you probably run into most. His sessions give some good insight into what’s involved in bringing Ubuntu up on all kinds of devices.
  5. Fixing packages to cross-build — As a member of the Foundations team Dmitrijs Ledkovs has gathered quite some experience cleaning up problems, including build problems in the archive for a while now. Check out the session to find out how to make packages build for other architectures most easily. Get involved in fixing these issues once and for all.
  6. Developers RoundtableBenjamin Drung and Michael Bienia were kind enough to take on the last session of UDW and answer all the remaining questions regarding Ubuntu development. Be sure to check out the log as your favourite question might well be among the ones answered. :-)

Oh, and before we forget it: join us in the Automated Testing Hackfest today!


Source: FULL ARTICLE at Planet Ubuntu