Cannot open file (/home/u0059333506/public_html/wordpress/wp-content/backup/.htaccess)Cannot write to file (/home/u0059333506/public_html/wordpress/wp-content/backup/.htaccess) coding « Hanno’s Coding Log

Archive for the ‘coding’ Category

Ubuntu .deb packaging

Here are some of my bookmarks regarding .deb packaging.

Building Package from source:
http://www.quietearth.us/articles/2006/08/16/Building-deb-package-from-source

Building package from binary .tar.gz. (via Alien)
Do not use for .tar.gz from vendors who supply their own installer. (VMWare for example.)
http://www.martin-bock.de/pc/pc-0012.html

CDBS Documentation (Common Debian Build System) - especially nice for packaging python modules.
https://perso.duckcorp.org/duck/cdbs-doc/cdbs-doc.xhtml

Ubuntu Packaging Guide
https://wiki.ubuntu.com/PackagingGuide/

Nice introduction to the debian maintainer scripts with diagrams on how it all fits together:
http://women.debian.org/wiki/English/MaintainerScripts

happy Linux convert

I finally did it. I’ve been running Ubuntu 7.10 on my personal desktop for a bit more than a week now. I never felt the urge to boot into windows again ;)

Configuration tweaks because of special hardware were minimal. MP3 collection, Slimserver, Komodo, etc. — all is up and running angain.

I also got my own Ubuntu Package Archive now and built my first Package. I packaged Robin Sonefor’s Blogposter Plugin for Tomboy, an excellent note taking program for Gnome.

More later…

news on cover art

Chris Bowron just released a new version of foo_sendtodevice, including my contribution for copying cover art files.

accessing the Windows Media Devices API

I am currently working on a Python library for accessing MTP-based MP3-players via the Windows Media Devices API.

Current preview and development versions are available from Pypi.

You can find further information on the project page.

more cover art

I am currently working on a patch for foo_sendtodevice, an MP3 player plugin for the excellent Foobar2000.

Chris Bowron was so kind, to send me the source code. My patch will allow to automatically copy album cover art in separate files to the device, too.

MP3 Cover Art Embedder and Resizer

I updated my Cover Art Resizer program.

New features:

  • configurable output verbosity
  • allows wildcards in directory names
  • “force” switch for thumb.jpg re-creation

The program takes one or more paths as an argument, searches the entire directory tree for “cover.jpg” files and creates “thumb.jpg” files in 100×100 pixels size. It also embeds the thumb.jpg into the mp3s found in the directory.

It requires the Python Image Library and Mutagen. (If you have setuptools installed, the dependencies will be installed automatically)

You can install by running python setup.py install from the source code distribution or installing the supplied EGG or using the EXE.

Run coverresizer -h for help. (Your Python Scripts directory must be in the PATH)

Files:
Coverresizer 0.3 Source Distribution
Coverresizer 0.3 Windows Installer EXE
Coverresizer 0.3 EGG for Python 2.4

thumbnail creator for cover.jpg / album art

I just wrote a small python script that allows you to create thumbnails on all your cover.jpg album art in your MP3 collection.
Make sure you save the covers as cover.jpg in the folder that contains the MP3s. This is recognized by most programs.

With this script you can generate thumbnails for all the cover.jpg files:

#!/usr/bin/env python
import sys
from os import path, walk
from PIL import Image, ImageOps
 
def process_path(dir):
    for dirpath, dirnames, filenames in walk(dir):
        for name in filenames:
            if name == "cover.jpg":
                if not path.exists(path.join(dirpath, "thumb.jpg")):
                    process_image(dirpath, name)
        for name in dirnames:
            full_path = path.join(dirpath, name)
            process_path(full_path)
 
def process_image(dirpath, name):
    full_path = path.join(dirpath, name)
    print full_path
    img = Image.open(full_path)
    img = img.resize((100,100), Image.BILINEAR)
    img.save(path.join(dirpath, "thumb.jpg"))
 
if __name__ == "__main__":
    dir = sys.argv[1]
    print dir
    process_path(dir)

You’ll need the Python Imaging Library. Just call the script with the root path of your MP3 collection as the first command line parameter.

You might want to import the thumbnails into the MP3s with software like MP3Tag.

kNose 1.0 released

Brandon Corfman has just released kNose 1.0, a Komodo IDE/Edit extension for the Python unit testing framework “nose”.

Previous screenshots looked quite promising and I am looking forward to trying it out.

However, I won’t have the time at the moment, because of heavy workload and a non-pythonic day job. ;)

Update: kNose 1.1 has just been released.

dynamic graphics in AJAX applications

Michael Mahemoff, author of Ajax Design Patterns, has a nice overview of solutions for dynamic graphics on AJAX enabled web pages.

He covers eight different possibilities, most of them with code examples. It seems like there is still no real solution that works across all browsers and doesn’t require a plugin. Dynamic creation of SVG or VML code looks like the most appealing solution to me. However you would have to do both, depending on IE or other browsers.

Scope and foreach loops

One of these misunderstandings: I always thought foreach loops would create a temporary variable for the current element that would mask any variable with the same name in the current scope.

Obviously that is not the case, as I discovered when I tried to find a bug in Simple Tagging’s STP_RelatedPosts() function.

First I thought this was a PHP-only behavior… But see the following PHP and Python examples:
More »

Stoppt die Vorratsdatenspeicherung! Jetzt klicken & handeln!Willst du auch bei der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien: