Showing posts with label rules. Show all posts
Showing posts with label rules. Show all posts

Friday, 20 January 2012

HOWTO: GIMP - create a text-with-halo effect

A small tutorial I made about an effect I used in the previous interviews (in English), so, for consistency, I had to recreate it, even after Kino was no longer available in Debian Wheezy.



I'll probably upload more videos like this about cinelerra, pitivi, gimp, audacity and other software I use for the work I do for our „Sceptici în România”/ „Skeptics in Romania” podcast (The podcast is in Romanian, but we are preparing also a project for the international audience, too).

And in case you are wondering, yes, this podcast is part of the reasons I wasn't able to do any work for Debian lately!

Monday, 31 October 2011

Speechless...

No words can express how grateful I am to the genius of this man.



Thank you Dr. Sagan!

Friday, 26 February 2010

How to: git push via ssh; alternative users on the same host

Let's assume you're part of a project X that uses git for version control on a server host.it. Due to historical reasons your login on machine host.it is 'eddyp'. You're also part of another project Y which is hosted on server host.me. In this project you have always used 'eddy' as your ssh login for the git push.

Now, project Y decides to change hosting and moves the repo on server host.it. Since the logins were also migrated, now you have login 'eddyp' for project X and login 'eddy' for project B.

You changed the URI in remote.origin.url, but you are faced with this error when pushing from project Y to server host.it:

Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 476 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
error: unable to create temporary sha1 filename ./objects/56: Permission denied

fatal: failed to write object
error: unpack failed: unpacker exited with error code


The problem is that you are probably trying to login with 'eddyp' on server host.it from project Y since you ~/.ssh/config contains a 'user eddyp' clause for host host.it.


You can avoid this problem and identify to server host.it with different logins depending on the project via a small nice trick using fake hostnames in ~/.ssh/config:


Host eddyp.host.com
User eddyp
Hostname host.it

Host eddy.host.com
User eddy
Hostname host.it


And setting the remote.origin.url setting accordingly in the repo for project Y and project X:


eddy@projx $ git config remote.origin.url ssh://eddyp.host.it/srv/git/projx.git

eddy@projy $ git config remote.origin.url ssh://eddy.host.it/srv/git/projy.git

Friday, 13 November 2009

This Sunday, already 5 years...

This Sunday, we celebrate already 5 years since the initiation of the successful „Save Carol Park” civic action. Back then, the park and the mausoleum were in danger of being destroyed to make room for a cathedral, in spite of special status of the park, the already too low green spaces per capita ratio, in spite of the legal status and in spite of public opposition.

Nice to see it will be celebrated Sunday, 15th at 13:00 at Arenele Romane, and regular people being invited there (linked page in Romanian):

http://remuscernea.ro/2009/11/sarbatorim-5-ani-de-la-salvarea-parcului-carol/

I'll certainly be there!


View Larger Map

Saturday, 20 June 2009

MSI PR200WX-058EU sleep - 91a6c462b02d8dc02dbe95e5a407d78078a38d01 is first bad commit

Nailed it!

After a rocky start, I managed to find the commit that broke sleep for my laptop.


91a6c462b02d8dc02dbe95e5a407d78078a38d01 is first bad commit
commit 91a6c462b02d8dc02dbe95e5a407d78078a38d01
Author: H. Peter Anvin

Date: Wed Jul 11 12:18:57 2007 -0700

Use the new x86 setup code for x86-64; unify with i386

This unifies arch/*/boot (except arch/*/boot/compressed) between
i386 and x86-64, and uses the new x86 setup code for x86-64 as well.

Signed-off-by: H. Peter Anvin

Signed-off-by: Linus Torvalds



Simply reverting this commit wouldn't fix the problem entirely since the screen was always blank after the successful resumes; OTOH, the script used for testing was supposed to do stuff after resume, stuff which would have effects visible on the hard-disk, so it was visible on the next reboot if the last sleep/resume cycle was successful or not.


Great. Oh, and git bisect rules!




