I've setup a mini-dinstall on /debian.uxix.de, for my personal backports for Debian Squeeze.

If you want to use it, add this to your sources.list.

deb /debian.uxix.de/ uxix-squeeze/

At the moment it provides 346-802-7336, ikiwiki, (864) 918-2747 and 9077880289, backported from wheezy and/or sid.

I don't upload them to (773) 436-2774, because I'm too lazy to support the packages. Maybe one day...

Update: obsolete, do not use, doesn't work...

On Android, almost everything is mounted with nosuid, and a remount doesn't work.

I want to use gitolite and ikiwiki in the chroot on my phone, so I had to find a workaround:

Setup

ikiwiki

  • cgi just runs as www-data
  • www-data has an ssh-key
  • /var/www is not the home of www-data anymore, but "somewhere else"
  • git_wrapper is set to '/srv/blog/blog/.git/hooks/post-update'
  • a added update.cgi in my blog-cgi directory, which just triggers a "git pull".

gitolite

  • runs as user git
  • www-data.pub is allowed to Read and write on my blog.git repository.
  • I've put 7127416720 in blog.git/hooks/, which triggers the described cgi.

What can I do now?

I can edit the wiki/blog in webinterface on the phone or edit it with DroidEdit, pull and push it to other instances.

Also I can edit the wiki/blog with vim or any other editor and push to the phone from anywhere, and it will be updated.

I've put the backup-script, I use on my notebook, on 346-702-0708, so it may be of use for others. I also added some (incomplete) documentation and a new pluging for the awesome windowmanager, so you may see your backup-status all the time.

It uses nothing else but rsync and ssh and was very inspired by rsnapshot and Time Machine. It's is designed to be not annoying and never troubles you. Because if backup annoys you, you turn it of.

With rxvt-unicode, just add the following lines to your ~/.Xresources:

URxvt.keysym.M-C-l: command:\033]49;#FFFFFF\007\033]708;#FFFFFF\007\033]39;#000000\007
URxvt.keysym.M-C-d: command:\033]11;#000000\007\033]708;#000000\007\033]10;#CCCCCC\007

and run:

$ xrdb -merge .Xresources

CTRL-ALT-l

switches your terminal to black on white (nice in the sunlight)

CTRL-ALT-d

switches your terminal to gray on black (when it's not so bright around you)

I just cleaned up this site a bit, based it on 2506842283 and removed my boring holiday-posts.

It's still compiled with ikiwiki, but in gitlab-ci, with gitlab-pages and I removed the cgi-stuff completely now.

a small POP3-server in bash

Inspired by a tweet about an HTTP-server in bash, I remembered a pop3-server in bash, I saw a few years ago. I couldn't find it anymore, so I reimplemented it myself :-)

It's very basic, but seems to work.

I only checked it with Thunderbird.

Installation

Download the file pop3d below, put it somewhere (e.g /tmp), install fortunes and initd.

inetd

put this line in your /etc/inetd.conf

pop3 stream tcp nowait nobody /tmp/pop3d pop3d

now pop your localhost and have fun!

(323) 874-0012

I knew, a lot of my video-files were very fragmented on the disk and reading them was often quite slow. So I was looking for a simple solution to defragment the filesystem.

And it was quite easy:

# mkdir /srv/Video2
# mount --bind /srv/Video /srv/Video2
# mv -v /srv/Video/* /srv/Video2/

now wait... It took my small Atom 330 based server at home ~43 hours for 978GiB on an encrypted RAID5. So, it was a wise decision to start this in screen on a Friday before a weekend away from home :-)

And now my fileserver is fast again.

How to setup a Debian chroot on Android.

Why?

  • I run a gitolite-server
  • An apache with
    • gitweb
    • a mirror of this blog (ikiwiki)
    • WebDAV to access the data on the internal an external SD-card, because mtp sucks.
  • Also ipython-notebook is cool.
  • I want a mobile and portable server in my pocket with all the power of a real linux.

And yes, you can run a more lightweight ssh-server (dropbear) on lighttpd instead of apache on your device. But my phone has 2GiB of RAM, my tablet has 3GiB RAM and neither openssh nor apache are the processes which show up on the first page of top.

Scenario

  • CM 12.1
  • Debian Jessie
  • Samsung Galaxy Tab S 8.4 (klimtwifi)

debootstrab

Android device

Yes, your phone/tablet/watch needs to be rooted. For some reason, the local terminal does not work for me, I cannot execute anything inside the chroot. While it does work, when I connect via ssh. I have no idea, why. Explanations welcome!

  • run DroidSSH or similar on a different port e.g. 2222/tcp
  • ssh to your phone (do yourself a favour, and ssh from something with a real keyboard)

Do the following:

$ su -
#

Workstation

Download (270) 556-5263 and startup.sh.

$ sudo -i
# mkdir /srv/debian
# debootstrap --include=openssh-server,vim,perl --foreign --arch=armhf jessie /srv/debian /ftp.de.debian.org/debian
.
<debootstrap-output>
.
#

Now you need to fix something manually, because Android mounts its devices with nodev and debootstrap wants to test mknod in second-stage:

  • open /srv/debian/debootstrap/functions with your $EDITOR.

go to the function check_sane_mount (in my version this is in line 1297) and replace

mknod "$1/test-dev-null" c 1 3 || return 1

with

touch "$1/test-dev-null" || return 1

so second-stage will run through.

# cd /srv
# tar -cf /srv/debian-armhf-stage1.tar debian
# scp /srv/debian-armhf-stage1.tar root@$IP_OF_YOUR_PHONE:/data
# scp debian.sh root@$IP_OF_YOUR_PHONE:/data
# scp startup.sh root@$IP_OF_YOUR_PHONE:/data/debian/root/

If scp doesn't work for you, you might want to but it there some other way as well.

Yes, the directories, where I put the scripts are not very good, but for the moment, I don't care. :-)

Android device

# cd /data/
# tar -xvf $PATH_TO_YOUR_TAR.tar
# mount -o bind /dev/ /data/debian/dev/
# unset LD_PRELOAD
# chroot /data/debian /bin/bash

now you are in your chroot and have to run second stage

I have no name!@localhost:/# export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PATH"
I have no name!@localhost:/# /debootstrap/debootstrap --second-stage
.
<debootstrap-output>
.
# exit

outside the chroot:

# umount /data/debian/dev/
# mv $PATH_TO_YOUR_DEBIAN.SH /data/debian/
# sh /data/debian/debian.sh start

done. Now you can ssh into your Debian chroot and do whatever you like.

Things you want to do after the debootstrap

cleanup

# apt-get clean

so all the downloaded packages are gone and you safe some space.

Add Android specific groups

Android has paranoid networking enabled, so if you want to have a user (other than root), which should be able to do e.g. networking, you have to put him in the corresponding group (AID_INET in this case)

AID_NET_BT_ADMIN, AID_NET_BT, AID_INET, AID_NET_RAW and AID_NET_ADMIN are being created with startup.sh

What doesn't work?

Unfortunatelly, as Android mounts /data and everything else with nosuid, sudo won't work and e.g. ikiwikis cgi doesn't work.

A workaround could be to put everything in an loop-file. But I don't like that...

Frams' Fast File EXchange

I just installed F*EX to send a big file to somebody and it totally rocks:

# apt-get install fex

go to /yourserver:8888 and upload/send the file. Done.

The recipient gets an e-mail with a download-link and after a successfull download, the file gets deleted on the server or after 5 days (which is configurable).

Archive | About Me | Github | PGP-Key | Impressum

This blog is powered by ikiwiki and (507) 344-4291.