tag:blogger.com,1999:blog-4900501205923338222024-03-07T04:34:34.650+01:00Wojnicki-TechTechnical issues I've struggled with...Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-490050120592333822.post-1557559106557776592012-04-24T13:10:00.001+02:002012-04-24T15:15:11.948+02:00ZyXEL NSA310, Disabling FTP Clear Text AccessNSA310 is a nice NAS with impressive amount of access options. Mainly thanks to Linux which runs it. Besides it is cheap.<br />
<br />
There is one caveat: FTP access. While enabling it there is no way to force FTPES mode only. A client can connect either using clear text or SSL.<br />
<br />
Forcing NSA310 into FTPES only mode requires some hacking.<br />
<br />
First, you need to enable sshd on your box to be able to hack it remotely. Use your web interface to log-in as admin. After that go to the following address (it enables sshd):<br />
<br />
<pre>https://192.168.15.125/zyxel/cgi-bin/remote_help-cgi?type=sshd_tdc
</pre><br />
Now, ssh to your box using root as the username and admin's password.<br />
<br />
Go to the following directory:<br />
<br />
<pre>/usr/local/zy-pkgs/etc/init.d
</pre><br />
and create a file named: pureftpd-tweak which contains the folowing code:<br />
<br />
<pre>#!/bin/sh
CONF=/etc/pure-ftpd.arg
DATA=`cat $CONF`
echo ' -Y 2' $DATA > $CONF
kill `cat /var/run/pure-ftpd.pid`
sleep 1
/usr/local/sbin/pure-ftpd `/bin/cat $CONF`
exit 0
</pre><br />
Now tell NSA310 to actually use this file upon boot.<br />
Edit ZYPKG_DEPS file and add the following line in the START-UP section:<br />
<br />
<pre>/usr/local/zy-pkgs/etc/init.d/pureftpd-tweak
</pre><br />
ZYPKG_DEPS should look like this now:<br />
<br />
<pre># Dependency for zypkgs
# START-UP (DON'T REMOVE THIS LINE!)
/usr/local/zy-pkgs/etc/init.d/PHP-MySQL-phpMyAdmin
/usr/local/zy-pkgs/etc/init.d/gallery
/usr/local/zy-pkgs/etc/init.d/WordPress
/usr/local/zy-pkgs/etc/init.d/SqueezeCenter
/usr/local/zy-pkgs/etc/init.d/eMule
/usr/local/zy-pkgs/etc/init.d/DyDNS
/usr/local/zy-pkgs/etc/init.d/SMART
/usr/local/zy-pkgs/etc/init.d/BackupPlanner
/usr/local/zy-pkgs/etc/init.d/NFS
/usr/local/zy-pkgs/etc/init.d/Tftp
/usr/local/zy-pkgs/etc/init.d/Syslog
/usr/local/zy-pkgs/etc/init.d/pyLoad
/usr/local/zy-pkgs/etc/init.d/pureftpd-tweak
# SHUTDOWN (DON'T REMOVE THIS LINE!)
/usr/local/zy-pkgs/etc/init.d/pyLoad
/usr/local/zy-pkgs/etc/init.d/Syslog
/usr/local/zy-pkgs/etc/init.d/Tftp
/usr/local/zy-pkgs/etc/init.d/NFS
/usr/local/zy-pkgs/etc/init.d/BackupPlanner
/usr/local/zy-pkgs/etc/init.d/SMART
/usr/local/zy-pkgs/etc/init.d/DyDNS
/usr/local/zy-pkgs/etc/init.d/SqueezeCenter
/usr/local/zy-pkgs/etc/init.d/eMule
/usr/local/zy-pkgs/etc/init.d/gallery
/usr/local/zy-pkgs/etc/init.d/WordPress
/usr/local/zy-pkgs/etc/init.d/PHP-MySQL-phpMyAdmin
</pre><br />
Reboot, and that's it.<br />
<br />
You can FTPS but not FTP to your box now.<br />
<br />
For more information take a look at: <a href="http://zyxelforum.de/manuell-angepasste-smb-conf-wird-nach-neustart-%C3%BCberschrieben-t3335s8.html-sid=a6b3506ee788bf811cc911381ec7bb6b">ZyXEL Forum</a> and <a href="http://forum.nas-central.org/viewforum.php?f=249&sid=94dedfe6ab781f0c0339ddb264d71dfc">NAS-central</a>.Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com5tag:blogger.com,1999:blog-490050120592333822.post-68397954886146633362011-01-09T20:03:00.001+01:002011-03-19T10:38:01.249+01:00XBMC and NVidia's TwinViewI was looking for a decent media center - mostly to watch movies with an overhead projector connected to a PC. The PC is running Linux and I would like to be able to select a movie, change the volume, pause etc with my Medion (read: cheap, RF, USB connected) remote.
One day I stumbled upon XBMC.
It turned out to be a decent piece of software.
Configuring the remote was easy. But...
<br />
<br />
I must mention here that my display setup uses the NVidia's TwinView, which serves me well.
My main LCD monitor is connected through a D-Sub while the beamer via HDMI.
They form a dual-screen setup with the beamer on the right of the LCD.
<br />
<br />
But there is always a catch... Actually two of them.<br />
<ol>
<li>XBMC's fullscreen ignores TwinView, so it spans both displays, or the other display is turned off. </li>
<li>There is video tearing visible while XBMC is running on the beamber, there is no tearing if it runs on the LCD.</li>
</ol>
The first issue can be fixed by making XBMC use so-called windowed mode. It appears as a window then. Having a window and using wmctrl it is possible to make it look like fullscreen.<br />
The second issue regard configuring the NVdia in a proper way which makes OpenGL sync to the specified display instead of the first one. It can be achieved by exporting two environment variables __GL_SYNC_TO_VBLANK=1 and __GL_SYNC_DISPLAY=name_of_the_display_to_sync_to.<br />
<br />
So here comes my magical bash script which launches the XBMC with a proper syncing enabled and shifts it to the beamer making the window fullscreen (mind that the beamer is on the right of the LCD, and the LCD is 1280x1024).<br />
<br />
Enjoy.
<br />
<pre>
#!/bin/bash
move_and_fullscreen(){
NAME='XBMC Media Center'
while [ -z "`wmctrl -l | grep \"$NAME\"`" ]
do
sleep 1
done
wmctrl -r "$NAME" -e '0,1280,-1,-1,-1'
wmctrl -r "$NAME" -b toggle,fullscreen
}
move_and_fullscreen &
__GL_SYNC_TO_VBLANK=1 __GL_SYNC_DISPLAY_DEVICE=DFP-0 SDL_VIDEO_ALLOW_SCREENSAVER=0 exec xbmc
</pre>
<p>
<strong>Update:</strong> As of XBMC 10.1 I had to add SDL_VIDEO_ALLOW_SCREENSAVER=0 to disable screensaver while running XBMC. The above approach uses the windowed mode of XBMC which enables system screensaver now - it kicks in while watching movies :( (the screensaver is disabled in the fullscreen mode only).Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com18tag:blogger.com,1999:blog-490050120592333822.post-28737801048905158892010-11-15T16:28:00.001+01:002010-11-15T16:29:10.423+01:00Linux and a newborn.<p>
Have you ever tired to put a newborn to sleep? It's tough. However it seems that linux can do it for you - actually it works pretty good for my son. Just turn the volume up and issue:
</p>
<pre>
while true ; do cat /boot/vmlinuz-2.6.32-25-generic > /dev/dsp ; done
</pre>
<p>
Good luck.
</p>Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-5555480001593300652010-09-26T22:57:00.002+02:002010-11-15T16:25:41.439+01:00C, Java, Erlang, Prolog, Haskell: naive banchmark<p>
Here comes a naive benchmark for C, Java, Erlang, Prolog and Haskell.
The benchmark is to compute Pythagorean triples.
The triple consists of three positive integers a, b, and c, such that a*a + b*b = c*c and additionally a+b+c<=n, where n=500.
</p>
<p>
Haskell:
<pre>
f :: Int -> [ (Int, Int, Int) ]
f n = [ (x, y, z) |
x <- [ 1 .. n ],
y <- [ 1 .. n ],
z <- [ 1 .. n ],
x + y + z <= n,
(x * x) + (y * y) == (z * z) ]
</pre>
Prolog:
<pre>
pytriangle(N,A,B,C):-
between(1,N,A),
between(1,N,B),
between(1,N,C),
A + B + C =< N ,
A*A + B*B =:= C*C.
</pre>
Erlang:
<pre>
-module(test).
-export([pythag/1]).
pythag(N) ->
[ {A,B,C} ||
A <- lists:seq(1,N),
B <- lists:seq(1,N),
C <- lists:seq(1,N),
A+B+C =< N,
A*A+B*B =:= C*C
].
</pre>
C:
<pre>
int main(int argc,char *argv[]){
int a,b,c,n;
n=atoi(argv[1]);
for (a=1; a<=n; a++) {
for (b=1; b<=n; b++) {
for (c=1; c<=n; c++) {
if ((a+b+c <= n) && (a*a + b*b == c*c)){
printf("%d,%d,%d;",a,b,c);
}
}
}
}
return 0;
}
</pre>
Java:
<pre>
public class triangles
{
public static void main(String [] args)
{
int a,b,c,n;
n=Integer.parseInt(args[0]);
for (a=1; a<=n; a++) {
for (b=1; b<=n; b++) {
for (c=1; c<=n; c++) {
if ((a+b+c <= n) && (a*a + b*b == c*c)){
System.out.printf("%d,%d,%d;",a,b,c);
}
}
}
}
}
}
</pre>
</p>
<p>
Here comes the results (in seconds).
</p>
<p>
Haskell (GHCi, version 6.12.1): 380 <br>
Haskell compiled (GHCi, version 6.12.1): 32 <br>
Prolog (SWI Prolog 5.7.4): 197.2 <br>
Erlang (R13B03): 59.5 <br>
Erlang HiPE (High Performance Erlang), native: 13.2 <br>
C (gcc 4.4.3): 0.8 <br>
Java (IcedTea6 1.8.1): 2.2 (with output redirected to /dev/null: 1.3) <br>
</p>
<p>
The winner was obvious from the begining. But it's quite interesting how the declarative languages perform... hmmm. Kudos to Erlang.
</p>
<p>
By the way, have you noticed that the code is far better readable with the declarative approach?
</p>Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com2tag:blogger.com,1999:blog-490050120592333822.post-63166555150206493602010-09-05T17:23:00.003+02:002010-09-26T22:46:42.839+02:00Command line might: useful aliases; BASH tipsI'm a command-line-guy I guess. I use a terminal quite often (mostly with BASH), either for file management, or while working on my projects, just to launch proper application, and optionally to make it read some contents from a given file.<br />
<br />
I found myself using quite often two particular functions:<br />
<ol>
<li>searching for a file which name contains a keyword, and</li>
<li>figuring out what files I recently modified in the current directory.</li>
</ol>
These two functions can be easily written down as:<br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">
ls -l | grep -i some_keyword</div>
<div style="font-family: "Courier New",Courier,monospace;">
ls -lt | head</div>
<br />
Right, but since I use them quite often and being rather lazy I wouldn't want to type these every time... So here come aliases.<br />
You can define an alias for a command you often type and use it instead. So I decided to define two aliases:<span style="font-family: "Courier New",Courier,monospace;"> lsg</span> and <span style="font-family: "Courier New",Courier,monospace;">lst</span> for searching for a file name containing a keyword and displaying the recently modified files respectively.<br />
<br />
So if you type at your command prompt: <br />
<br />
<span style="font-family: "Courier New",Courier,monospace;">alias lsg='ls -l | grep -i'</span><br />
<span style="font-family: "Courier New",Courier,monospace;">alias lst='ls -lt | head'</span><br />
<br />
From now one you can use <span style="font-family: "Courier New",Courier,monospace;">lsg</span> and <span style="font-family: "Courier New",Courier,monospace;">lst</span> freely.<br />
<br />
If you want to make the change permanent you could add the above lines to your <span style="font-family: "Courier New",Courier,monospace;">~/.bashrc</span> file, so the aliases would be accessible any time you log in.<br />
<br />
Oh one more thing... how to use it.<br />
If I want to find out what files I modified recently in the current directory I just type:<br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">
$ lst</div>
<br />
and it gives me a list of recntly modified files. If I'm looking for a file which name contains a keyword "book" I issue:<br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">
$ lsg book</div>
<br />
And I get a list of files which names contain "book" (case insensitive). It's quite useful - at least for me.<br />
<br />
PS. Dont forget about: <span style="font-family: "Courier New",Courier,monospace;">cd -</span><br />
It will bring you up to the directory you were previously in.<br />
<br />
<br />Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-6495078740891389282010-08-30T12:46:00.000+02:002010-08-30T12:46:09.510+02:00Home DVD, non interlacedThis nice tiny DVD camera of mine captures footage which turns to be <b>interlaced</b>... While it is nice while watching on a TV, it turns to be at least annoying to watch on a computer. There are some so called comb (or mouse teeth) artifacts which annoy a lot. Of course many video players can deinterlace video on-the-fly however it turns that they do that with very different results especially concerning overall video quality.<br />
<br />
So I poked around and it seems that one of the nicest deintralcers available is compiled into MPlayer. It is called <b>yadif</b>. So it's really easy to use. I fidlled with some settings for a while and ended up with a command as follows:<br />
<br />
mencoder source.mpg -of mpeg -mpegopts tsaf:format=mpeg2:muxrate=30000 -noskip -vf yadif -o dest.mpg -oac copy -ovc lavc -lavcopts vcodec=mpeg2video:mbd=1:aspect=16/9:vbitrate=9100<br />
<br />
It turns a file called <b>source.mpg</b> into a nice deinterlaced <b>dest.mpg</b>.Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-49045443697103134822010-06-07T21:16:00.005+02:002010-06-14T10:22:31.967+02:00Printing and Acrobat ReaderHave you ever had problems with printing a PDF document with the Adobe Acrobat Reader?
Have you seen a non-informative message:"The document could not be printed"?<br />
I have... and it was surprising, frustrating and... well you know how it is.... especially when the printout is due yesterday...
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCaNpD9m__EyzNquNMlQ2wgzN-qKfF8nNbHICz3zJFG3mQM_vmkxgdoj3ftcshxuNSuAbkVmo1k-RIISLWVFaIxZBrbSfl-E52DysCPNBCtNhlz6-aLY6J_dFKlP_quKCbG49OVjACC50/s1600/error.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="121" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCaNpD9m__EyzNquNMlQ2wgzN-qKfF8nNbHICz3zJFG3mQM_vmkxgdoj3ftcshxuNSuAbkVmo1k-RIISLWVFaIxZBrbSfl-E52DysCPNBCtNhlz6-aLY6J_dFKlP_quKCbG49OVjACC50/s400/error.jpg" width="400" /></a></div>
I stumbled upon this issue when I was to print some stuff in a print shop.
I made a PDF went to the shop and ordered a color laser printout (70 pages).
I was quite surprised when the guy behind the counter, told me that there is no way to print this document, since Adobe Acrobat displayed that wierd message.
Surprisingly nobody at the shop knew what the message ment.
I went back to my computer (yes, yes, yes, a desktop...) took a look, and everything was fine I could see it and print it... mind that I use mainly Evince or xpdf for PDFs.
Desperatelly I converted the document into Postscript and back to PDF (glorious pdftops and ps2pdf) and took it back to the print shop.
Surprisingly they could print it now - without any complains from the Acrobat.<br />
<br />
I made some reasearch to make sure that such an event won't take place again. And it turns out that guys at Adobe don't know what they are doing (and they don't care for their customers either) and guys at the print shop have no idea how to handle the Acrobat.
There is a <a href="http://forums.http//forums.adobe.com/message/2763283">web forum</a> I stumbled upon, which deals with this issue, especially <a href="http://forums.adobe.com/message/2763283#2763283">one message</a>.
It turns out that the printing problem appears for some PDF files - however it's hard to tell what exactly causes it.<br />
<br />
Anyway, if you ecaountered this issue take a look at the top, right corner of the print dialog window.
If you see an option like below (Comments and Forms: Document and Markups) the Acrobat presumably won't print your file.
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://4.bp.blogspot.com/_IhEV_yLdETY/TA09ASv_7fI/AAAAAAAABH8/fs0RtrZ54aM/s1600/wrong.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="http://4.bp.blogspot.com/_IhEV_yLdETY/TA09ASv_7fI/AAAAAAAABH8/fs0RtrZ54aM/s640/wrong.jpg" width="609" /></a></div>
Just change it to Document, and you should be allowed to print your stuff (see below)!
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimtV09g5Za07FOVoZRG3RpjNX_rWe6wgV-6iM1rgW62KHJAqEAWbGTSp7i9eFst9KcETNZzDK3TU-gWKSX-wozSz0huZ3itf3o2JSHHtdJ_Xco6rvjrc7P3e7nRkb5dSNcKveqV6Xi2lQ/s1600/right.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimtV09g5Za07FOVoZRG3RpjNX_rWe6wgV-6iM1rgW62KHJAqEAWbGTSp7i9eFst9KcETNZzDK3TU-gWKSX-wozSz0huZ3itf3o2JSHHtdJ_Xco6rvjrc7P3e7nRkb5dSNcKveqV6Xi2lQ/s640/right.jpg" width="609" /></a></div>
Bottom line. Adobe is worse and worse. The Acrobat is bloated. Users dont't know how to use it. Solution? Don't use it! There is plenty of other PDF browsers avaliable: evince, xpdf... Long live the free software!!!Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com2tag:blogger.com,1999:blog-490050120592333822.post-2380529609976163202010-03-02T10:32:00.004+01:002010-03-02T22:32:58.632+01:00Pausing music when switching users in Ubuntu (Karmic and Lucid)If you want to have a user, which currently uses the display, to
have access to the sound device with all the benefits from pausing
upon user switch, you need to uncheck 'Use audio devices' privileges
for this user (System->User Settings-<wbr></wbr>>Advanced-<wbr></wbr>>User Priviledges).<br />
<br />
As a matter of fact I unchecked it for all my users. These privileges are very confusing then. I guess their proper interpretation is that if:<br />
- checked: the user locks the audio device as long as he wants, no sound switching upon user switching,<br />
- unchecked: the user which currently uses the display has access to
the audio device, sound switching takes place upon user switching.<br />
<br />
The problem is more general and it regards permissions to access
certain devices (and files in /dev directory). Historically if a user
needs access to particular device he is assigned to a group which
group-owns the device file. It has worked for ages in the unix world
i.e. access to an audio device, cdrom, cd burner etc.<br />
<br />
This group based approach has several well known limitations. Now it seems that such an access is controlled by consolekit/<wbr></wbr>policykit/<wbr></wbr>udev,
which makes some sense, at least because of the dynamic nature of /dev
directory. The gnome-system-tools and especially users-admin seem not
to know anything about acl. I'm not sure whether it's good or bad - it
depends, espoecially that gnome is cross platform - on other systems
/dev might be static or there might be no acl at all.<br />
<br />
See <a href="https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/433654">https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/433654</a> for more details.<br />
And some discussion here: <a href="http://ubuntuforums.org/showthread.php?t=1420051">http://ubuntuforums.org/showthread.php?t=1420051</a><br />
<br />
Mind that the sound switching worked fine in previous Ubuntu release (Jaunty).Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-22219036285915753702010-01-21T12:31:00.002+01:002010-03-31T09:18:36.557+02:00Medion X10 remote and LinuxI've recently bought a remote for my PC. I thought it would be quite convenient to have one especially that it could be quite handy during watching DVDs.<br />
<br />
I picked an inexpensive, radio operated, USB Medion X10 - around $10.<br />
<br />
After plugging the USB dongle it turned out that the remote becomes a HID - dobling the keyboard. It was nice but not exactly what I needed. I want to have a remote control for my multimedia pplications - not to control the computer.<br />
<br />
So here comes the magic word LIRC: Linux InfraRed Control. It's a little bit misleading since the remote has nothing to do with InfraRed, but LIRC is actually an infrastructure which allows to control applications with remote controls. So I installed lirc:<br />
<blockquote>
apt-get install lirc</blockquote>
Upon configuration I selected ATI/NVidia/X10 RF Remote, and voila... the remote stopped working as a HID. Now I need to comeup with proper configurations for my multimedia applications. Here comes a complete config file /etc/lirc/lircrc I came up with:<br />
<br />
<blockquote>
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = DVD_Menu<br />
config = RootMenu<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Up<br />
config = EventUp<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Down<br />
config = EventDown<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Left<br />
config = EventLeft<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Right<br />
config = EventRight<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Vol_Up<br />
config = Volume+<br />
repeat = 1<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Vol_Down<br />
config = Volume-<br />
repeat = 1<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = OK<br />
config = EventSelect<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Mute<br />
config = Mute<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Info<br />
config = OSDStreamInfos<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Rewind<br />
config = SeekRelative-15<br />
repeat = 1<br />
delay = 5<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Play<br />
config = Play<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Forward<br />
config = SeekRelative+15<br />
repeat = 1<br />
delay = 5<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Pause<br />
config = Pause<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Power<br />
config = Quit<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = xine<br />
button = Stop<br />
config = Stop<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Play<br />
repeat = 1<br />
config = play<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Pause<br />
repeat = 0<br />
config = pause<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = KEY_PLAYPAUSE<br />
repeat = 1<br />
config = playpause<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Stop<br />
repeat = 1<br />
config = stop<br />
end<br />
<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Next<br />
repeat = 0<br />
config = next<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Prev<br />
repeat = 0<br />
config = previous<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Rewind<br />
repeat = 1<br />
delay = 5<br />
config = seek_backward<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Vol_Up<br />
repeat = 5<br />
config = volume_up<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Vol_Down<br />
repeat = 5<br />
config = volume_down<br />
end<br />
<br />
begin<br />
prog = Rhythmbox<br />
remote = *<br />
button = Power<br />
repeat = 1<br />
config = quit<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = DVD_Menu<br />
config = play_dvd<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Power<br />
config = quit<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Up<br />
config = up<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Down<br />
config = down<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Left<br />
config = left<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Right<br />
config = right<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
prog = totem<br />
remote = Medion_MD8800<br />
button = OK<br />
repeat = 1<br />
config = select<br />
end<br />
<br />
begin<br />
prog = totem<br />
remote = Medion_MD8800<br />
button = DVD_Menu<br />
repeat = 0<br />
config = menu<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Vol_Up<br />
config = volume_up<br />
repeat = 5<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Vol_Down<br />
config = volume_down<br />
repeat = 5<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Mute<br />
config = mute<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Back<br />
config = quit<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Info<br />
config = show_playing<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Rewind<br />
config = seek_backward<br />
repeat = 1<br />
delay = 5<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Play<br />
config = play_pause<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Forward<br />
config = seek_forward<br />
repeat = 1<br />
delay = 5<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = totem<br />
button = Pause<br />
config = pause<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Power<br />
config = quit<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Up<br />
config = seek +60 0<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Down<br />
config = seek -60 0<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Left<br />
config = seek -6 0<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Right<br />
config = seek +6 0<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Vol_Up<br />
config = volume +1<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Vol_Down<br />
config = volume -1<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = OK<br />
config = pause<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Mute<br />
config = mute<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Rewind<br />
config = seek -30 0<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Play<br />
config = pause<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Forward<br />
config = seek +30 0<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Pause<br />
config = pause<br />
repeat = 0<br />
delay = 0<br />
end<br />
<br />
begin<br />
remote = Medion_MD8800<br />
prog = mplayer<br />
button = Stop<br />
config = quit<br />
repeat = 0<br />
delay = 0<br />
end</blockquote>
<br />
Mind that it enables remote control for xine, rythmbox, totem and mplayer (rythmobox, and totem must have the lirc support enabled to work, see Edit/Plugins). Enjoy.<br />
<br />Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com1tag:blogger.com,1999:blog-490050120592333822.post-82477062513018501632010-01-21T11:55:00.004+01:002010-08-30T12:46:40.434+02:00Making a nice home video DVDVideo source: a Sony handycam (DCR-SR36) which produces mpeg/2 files.<br />
<br />
Anticipated result: a nice DVD with rich menus.<br />
<br />
How to do it?<br />
<br />
First, I don't want to recode the movie clips, since it would degrade their quality. So I decided to use the mpegs straight from the video camera. If there is a need to clip such a video there is a nice tool to do that: avidemux.<br />
<br />
There is also another nice tool for DVD authoring: DVDStyler - you can create a DVD menu interactively, add/rearrange clips etc. However it seems that it takes a great deal of time to come up with nice designs.<br />
<br />
So I stumbled upon tovid. It's a bunch of scripts which allow to author a DVD in a non-interactive way, just generating appropriate menus, thumbnails etc. And here comes a bummer.... It turned out that there the mpegs from the videocam are not 100% compatible with the DVD format, and they require ... well not recoding but remuxing (remultiplexing). In order to do that I use a buch of commands:<br />
<blockquote>
ffmpeg -i $1 -vcodec copy -an -f rawvideo foo.mpv<br />
ffmpeg -i $1 -vn -acodec copy -f mp2 foo.mp2<br />
mplex -f 8 -o $2 foo.mpv foo.mp2<br />
rm foo.mpv foo.mp2</blockquote>
Actually its a script, its good to save the above contents as an executable file, let's say: mpgfix, and then run it:<br />
<blockquote>
mpgfix file.mpg file-fixed.mpg</blockquote>
So file.mpg is remuxed and saved as file-fixed.mpg. You can save the file with the same name of course, then the original one will be replaced with the remuxed one. Mind that there is no quality loss here, no recoding.<br />
<br />
And here comes the nice part DVD authoring, I just launch one of the tovid scripts (todisc):<br />
<blockquote>
todisc -loop 0 -chain-videos -menu-length 2 -thumb-shape normal -aspect 16:9 -menu-title "My DVD" -pal -files *.mpg -titles *.mpg -out DVD</blockquote>
And after a while in the DVD directory there is a complete authored DVD :) with nice animated menus. You can generate an ISO image out of it:<br />
<blockquote>
mksiofs -dvd-video -o dvd.iso DVD/</blockquote>
And you'll get a file dvd.iso which is a complete ISO image ready to burn. Enjoy.<br />
<br />Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-54773634654737222822009-12-11T14:08:00.002+01:002009-12-11T18:44:15.123+01:00Screen for X11Finally!!! I think I found a key application I've been searching for.... some time. Basically it is like GNU screen for X11 :)<br />
Take a look at it: <a href="http://code.google.com/p/partiwm/wiki/xpra">http://code.google.com/p/partiwm/wiki/xpra</a><br />
<br />
It is also available in Ubuntu, just:<br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">
apt-get install xpra<br />
</div>
<div style="font-family: "Courier New",Courier,monospace;">
<br />
</div>
From its description:<br />
<blockquote>
Xpra gives you "persistent remote applications" for X. That is, unlike
normal X applications, applications run with xpra are "persistent" --
you can run them remotely, and they don't die if your connection does.
You can detach them, and reattach them later -- even from another
computer -- with no loss of state. And unlike VNC or RDP, xpra is for
remote applications, not remote desktops -- individual applications
show up as individual windows on your screen, managed by your window
manager. They're not trapped in a box.<br />
</blockquote>
<br />Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-28316245449741045802009-12-10T22:41:00.000+01:002009-12-10T22:44:10.179+01:00Gnome Workspace Switcher and managing (moving) windows.I have a dual-head setup (NVidia TwinView) where the second screen is an
overhead projector. I would find it extremely useful if I could just drag
windows using the Workspace Switcher between my screens. This would help a lot
especially at times when the projector is blanked or switched off and I would
like to move some windows to be projected when switched on/unblanked.<br />
<br />
Beware... tadaaaaa...Since yesterday windows can be dragged not only to a different workspace (without altering their relative position) but also within the workspace.
I made a modification to libwnck (the library which implements the pager and allows to manipulate windows) which implements this feature and submitted it upstream. I wonder if it is going to be committed to the next Gnome release or not... we'll see.<br />
<br />
Anyway you you would like o use this functionality in Ubuntu 9.10 Karmic Koala, here is a link to my PPA: <a href="https://launchpad.net/%7Ewojnicki/+archive/ppa">https://launchpad.net/~wojnicki/+archive/ppa</a><br />
<br />
And if you want to compile libwnck by yourself you can find the appropriate patch at the feature request: <a href="https://bugzilla.gnome.org/show_bug.cgi?id=604207">https://bugzilla.gnome.org/show_bug.cgi?id=604207</a>
<br />Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com3tag:blogger.com,1999:blog-490050120592333822.post-74626782668657423822009-11-04T15:01:00.000+01:002009-11-30T13:28:51.730+01:00Enabling laptop VGA outputThe following commands enable VGA output (works presumably with any XOrg driver, tested with several ATI Radeon cards). It is especially useful if you want to make your laptop work with a projector connected with a damaged or long cable.
<pre>
xrandr --newmode 1024x768N 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
xrandr --addmode VGA-0 1024x768N
xrandr --output LVDS --mode 1024x768
xrandr --output VGA-0 --mode 1024x768N
</pre>
The first command adds a new 1024x768 (60Hz) video mode and names it: 1024x768N.
The second command assigns the video mode to the VGA port (VGA-0).
While the third and fourth commands switch the LCD display (LVDS) to 1024x768 mode and the VGA port to the newly created one respectively.Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0tag:blogger.com,1999:blog-490050120592333822.post-31096867698879334742009-11-02T21:09:00.000+01:002009-11-02T21:14:17.992+01:00HP Photosmart C4280 Cartridge ProblemsIf you have an HP Photosmart C4280 Printer, HP might try to rob you… on ink cartridges. If the printer displays a message: <div class="level2"> <pre class="code">Print cartridge(s) missing or not detected.</pre> <p> It doesn't mean that! You might think that the cartridge is empty or damaged. You couldn't be more WRONG! It just means that HP wants YOU to BUY a NEW CARTRIDGE - but DON'T DO THAT! You cartridge is presumably fine! </p> <p> Actually you can try to convince the printer that the cartridge is ok by entering the <strong>service mode</strong>. To do that press buttons in the following sequence:</p> <ul><li class="level1"><div class="li"> Power and Cancel simultanously, then</div> </li><li class="level1"><div class="li"> Blue, Green, Gray buttons, in turn.</div> </li></ul> <p> Congrats! You entered the <strong>service mode</strong>. Now you can read and edit some of the printer settings. Watch the LCD display, it should say sth like: </p> <pre class="code">Support
PlxxFN0724AR</pre> <p> Now, the color buttons mean: </p> <ul><li class="level1"><div class="li"> Blue: next</div> </li><li class="level1"><div class="li"> Gray: previous</div> </li><li class="level1"><div class="li"> Green: enter</div> </li></ul> <p> Which allow you to browse the menu and options. </p> <p> In order to cure your cartridge press Blue once. You will see <code>Information Menu</code> displayed. Enter the menu by pressing Green. Go to <code>Pen supply, level of Ink (LOI)</code> submenu by pressing 11 times Blue and enter it by pressing Green. Then you can see some ink levels on the display. At this point your job is done. Press Cancel 3 times – it will quit the service mode. And you will notice that the nasty message about the cartridge being missing is gone. </p> <p> Putting it all together, to reset the message press: </p> <ul><li class="level1"><div class="li"> Power and Cancel simultaneously,</div> </li><li class="level1"><div class="li"> Blue, Green, Gray, in turn,</div> </li><li class="level1"><div class="li"> Blue</div> </li><li class="level1"><div class="li"> Green</div> </li><li class="level1"><div class="li"> 11 times Blue</div> </li><li class="level1"><div class="li"> Green</div> </li><li class="level1"><div class="li"> 3 times cancel.</div> </li></ul> <p> I found these service codes on the web and accidently i figured out that viewing the ink level resets the nasty message. The drawback is that you need to reset the printer pretty much every print job. </p> <p>It's been about 400 pages since I reset the thing and the cartridge is still operational despite its ink levels being reported as nonexistant. </p> </div>Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com160tag:blogger.com,1999:blog-490050120592333822.post-32672268227687726212009-11-02T20:47:00.000+01:002009-11-02T20:55:59.972+01:00Compiling Ubuntu 9.10 (Karmic Koala) Kernel<span style="font-weight: bold;"></span>If you want to compile an Ubuntu linux kernel don't: <div class="level2"> <ul><li class="level1"><div class="li"> use <code>make-kpg</code></div> </li><li class="level1"><div class="li"> use <code>make menuconfig</code></div> </li></ul>To get the kernel source issue: <pre class="code">apt-get source linux-source</pre> <p> It will download a TAR archive into your working directory. Untar the archive and cd into the directory with the kernel source. </p> <p> Re/Configure the kernel by issuing: </p> <pre class="code">debian.master/scripts/misc/kernelconfig editconfig</pre> <p> It will ask you to reconfigure all kernel flavours in turn. Reconfigure the flavour you want to alter, not changing the others. </p> <p> In order to build your kernel (the generic flavour) issue: <span style="font-family:monospace;">
<span style="font-family:Georgia,serif;"></span></span></p><pre class="code">CONCURRENCY_LEVEL=2 AUTOBUILD=1 NOEXTRAS=1 skipabi=true skipmodule=true debian/rules binary-generic
</pre><p> After a while you should see deb packages in the parent directory. </p> <p> If you want to come up with your flavour take a look at: <a href="http://mmlinux.wordpress.com/2009/07/30/how-to-compile-kernel-in-karmic/" class="urlextern" title="http://mmlinux.wordpress.com/2009/07/30/how-to-compile-kernel-in-karmic/" rel="nofollow">http://mmlinux.wordpress.com/2009/07/30/how-to-compile-kernel-in-karmic/</a> </p><pre class="code">
</pre><p><span style="font-family:monospace;"><span style="font-family:Georgia,serif;"></span></span></p><p></p></div>Igor Wojnickihttp://www.blogger.com/profile/06704266801664198119noreply@blogger.com0