Wednesday, 24 October 2018

Dell Color-Laser-1320c in Linux Debian Stretch with Cups 2.2

I do own a Dell Color-Laser-1320c since aeons and it always worked
well. I am on Debian but after a new install of Stretch (upgrade
failed) it did not work any any longer. I found out how I can get it
working again.


So I said it stopped working and what I mean by that is as a lpd network printer. I plugged it in via the usb interface and it was detected by stretch as Dell Color-Laser-1320c. But stretch was complaining about missing "printer driver". So I selected FX DocuPrint C525 A-AP which did work before and voila it worked like magic again (The FX DocuPrint C525 A-AP can be downloaded as rpm from FX driver side - alien - and you get a deb - it is i386 only - multiarch to the rescue just in case - for your convenience the deb is at link).


So lpd (aka networking) now. I just added a new printer with the URI lpd://IPorHostname:515/PASSTHRU, the same drivers and settings as with the usb.
So simple and stupid. The only thing I really struggle is I do not know why it works. But it still may help and save one more old printer ending up in the bin.

Monday, 4 November 2013

Beagle Bone Black: Owncloud Part 3



So actually this is a little ex curs into cryptography of the elliptic curve type:
ECC provides 2 features that are interesting to me for this project:

  1. Better security due to not being brute force-able by factoring only.
  2. shorter key-length and therefore better suited to systems with limited resources like the Beaglebone Black 
