Freitag, August 22, 2014

don't use "Inspect Element" to design filter rules

Never use your browsers Inspect Element to look at the HTML and expect it to be like this in the transmitted file!

I tried to use this to design a filter for Privoxy to remove a . The browser showed me the line as
But even
s///Usig
didn't remove any of the links. And I gave up.

Only after I was working at an other filter and using View Source to look a the HTM code I realised the difference. For Inspect Element the browser will use it's internal representation. And this results not only in the use of end tags, but also a different order of attributes.

A look at the actual source showed that the line in question actually looked like this
Now I was able to design the filter like this
s///Us
to remove the line.

Sonntag, Mai 11, 2014

running linux server headless in VirtualBox

For tests I use a simple arch linux installation with out X installed. This saves quite some RAM. But I had still the Window of the VM, that I was not using. Instead I used multiple ssh logins with different sized terminal windows.

There should be a way to run the VM headless, like the real server. A search brought me to this description on running a VirtualBox headless and using a RDP or SSH connection.

For me this boils down to:

  1. list the available VMs: VBoxManage list vms
  2. start the VM: VBoxManage startvm arch --type headless
  3. connect as usual: ssh user@address
  4. and switch off the VM after a shutdown: VBoxManage controlvm arch poweroff


Samstag, August 18, 2012

copy/move files with find

To copy or move files from different locations in a subtree into a single directory find is your friend.

find . -name "select_*" | while read f; do cp -iv $f ~/destination/${f##.*/}; done

My natural first try with -exec didn't work. I was not able to use parameter expansion of the shell on {} from find. Assigning the -exec parameter {} to a variable and use it with the next command didn't work, because find interpreted the ; as exec end. Escaping the -exec command with "" did result in No such file or directory.

[todo] Play with this in a quite minute.

Montag, November 28, 2011

couchdb port installation trouble

Looking for a simple way to synchronise data from an Android phone I found a suggestion to use couchdb. Simply typing sudo port install couchdb didn't work. All suggestions found via google didn't help.

So I did, what I should have done at the beginning. I read the installing and error messages article on the couchdb wiki.

After this I did:
  • sudo port install erlang -universal

  • sudo port install couchdb-devel
and it worked fine.

[update 12.08.2012] Running sudo port upgrade outdated stopped with

Error: org.macports.configure for port couchdb-devel returned: command execution failed

So I removed couchdb and erlang, as it also was updated and redid the above steps. It failed again. Checking the log file it showed

this file was generated for autoconf 2.61.
You have another version of autoconf. If you want to use that,
you should regenerate the build system entirely.

This was not, what I wanted to do. I tried to install couchdb instead (no -devel) and it worked. Next time I will try to install erlang without -universal

I had to start the couchdb demon multiple times before I was abale to connect. Not sure why.

Samstag, August 06, 2011

change NTFS file owner

Changing the owner of a NTFS file with set-acl failed with the errro "Set-Acl : The security identifier is not allowed to be the owner of this object". Found the explanation here. The reason in my case was that I tried to set the user myself, but the owner was the admin.

I was able to do the change with the explorer. But this works only for a single file. If more than one file is selected the contect menue to change the security is not available.

There are some older tools like xcacl but this should only be used with older Windows version (2000 and before). There are also some newer tools for this, but not from Microsoft.

The solution for me was to add read access for all local user. I changed the ACL of one file with the explorer to the desired owns and used the following powershell command to set the ACL to all other files.

ls file[1234] | foreach { get-acl ..\fileWithGoodAcl | Set-Acl $_ }