Now, if you're interested in finding a regression in the kernel and you might be interested in how I automated the thing, here are some small scripts I used:

  • linux-build - a wrapper script around make-kpkg to build .deb packages of the linux kernels I build; I used it way before this bisect, but now I modified it in such a way the kernels are clearly versioned and indicate the commit to which they correspond, too
  • sleepit - a script that automated the actions needed for a linux kernel to be tested; is really trivial and highly specialized on sleep/resume debugging; it assumes to be ran in the directory where you'd later want to grab dmesg-s outputs from
  • sleeptest - a wrapper script that is smart enough to detect if the current kernel is a kernel to be tested or a stable (regular kernel) one
    • if the kernel is a stable one:
      • looks for the signs left by the last test kernel and depending on them, mark the kernel bad or good in the bisect; this would result in a new checkout which would be processed or, if the bad commit was identified, the script would stop
      • in the case of a new bisect, the new checkout is cleaned up, patched, built, then the script installs the new linux-image .deb[1] and update-grub[2], leaving the reboot command at my discretion for the eventual case something went awry; a failure to compile the kernel in an automated fashion would have dropped me in an interactive console which meant I had to manually do the steps necessary to be ready to boot into the next kernel
    • if the kernel is a test kernel run the sleepit script
The main script was the sleeptest script which is ran as root to allow sleep commands, installation of the kernel and update-grub; when building, the build is done via su to my user.

As a supplemental speed up, I configured libpam-usb to authenticate root and myself through a USB storage device, which is quite cool. I am still pondering if I should keep this enabled or migrate to something like libpam-rsa[*].

Of course, the scripts contain stuff hard-coded into them (my user name for one), but they can easily be modified to remove those limitations (generally they use variables).


linux-build


#!/bin/sh
# License: GPLv2+/MIT
# Author: Eddy Petrișor
#
# Acest script trebuie rulat din directorul nucleului cu comanda:
# linux-build [--no-headers] [--rebuild]
#
# This script must be ran from the kernel tree directory with
# linux-build [--no-headers] [--rebuild]

FATTEMPT=../attempt

TARGETS="kernel-image kernel-headers modules_config modules"
[ "$1" = "--no-headers" ] && shift && TARGETS="$(echo $TARGETS | sed 's#kernel-headers ##')"

if [ -f $ATTEMPT ]
then
ATT=`cat "${FATTEMPT}"`
if [ $# -eq 0 ]
then
ATT=`expr $ATT + 1`
make-kpkg clean
else
if [ $# -eq 1 ] && [ $1 = '--rebuild' ]
then
# nothing to do, we are already set
echo 'Preparing for rebuild'
else
echo 'Illegal parameters'
exit 2
fi
fi
else
ATT=1
fi

# no problem if is rewritten on rebuild
echo "$ATT" >$FATTEMPT

# must define MODULE_LOC for mol module compilation
DIR=`pwd`
cd ..
MODULE_LOC=$(pwd)/modules
# this didn't work
# export ALL_PATCH_DIR=$(pwd)/linux-patches
cd ${DIR}

echo "Modules should be here: ${MODULE_LOC}"
echo "Stop by ctrl+c, if the independent modules aren't there"

# press ctrl+c, if needed -- disabled for now
#read

export MODULE_LOC
export CONCURRENCY_LEVEL=$(grep -c 'processor' /proc/cpuinfo)

[ -d .git ] && PREFIX="g$(git log --pretty=oneline --max-count=1 | cut -c 1-8)-" || PREFIX=""
APPEND=$PREFIX$(hostname)

#time make-kpkg --rootcmd fakeroot --revision ${ATT} --stem linux --append-to-version -`hostname` --config menuconfig --initrd --uc --us kernel-image kernel-headers modules_config modules
#time make-kpkg --rootcmd fakeroot --revision ${ATT} --stem linux --append-to-version -`hostname` --added-patches 'ata_piix-ich8-fix-map-for-combined-mode.patch,ata_piix-ich8-fix-native-mode-slave-port.patch' --config silentoldconfig --initrd --uc --us kernel-image kernel-headers modules_config modules
time make-kpkg --rootcmd fakeroot --revision ${ATT} --stem linux --append-to-version -$APPEND --config silentoldconfig --initrd --uc --us $TARGETS


sleepit


#!/bin/sh

FAILEDRESUME=/failed-resume
RESUMED=/resumed

modprobe i915
invoke-rc.d acpid stop
echo "$(uname -r)" > $FAILEDRESUME
dmesg >dmesg_before_$(uname -r); echo mem > /sys/power/state; dmesg >dmesg_after_$(uname -r); sync
echo 'resumed, oh my god' > resumed
echo "$(uname -r)" >> $RESUMED
rm -f $FAILEDRESUME
sync
sleep 10
reboot



sleeptest


#!/bin/sh

RESULTSDIR=/root/var/debug/sleep/regression
UNAMER="$(uname -r)"
FAILEDSLEEPFILE=/failed-resume
RESUMED=/resumed
SOURCEDIR=/home/eddy/usr/src/linux/linux-2.6

check_same_commit ()
{
local COMMIT
COMMIT=$(git log --pretty=oneline --max-count=1 | cut -c 1-8)
[ "$COMMIT" = "$1" ] && return 0 || return 1
}

get_rev_from_unamer ()
{
echo "$1" | sed 's#.*-g\([0-9a-f]*\)-heidi#\1#'
}

mark_bad ()
{
cd $SOURCEDIR
su -c 'git reset --hard HEAD' eddy
su -c 'git bisect bad' eddy
cd -
}

mark_good ()
{
cd $SOURCEDIR
su -c 'git reset --hard HEAD' eddy
su -c 'git bisect good' eddy
cd -
}

compile_next ()
{
cd $SOURCEDIR
if [ -f $FAILEDSLEEPFILE ] ; then
LKVER=$(cat $FAILEDSLEEPFILE)
else
LKVER=$(tail -n 1 $RESUMED)
fi
PREVCOMMIT=$(get_rev_from_unamer "$LKVER")

if check_same_commit "$PREVCOMMIT" ; then
echo "It looks like you got your result!"
exit 1337 # of course $? isn't 1337, but anyways
fi

su -c 'make clean && rm -fr debian && git reset --hard HEAD && patch -p1 < lkver="$(cat">>> BAD <<< $LKVER ($(get_rev_from_unamer $LKVER))" mark_bad else LKVER=$(tail -n 1 $RESUMED) echo "Marking >>> good <<< $LKVER ($(get_rev_from_unamer $LKVER))" mark_good fi compile_next && \ cd $SOURCEDIR/.. && \ echo 'Installing the linux-image and running update-grub && reboot' && \ dpkg -i $(ls linux-image-*_$(cat attempt)_*.deb) && \ update-grub fi


You have my permission to use, modify and redistribute these scripts or modified versions based on these under the terms of the MIT license.


[*] because the libpam-rsa package seems to be unmaintained (especially upstream), while libpam-usb seems to inactive (maybe is considered finished by upstream?)

[1] I didn't automate the removal of the previous test kernel, but that could have been done easily

[2] I haven't made a custom grub section for the test kernels in such a way they would boot by default at the next reboot since I considered that to be too cumbersome for the moment (although I had /vmlinuz symlinks) and it was simpler to select manually the kernel

Wednesday, 11 March 2009

cd-circleprint - calibration info for c5380

If you're using a HP Photosmart C5380 All-in-One printer to print on a CD, you might find it useful to use the following cd-circleprint configuration file when using mainly A4 paper format.


delta 20.0
begin_from_bottom 7.5
viewer /usr/bin/evince
converter convert
radius_inner 21
tickmarks 1
print_circle_boundaries 1
begin_from_left[0] 1.5
begin_from_left[1] 1.5
number_of_labels 2
debug 0
circle_radius[0][0] 50
circle_radius[0][1] 41
circle_radius[0][2] 41
circle_radius[0][3] 50
circle_radius[1][0] 50
circle_radius[1][1] 41
circle_radius[1][2] 41
circle_radius[1][3] 50
x_scale 1
y_scale 1



I am unsure if usually using A4 paper format changes anything, but the .ps file cd-circleprint creates uses A4 on my system.


Does anyone knows a decent editor for CD artwork?