The drawbacks
  1. no support by CAs yet
  2. very limited browser support (Firefox an d Chrome do support only 3 of the many curve-types that are supported by openssl 
To generate a compatible key:
openssl ecparam -out myveryown-ecc.pem -outform pem -name secp384r1 -genkey
Make a signing request:
openssl req -new -nodes -key myveryown-ecc.key -keyout myveryown-ecc.pem -outform pem -out myveryown-ecc.req

Sign it as usual (for example with your own CA: openssl ca -keyfile MyCA.key -cert MyCA.pem -in myveryown-ecc.req -out owncloud.moosbauer.net-ecc-cert-myveryown-ecc.pem -outdir .) and enjoy

To Dos out of this: bring ECC to the file encryption feature of owncloud.

Part 1 Part 2

Wednesday, 30 October 2013

Beagle Bone Black: Owncloud Part 2

Part 1

Move data storage to nfs mount on my nas

That was an easy task:
  • service apache2 stop
  • mkdir -p /mnt/nfs/nas1/owncloud/data
    where /mnt/nfs/nas1 is the mount point of my nas device
  • cd /var/lib/owncloud/data
  • cp -r * /mnt/nfs/nas1/owncloud/data
  • chown -R www-data:www-data /mnt/nfs/nas1/owncloud/data
  • cd /usr/share/owncloud
  • rm data
  • ln -s /mnt/nfs/nas1/owncloud/data data
  • service apache2 start

first impressions so far

file encryption is slow, but that was to be expected
roundcube is an option (it works with gnupg) - this will be the next step an I will test it with imap to my google mail (I do use this @home with evolution and gnupg), before chosing, setting up and configuring a MTA

Tuesday, 29 October 2013

Beagle Bone Black: Owncloud

So hearing and reading all this NSA stuff, I thought getting back a little from the cloud would be nice. The intention is clearly not building a high performance sharing service but to have control over some files like my pwsafe file.

Owncloud has a good feature: it can be configured to encrypt data "in rest" using blowfish and with ssl you get encryption "in transit" as well

I selected Beagle Bone Black black for one reason: Power consumption

Selection the OS: Debian jessie
Be carefull: the new --dtb option did not work for me
sudo ./setup_sdcard.sh --mmc /dev/sdX --uboot bone swap_file 1024
did the trick.

Booting from sdcard - apt get update and apt-get upgrade and finally apt-get install <packages that could not be upgraded>.

Time for owncloud

The order of commands there needed a little adjustment to work for me
echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/ /' >> /etc/apt/sources.list.d/owncloud.list 
wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_7.0/Release.key
apt-key add - < Release.key  
apt-get update
apt-get install owncloud

Time for ssl

Did not need step 2 
And in step 9 the path for /etc/apache2/conf.d/owncloud5-ssl.conf was
/etc/apache2/conf-enabled/owncloud5-ssl.conf

That's it!

Things to do (maybe):
  1. Move data storage to nfs mount on my nas
  2. Integrating Mail - roundcube could be an option (if it works with gnupg)

Tuesday, 25 December 2012

mkv magic (repair and resize mkv)

I had am mkv HD film that did not work!

1st get some info:

mkvinfo -s /mnt/nfs/nas2/Movie/Fiction/Thor/video.mkv | head -5

Track 1: Video, Codec-ID: V_MPEG4/ISO/AVC (h.264-Profil: High @L4.1), Track ID für mkvmerge/mkvextract: 0, Standarddauer: 41.708ms (23.976 Bilder/Felder pro Sekunde im Falle eines Video-Tracks), Sprache: und, Pixelbreite: 1920, Pixelhöhe: 816, Anzeigebreite: 1920, Anzeigehöhe: 816
Track 2: Audio, Codec-ID: A_AC3, Track ID für mkvmerge/mkvextract: 1, Standarddauer: 32.000ms (31.250 Bilder/Felder pro Sekunde im Falle eines Video-Tracks), Sprache: und, Abtastfrequenz: 48000, Kanäle: 2
Track 3: Audio, Codec-ID: A_DTS, Track ID für mkvmerge/mkvextract: 2, Standarddauer: 10.667ms (93.750 Bilder/Felder pro Sekunde im Falle eines Video-Tracks), Sprache: und, Abtastfrequenz: 48000, Kanäle: 6
I Frame, Track 1, Zeitstempel 0 (00:00:00.000), Größe 1080, Adler 0xf822129c
I Frame, Track 2, Zeitstempel 0 (00:00:00.000), Größe 1534, Adler 0x07896a98

and extract the tracks

mkvextract tracks /mnt/nfs/nas2/Movie/Fiction/Thor/viodeo.mkv 0:mkv_video 1:mkv_audio1 2:mkv_audio2

and remerge

mkvmerge --default-duration 0:23.976fps mkv_video mkv_audio1 mkv_audio2 -o videout.mkv

did work for me

and resize:
Take the xtracted video track

ffmpeg -i mkv_video -vcodec libx264 -preset ultrafast -s 1280x544 -acodec copy video-544.h264

and remerge as before

mkvmerge --default-duration 0:23.976fps video-544.h264 mkv_audio1 mkv_audio2 -o videout-smaller.mkv

Thats it
PS Screenrecording with ffmpeg
ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq output.mpg
PPS copy ts to mkv (without subtitles)
ffmpeg -i Infile.ts -vcodec copy -sn -sameq -acodec copy -f matroska Outfile.mkv

Friday, 8 June 2012

Linux Kernel-3.4.0 on TS-7250

Grabbing the sources, extracted them, cp the .config from my 2.6.34.7 branch, make menuconfig (with the TS supplied cross toolchain) and finally make ended with compile errors. Googling quite some time for the errors had the result gcc to old and I need a new toolchain. Searching for one to no vain brought me to  crosstool-ng. I had to build it for myself which was straight forward. You can grab the toolchain and my environment setting here.
Finally making the kernel (config is here) was OK and I gave it a try using nfs boot. And to my surprise it worked !!!
I did not yet change anything on the flash so I boot into the stock kernel 2.4 and use the bootloader module from TS. Next I was giving it a try with mounting the rootfs from USB. And that was when the trouble started (Works flawless with Linux-2.6.34.7):

  • Kernel Loading with rootdelay=10
  • .....
  • mounting rootfs
  • usb 1-1: reset full speed USB device using ep93xx-ohci ...

 This happens only when trying to mount the usb thumb drive as rootfs. As non rootfs there is no problem at all. And this time I googled in vain. Some guys had similar problems, there was also a blog entry from 2009 describing the same behaviour. But no solution....

initramfs to the help

I really do not have any clue on how the USB subsystem in LINUX works and as of now have other priorities. So the idea was booting with a small rootfs (initramfs) and hopefully switch_root to the USB thumb drive. I did learn a lot on reading on the internet about initramfs (especially here and here and here) and finally managed to build and use one
The init works like this:
  • mounting proc and sysfs
  • mknode and mdev -s
  • mount the "real" rootfs
  • check /init
  • unmount proc and sys
  • switchroot to the "real" rootfs on the USB thumb drive
  • and again : usb 1-1: reset full speed USB device using ep93xx-ohci ...
And then I was very lucky: Somehow I thought of mounting the "real" rootfs in the initramfs read only and the magic happend: switch-root to the rootfs on the USB thumb drive worked !
Here is my initramfs.cpio.gz as of now.
Why it does work this way is still a mystery for me, but I am sure the community will know.

What has to be done:

The Booting is still not fully automatic. There is a problem with the init in initramfs, that alwas drops me to a shell. Then I can mount the "real" rootfs ro and switch-root to the USB thumb drive.


How I came into it



In 2009 I decided to start experimenting with SBCs. Soon I came across Technology Systems and got the TS-7250. It still powers the control unit for the (partial) solar heating of our house. It was all done in "non embedded" style and I am still fine with the functionality.
But something was not right: I had a Linux system and did use it like a micro controller. So I started the journey, I am still on. Impressed by the work of Mathieu Crapet, I soon got a working Linux-2.6.34.7 that used a rootfs on usb.
Using owfs and sysfs for controlling GPIOs did make the whole stuff really simple and straightforward.
That was too easy and the linux-3 kernel series came out so I wanted to give this a serious try.
Here is the result:



But how I got is worth its own Blog story.