Donnerstag, Mai 06, 2021

closing down blogger

I started to use /blogger/ at a time you hadn't access to all your data on all your devices.
So for some notes I thought is was useful to put these on the net to be able to search for them from every computer.

This worked, only partly. Many notes I've taken where to /chaotic/ even for a blog named this way and only a view I did later polish to be published.

With time the sync between the devices got simpler, USB stick sizes increased and most notes where on the phone anyway. And today all notes are in a git repo that is cloned to all my computer, phone and tablet.

This is the last post here. The posts here and all other I've written in different locations over time will be moved into a git repo. This will be public on Github/Gitlab and /converted/ to there /pages/ to be readable like a blog again.

As this data is on the waybackmachine I don't feel to bad if I delete this account/blog in the future. And the information was only for my own benefit anyway and if someone else found this useful it was unintended 😀

Donnerstag, September 06, 2018

static web page

Jekyll

By far the most used generator.
This needs to install a specific version of Ruby. Read that some peoble on MacOS run into trouble at one point in time. Had similar bad expiriance with Java and perl.
Read here that Liquid templates provide only basic customization. Or you would need to write an own Liquid helper. I’m not into Ruby on the other hand would I change the existing templates that much?

HUGO

This is the number two used generator. But the 3rd Next is realy close.
Followed the example to get it running on my iMac (Homebrew). But after this I didn’t like the documentation. I couldn’t find the things I was looking for.

Nikola

Know about this from Mike Zamansky video 35 Blogging. He switched from Jekyll to Nikola because he is familiar with Python and not Ruby.
The documentation is by far the best of all I looked at.

Template usage Jekyll Hugo Nikola
Jinja2 19 X
Liquid 12 X
Jade 10
Go Templates 7 X
Mako 4 X

(This table was generaged with Hugo from Markdown. To paste needed to be in HTML)

Samstag, Januar 10, 2015

iTunes cannot read the contents of the iPad

Connected my iPad and got the error message iTunes cannot read the contents of the iPad. The only option was to restore the device.

Searched for the error message and found apple support page with lots of errors and possible solutions. For me Reset the Lockdown folder did the trick.

Disconnected the iPad and closed iTunes. From /var/db/lockdown I removed the plist file that was left over from the last sync. The date gave it away. Connected the iPad again and all worked fine.

Sonntag, August 24, 2014

start Btrfs with one disk and add second for RAID1 setup

The new file server will contain two 4TB disks as RAID1 and a single 4TB disk for of side backup. All three disks are different to spread the risk of failing at the same time. The RAID disks will be a WD red and a Segate NAS. The backup disk a WD green. Unfortunately the Segate was out of stock.

To test how simple it is to start with only one RAID disk I added two disk to a VM and did all needed steps there. From the starting point off the simple creation to starting the RAID.

To verify this, I created some files on the first disk and compared the hash of the files after the test.

1. create the file system with one disk

[root@centos ~]# mkfs.btrfs -L test_merge_HDs /dev/sdb
SMALL VOLUME: forcing mixed metadata/data groups

WARNING! - Btrfs v3.12 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

Turning ON incompat feature 'mixed-bg': mixed data and metadata block groups
Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
Created a data/metadata chunk of size 8388608
fs created label test_merge_HDs on /dev/sdb
nodesize 4096 leafsize 4096 sectorsize 4096 size 500.00MiB
Btrfs v3.12

[root@centos /]# btrfs fi df /mnt/merge/
System, single: total=4.00MiB, used=4.00KiB
Data+Metadata, single: total=8.00MiB, used=28.00KiB

[root@centos /]# btrfs fi show 
Label: test_merge_HDs  uuid: b5aa052e-b44c-4e80-8e2b-3b7d04eb19e4
Total devices 1 FS bytes used 32.00KiB
devid    1 size 500.00MiB used 12.00MiB path /dev/sdb

Btrfs v3.12

2. add the second disk

[root@centos /]# btrfs device add /dev/sdc /mnt/merge/
SMALL VOLUME: forcing mixed metadata/data groups

[root@centos /]# btrfs fi df /mnt/merge/
System, single: total=4.00MiB, used=4.00KiB
Data+Metadata, single: total=8.00MiB, used=28.00KiB

[root@centos /]# btrfs fi show 
Label: test_merge_HDs  uuid: b5aa052e-b44c-4e80-8e2b-3b7d04eb19e4
Total devices 2 FS bytes used 32.00KiB
devid    1 size 500.00MiB used 12.00MiB path /dev/sdb
devid    2 size 500.00MiB used 0.00 path /dev/sdc

Btrfs v3.12

3. start the RAID

[root@centos /]# btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/merge/
Done, had to relocate 2 out of 2 chunks

[root@centos /]# btrfs fi df /mnt/merge/
System, RAID1: total=32.00MiB, used=4.00KiB
Data+Metadata, RAID1: total=112.00MiB, used=100.00KiB

[root@centos /]# btrfs fi show 
Label: test_merge_HDs  uuid: b5aa052e-b44c-4e80-8e2b-3b7d04eb19e4
Total devices 2 FS bytes used 104.00KiB
devid    1 size 500.00MiB used 144.00MiB path /dev/sdb
devid    2 size 500.00MiB used 144.00MiB path /dev/sdc

Btrfs v3.12



new file server with Btrfs

It's time to update my file server. The last time I decided to use a modern file filesystem - ZFS. As there was no real Linux support I played with it on FreeBSD. But the best support at the time was in Sun's Solaris of corse. As I didn't know both system very well I choose OpenSolaris. Unfortunately this was one of the looser of the Sun acquisition.

The next time, I decided, every thing should be better. Lets see.

My knowledge of BSD isn't better as five years ago. Therefore my first decision is to stick with what I know - Linux. As the ZFS support is not really better I will use the Linux version of the modern filesystem - Btrfs. It is still marked as unstable, but some Linux distribution, including Oracle, changed the status from experimental to production. And in my case, where I use basic features only, there shouldn't be any problem.

As a Linux distribution I choose CentOS over Debian.  The long term support is better (longer) and I administrated RHEL machines at work for around 3 years. And as a desktop system I use Fedora for quite some time and impressed me with the SELinux integration. Therefore I don't expect any surprises.

Samstag, August 23, 2014

show open iCloud Tabs in shell

I've got the idea from this macstories post. In the attached Python script you find not only the location where the OS keeps the information. But also how to access it.

After I had a look at the man page for plutil I started my own test.
plutil -p ~/Library/SyncedPreferences/com.apple.Safari.plist
This will display the informatio in a JSON looking format.
plutil -convert xml1 -o /tmp/iCloudTabs2.xml  ~/Library/SyncedPreferences/com.apple.Safari.plist
Converts the information to XML. Don't miss the -o or it will overwrite the original file. Instead you could also use -e xml to write to a file with the new extension.

The output contains the device, URL, page title and more. If I find some information on the iPad and want to save, I keep the tap open. The next time at the Mac the URL to download this with curl or wget is already there.

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 $_ }

Sonntag, November 07, 2010

Palm Wireless Keyboard and Nokia 6710 Navigator

Download Wireless Keyboard for your phone. In the case of the 6710 it is the Series 60 3.2 edition at the bottom of the page.


  • Copy the downloaded file to your phone and use the File Manager to start (install) it. Run Programs - Installed - Wireless Keyboard.

  • Press the "On" button the Palm Wireless Keyboard an wait till the Bluetooth LED starts to blink.

  • Enter a four or more digit number on the phone

  • Repeat this number on the keyboard (press enter)

Samstag, Oktober 23, 2010

NSLU2 downgrade from Debian to OpenWrt

Flashed openwrt-nslu2-squashfs.bin onto the NSLU2 over a Debian installation. After a reboot only the green Ethernet LED was on. A ping to the old IP address, 192.168.1.1 or 192.168.1.77 didn't work. Switching of the NSLU2 with the power button failed.

But what I noticed was that a ping to 192.168.1.1 produced no response but all other Destination Host Unreachable.

arp -an revealed for 192.168.1.1 the correct MAC address all other IP showed <incomplete>.

Unfortunately I couldn't find an upgrade story from Debian to OpenWrt on the internet. But I thought to remember that Debian used a different flash layout.

So I followed this description to erase the SysConf area and installed the Linksys Firmware.

As to be expected only the third attempt to enter the RedBoot worked. The first time the message to press ^C appeared, but no reaction. The ^C came to late. If correctly timed RedBoot > will appear.

After this the boot was successful and the installation of OpenWrt succeeded  without a problem.

Sonntag, September 05, 2010

some Java and Eclipse pitfalls on OS X

Could not compile Java code importing com.sun.net.httpserver.HttpServer. The error message is: Access restriction: Class is not accessible due to restriction on required library

fix: go to teh Java compiler sttings and open Errors/Warnings. Check the Deprecated and restricted API and change from Error to Warning.


Check downloaded files with ll -@ for com.apple.quarantine. Remove with sudo xattr -d com.apple.quarantine.


Some JNI libs need to be recompiled for Snow Leopard. Check with file for Mach-O 64-bit bundle x86_64.


Use System.out.println(System.getProperty("java.library.path")); in the line before the line before the class is loaded. Check if the library is in one of the paths listed. On OS X use /Library/Java/Extensions/.

Donnerstag, Juli 01, 2010

samba mount without user account

It is not possible to mount a samba share without an user account on the server, even with the share set to public = yes. The reason and how to fix this is described here.

in short add/change smb.conf:

[global]

guest account = nobody
map to guest = bad user

[public]

comment = common downloads
browseable = no
path = /mnt/hd/location
public = yes
read only = yes

Montag, April 26, 2010

DSL with Eclipse

A short time ago I had listened to the heise Developer podcast Episode 20: Architektur als Sprache. Shortly after this an article with an interview showing the use of this. They also used the Eclipse based tools mentioned in the heise podcast - Xtext and Xpand.

Freitag, Januar 15, 2010

TrueCrypt "wrong password" on OS X

Installed TrueCrypt on OS X and plugged in an USB stick completely entcrypted with Windows XP. Surprisingly the device select dialogue showed not only the device but also two partitions. No matter what was selected TrueCrypt complained about the password.

Tested the stick under Windows again and worked fine. After reboot of the OS X system TrueCrypt worked also as expected. Only the device was shown and after entering the password the device was accessible.

Not sure if a reboot was needed after TrueCrypt installation. It might also be some "remembered" info about the stick that was gone after the last "use" was unsuccessful.

Sonntag, Dezember 06, 2009

merge after pull failed

Did a commit on both repositories. The pull worked fine but the needed merge failed with abort: outstanding uncommitted changes. Checked again the status but there was no M. After some reading I encountered that deleted but not removed files ! are ignored by the commit but not by merge.

fix: hg remove <file>

Now the merge run, but let to unresolved merges. After merging the files by hand the commit failed with abort: unresolved merge conflicts. hg resolve -a showed that Mercurial didn't recognise the merges done by hand.

fix: hg resolve -m

This marked all the unresolved merges as resolved. After this the commit worked as expected.

Samstag, November 21, 2009

get text only from selected element

The jQuery method text() returns the text not only of the selected element, but also of all sub elements.

To get only the text of the selected element clone it first, than remove all children. After this call text().

Sonntag, November 08, 2009

changing Java version on Mac crashed eclipse

Checking the javac version from command line told me I was using 1.5. To change this I changed the Current and CurrentJDK. This worked fine for Java programs run from the shell.

The next restart of eclipse failed. Remembering that there should be a new version for Cocoa by now I downloaded the new 64bit eclipse version. Crashed with the same error messages.

Changed -Dosgi.requiredJavaVersion in eclipse.ini to 1.6 -> crash

Added Info.plist in Eclipse.app the line to require a specific Java version -> crash

Searching the internet for a solution I encountered the changing the link to select a Java version will bite you. This should be done with Java Preferences (Spotlight). Unfortunately the tool didn't start. Setting the links back to A changed this. With this tool you change the ordered of the preferred Java version.

With this changes eclipse started - and noticeably faster. The Activity Monitor now shows Intel (64bit). On the shell javac is now also 1.6.