scip daemon blog atom feed /blog/ 2018-10-28T12:11:00Z de scip hidden 2018-10-28T12:11:00Z 2018-10-28T12:11:00Z /blog/2018/10/28/453/steinmetzmehl-qualitat-die-ankotzt/ Steinmetzmehl - Qualität die ankotzt

Es gilt als das beste Mehl der Welt. Jetzt gibt es die Produkte von Steinmetz unter der Marke „Unsere Heimat – echt & gut“. Ein einzigartiges Verarbeitungsverfahren macht aus regionalem Getreide ein echtes Premium-Mehl.

schreibt Edeka auf seiner Webseite.

Ich hatte dieses Mehl schonmal da und es nicht weiter verwendet. An den Grund konnte ich mich nicht mehr erinnern. Nun hat es meine Frau wieder gekauft (ich hatte 550 auf den Zettel geschrieben). Heute - am Sonntag - wollte ich mein Livieto Madre füttern und plötzlich fiel mir wieder auf, weswegen ich dieses Mehl nicht mehr haben wollte:

Es enthält Spelzen!

Nun habe ich ja gelernt, dass der deutsche Standard 550 ein Mahlgrad ist. Mahlgrad in Form von "Alle Körner haben ungefähr die gleiche Grösse". Das hat der Müllerei Steinmetz in 120 Jahren wohl noch nie jemand gesagt. Auf jeden Fall scheint die "Erfindung" des Herrn Steinmetz nichts zu taugen, wenn da nach dem Sieben noch Spelzen im Mehl sind.

Streng genommen wäre das ja sogar Betrug. Denn wenn Vollkornmehl in der Tüte ist, muss man es auch draufschreiben. Tat man bei Edeka/Steinmetz aber nicht. Tja. Faulheit? Unwissenheit? Inkompetenz? Oder einfach nur ein paar Dilettanten bei der Arbeit? Man weiss es nicht.

Vielleicht finde ich ja mal die Muße im Edeka den Marktleiter darauf anzusprechen, viel bringen wird das aber wohl nichts.

Bild: Ich hab mal eine kleine Handvoll ausgesiebt
Ich hab mal eine kleine Handvoll ausgesiebt (Oct. 28, 2018, 12:29 p.m.)
[Tags: ] [Album: Backdat ]
Bild: da sind sie, die Spelzen, gar nicht mal so wenige
da sind sie, die Spelzen, gar nicht mal so wenige (Oct. 28, 2018, 12:29 p.m.)
[Tags: ] [Album: Backdat ]
Bild: Qualität, die ankotzt
Qualität, die ankotzt (Oct. 28, 2018, 12:29 p.m.)
[Tags: ] [Album: Backdat ]
Bild: 550 steht drauf, ist aber nicht drin
550 steht drauf, ist aber nicht drin (Oct. 28, 2018, 12:29 p.m.)
[Tags: ] [Album: Backdat ]
]]>
scip hidden 2018-05-24T15:55:00Z 2018-05-24T15:55:00Z /blog/2018/05/24/452/eu-dsgvo-daemonde/ EU-DSGVO @daemon.de Lutz Donnerhacke hat sehr gut beschrieben, wie man als Privatblogger mit der neuen EU Datenschutzverordnung umgehen muss. Ich habe mir meine Seite also äquivalent genauer angeschaut und festgestellt, dass ich - wie im Impressum bereits beschrieben - keine IP-Adressen speichere und Email-Adressen optional sind und diese wiederum auch NUR wenn man kommentieren möchte.

Da ich in letzter Zeit aber ohnehin kaum noch zum Posten komme und schon seit langer Zeit keine Kommentare mehr gepostet worden sind (Spammer wurden recht wirksam von meinen Abwehrmaßnahmen ferngehalten, falls jemand den Django Code haben möchte: einfach bei mir melden) - habe ich beschlossen, dass ich das Feature auch einfach ausschalten kann.

Gesagt, getan. Kommentare sind ab sofort abgeschaltet, vorhandene Kommentare und die Daten der Kommentierer habe ich alle gelöscht. Zack und aus. Somit speichere ich überhaupt keine personenbezogenen Daten mehr, die ich gemäß EU-DSGVO dokumentieren müsste.

Meine Datenschutzerklärung im Impressum habe ich entsprechend angepasst.

]]>
scip hidden 2017-08-03T17:24:00Z 2017-08-03T17:24:00Z /blog/2017/08/03/451/emacs-lisp-which-key-was-pressed/ Emacs lisp: which key was pressed? Sometime you might want to know which key was pressed last in a lisp function. I came up with this little function for this purpose:

(defun last-key ()
  "Return the last key pressed."
  (car (reverse (append (recent-keys) nil))))
]]>
scip hidden 2017-07-17T10:37:00Z 2017-07-17T10:37:00Z /blog/2017/07/17/450/autoscratch-solve-scratch-buffer-problem/ autoscratch - solve the *scratch* buffer problem - Updated 02.08.2018 05:51 I use emacs for more than 20 years now. I love it, I am addicted, I can't even do anything productive without it. However, there was one problem left: the *scratch* buffer. This is a non-file buffer, which always exists always in emacs. By default it has emacs-lisp-mode enabled and you can use it to hack short elisp sexps for testing. In fact I use it for exactly this purpose.

But sometimes I hate it as well! I get a phone call and need to take a note quickly, *scratch* is already open, so I use this. But the mode doesn't really fit. So I switch to text-mode and then enter the notes. I did it this way almost since day one of my emacs usage.

A couple of months ago I came up with a "solution", I just create a *text* buffer on startup with text-mode already enabled in my .emacs. But I still need to switch to it everytime I need it. Still too annoying!

So now, here's my final solution, which tries to fix this mess once and for all: autoscratch.

This major mode is really simple. Basically it consits of an alist with instructions on how to automatically switch the *scratch* buffer mode. Enter an "(" and it switches to emacs-lisp-mode, enter "*" and it switches to org-mode, enter some letter a-z, and it switches to text-mode. You get the idea.

It also solves another problem I (and many other users according to google) have: once I set the *scratch* buffer mode to, say, *text-mode* with some text in there, I don't have an elisp *scratch* buffer left anymore. I'd need another one, but how to create a second *scratch* buffer? Obviously you'll need to rename the current text-mode buffer first and then create a new empty buffer. The emacs wiki contains lots of suggestions for this kind of solution.

No more of this! Autoscratch can just "fork" the buffer, if enabled (set autoscratch-fork-after-trigger to t which is the default). Here's how it works: type a "(" into the empty autoscratch-enabled *scratch* buffer. Autoscratch renames this buffer to *emacs-lisp-scratch*, enables emacs-lisp-mode and creates a new *scratch* buffer in the background. So, if you need some *scratch* space, it'll be there for you waiting bravely for input.

Here's the default trigger list telling autoscratch how to switch modes:

'(("[(;]"         . (emacs-lisp-mode))
  ("#"            . (autoscratch-select
                     '(("perl"   . (cperl-mode))
                       ("ruby"   . (ruby-mode))
                       ("python" . (python-mode))
                       ("conf"   . (conf-unix-mode))
                       ("shell"  . (shell-script-mode)))))
  ("[-a-zA-Z0-9]" . (text-mode))
  ("/"            . (c-mode))
  ("*"            . (progn (insert " ") (org-mode)))
  ("."            . (fundamental-mode)))

Now if you configure autoscratch like this:

(require 'autoscratch-mode)
(setq initial-major-mode 'autoscratch-mode)
(setq initial-scratch-message "")
(setq inhibit-startup-screen t)

then emacs will start with an empty *scratch* buffer as always, but with autoscratch mode enabled. Type in a "(" and emacs-lisp-mode will be started, the *scratch* buffer will be renamed and a new *scratch* created in the background. Or, type in a "#" and you'll be asked what to switch (the autoscratch-select function does this). You can configure almost anything here.

Oh, and just in case you need to manually create a new scratch buffer, just execute "M-x autoscratch-buffer".

Update 17.07.2017 21:53:
You can complete this scratch buffer setup with the great persistent-scratch.el mode. Here's my config for it:

(require 'persistent-scratch)
(setq persistent-scratch-save-file
    (expand-file-name "scratches.el" user-init-dir))
(persistent-scratch-setup-default)

(defun tvd-autoscratch-p ()
  "Return non-nil if the current buffer is a scratch buffer"
  (string-match "scratch*" (buffer-name)))

(setq persistent-scratch-scratch-buffer-p-function 'tvd-autoscratch-p)

With this setup, scratch buffers will be saved on exit and restored on startup, so you never loose any cool snippet or note you have in a scratch buffer.

Update 02.08.2018 05:51:
There was an issue with autoscratch in combination with magit, the original scratch buffer has the same problem as well. The buffer did not alter the default-directory variable. It is buffer-local and inherits the contents of the same global variable, if set to something. So, if you have some file open in a buffer and start a new autoscratch buffer from there, default-directory of this buffer will then be set to the directory of the file visited in the buffer which was last active. Now, if you close all files, except the scratch buffer, and start magit-status AND if the directory is inside of a git repo, then magit will open this repo instead of asking you which repo to open. This is not the behavior I expect from a scratch buffer, so I modified autoscratch-mode to reset the default-directory (if enabled) to $HOME.

]]>
scip hidden 2017-07-13T19:24:00Z 2017-07-13T19:24:00Z /blog/2017/07/13/449/csh-sensible-defaults/ csh sensible defaults On FreeBSD (and possibly others) the csh is the default login shell for root or default users. I always try to avoid it and use bash. However, sometimes it's not possible or dangerous to install bash (inside a jail for example).

So I decided to check if it is possible to configure csh in a way to make it less annoying. I read the docs, tried many different options and here is the result.

That's not much but helps digging around a system using csh. With this config you'll get:

  • completion similar to bash
  • right/lift jumping by words using CTRL-left and CTRL-right
  • CTRL-up goto beginning of line, CTRL-down goto end of line
  • history search using CTRL-R
  • some sensible aliases
  • a meaningful prompt
# sensible defaults for CSH 
alias  h     history 25
alias  j     jobs -l
alias  la    ls -a
alias  lf    ls -FA
alias  ll    ls -lA
alias  l     ls -laF
alias  lt    ls -ltr
alias  md    mkdir -p
alias  ..    cd ..
alias  ...   cd ../..
alias  ....  cd ../../../
alias  vi    nvi
alias  vim   nvi

# A righteous umask
umask 22 # environment config
set path = (/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi setenv PAGER more setenv BLOCKSIZE K # if interactive, configure further
if ($?prompt) then # interactive prompt
 
set prompt = "%N@%m:%~ %# " set promptchars = "%#" # history config
 
set history = 5000 set savehist = 5000 # complete case-insensitive
set complete = enhanced # print possible completions if more than 1 match
 
set autolist = ambiguous # enable filename completion
 
set filec # shut up
 
set nobeep # enable redirect protections
 
set noclobber # forbid rm *
 
set rmstar # mail?
 
set mail = (/var/mail/$USER) # convenience bindkeys, similar to emacs or inputrc
 
# ALT-LEFT
 
bindkey "^[^[[D" backward-word # ALT-RIGHT
 
bindkey "^[^[[C" forward-word # ALT-UP + HOME
 
bindkey "^[^[[A" beginning-of-line # ALT-DOWN + POS1
 
bindkey "^[^[[B" end-of-line # CTRL-R (like bash), then type
 
bindkey "^R" i-search-back # SHIFT-TAB cycles through possible completions, let go if good
 
bindkey "^[[Z" complete-word-fwd endif
]]>
scip hidden 2017-06-08T11:19:00Z 2017-06-08T11:19:00Z /blog/2017/06/08/448/render-current-html-buffer-eww/ Render current HTML buffer with EWW From time to time I end up with raw HTML content in an emacs buffer and want to know how it looks or just want to read it properly. Until now either I opened firefox to read that file or I opened it with eww-open-file. The problem is, that sometimes there is no file, the HTML buffer is just the output of some generator or something. In such cases I needed to save the buffer as a file and then re-open it with EWW. Very annoying.

With this simple function the nightmare is over. I just use the EWW internal render function to do the job. That way I can view any HTML in emacs without even saving it to disk.

(require 'eww)

(defun eww-render-current-buffer ()
  "Render HTML in the current buffer with EWW"
  (interactive)
  (beginning-of-buffer)
  (eww-display-html 'utf8 (buffer-name)))

(global-set-key (kbd "<C-c C-e C-w C-w>") 'eww-render-current-buffer)

Now when I'm inside a HTML buffer, I can just render it and take a look with EWW. Very handy!

]]>
scip hidden 2017-05-14T20:12:00Z 2017-05-14T20:12:00Z /blog/2017/05/14/447/finlay/ Finlay Finlay is seit Dezember 2016 bei uns. Er kommt aus einer Tötungsstation im Ausland. Wir trainieren viel, Schmusen viel und sind happy mit ihm. Hier ein paar erste Bilder:

Bild: Ein Küschen für die (grosse!) Dame
Ein Küschen für die (grosse!) Dame (June 12, 2017, 9:42 a.m.)
[Tags: finlay] [Album: ]
Bild: So gut muss man es haben
So gut muss man es haben (June 12, 2017, 9:42 a.m.)
[Tags: finlay] [Album: ]
Bild: Training, Training, Training
Training, Training, Training (May 14, 2017, 8:14 p.m.)
[Tags: finlay] [Album: shots ]
Bild: Cheeees!
Cheeees! (May 14, 2017, 8:14 p.m.)
[Tags: finlay] [Album: shots ]
Bild: Hübscher Bub oder?
Hübscher Bub oder? (May 14, 2017, 8:14 p.m.)
[Tags: finlay] [Album: shots ]
Bild: Geschmückt, aber Müüüüüde
Geschmückt, aber Müüüüüde (May 14, 2017, 8:13 p.m.)
[Tags: finlay] [Album: shots ]
]]>
scip hidden 2017-05-13T21:27:00Z 2017-05-13T21:27:00Z /blog/2017/05/13/446/cheap-rsa-paper-token-holder/ Cheap RSA Paper Token Holder Materail needed: Paper (I suggest  photo paper which is thicker), scissors. Build instructions: trim the paper and fold it appropreately. Done. Now you can plase the token on your desk an read the numbers without taking your hands off the keyboard. Relief!

Bild: The token holder
The token holder (May 13, 2017, 9:31 p.m.)
[Tags: bugfix] [Album: shots ]
]]>
scip hidden 2017-03-23T19:23:00Z 2017-03-23T19:23:00Z /blog/2017/03/23/445/mark-copy-yank-things-mode/ Emacs: Mark, Copy and Yank Things - Updated 28.03.2017 10:49 In a previous post I described how I copy various things at point in emacs to make my daily live easier. Meanwhile the code grew larger and larger and in the end went too large to maintain it in my emacs config.

So, I descided to put it into its own module: mark-copy-yank-things-mode. As always you can find the mode on github.

There are a couple of new features now: I created a copy-comment-block function which is able to copy comment blocks even if they are on the right side of some code. Here's a demo gif:

Also, there is now support for email addresses, ip addresses and urls. The mode provides prefix keys mappings, so, it's very easy to change the key mapping for the various functions just by modifying the prefix key.

Here's a lis of the current default key bindings provided by the mode:

COPY commands (keymap: mcyt-copy-map):

C-c c w      mcyt-copy-word 
C-c c q      mcyt-copy-quote 
C-c c k      mcyt-copy-parens 
C-c c l      mcyt-copy-line 
C-c c p      mcyt-copy-paragraph 
C-c c f      mcyt-copy-defun 
C-c c u      mcyt-copy-url 
C-c c e      mcyt-copy-email 
C-c c c      mcyt-copy-comment-block 
C-c c a      mcyt-copy-buffer 
C-c c i      mcyt-copy-ip 
C-c c s      mcyt-copy-sexp

COPY & YANK commands (keymap: mcyt-yank-map):

C-c c y y    mcyt-copy-and-yank-line
C-c c y l    mcyt-copy-and-yank-line
C-c c y p    mcyt-copy-and-yank-paragraph
C-c c y f    mcyt-copy-and-yank-defun
C-c c y a    mcyt-copy-and-yank-buffer
C-c c y w    mcyt-copy-and-yank-word
C-c c y i    mcyt-copy-and-yank-ip
C-c c y c    mcyt-copy-and-yank-comment

MARK commands (keymap: mcyt-mark-map):

C-c c a a    mcyt-mark-buffer 
C-c c a w    mcyt-mark-word 
C-c c a f    mcyt-mark-defun 
C-c c a p    mcyt-mark-paragraph 
C-c c a l    mcyt-mark-line 
C-c c a u    mcyt-mark-url 
C-c c a e    mcyt-mark-email 
C-c c a s    mcyt-mark-sexp 
C-c c a c    mcyt-mark-comment-block 
C-c c a i    mcyt-mark-ip 

Update 28.03.2017 10:49:
From time to time I stumble upon a very annoying emacs behavior: I copy some text and want to insert it into multiple positions somewhere else. However, I need to delete something on those positions before yanking. Now, this deleted stuff will be added to the kill-ring and appears first, when I execute yank the next time. So, I need to cycle through the kill-ring with M-y to reach the text I really want to yank. And everytime this text moves further away. So, this is what I type in those situations:

C-<backspace>
C-y
[..]
C-<backspace>
C-y
M-y
[..]
C-<backspace>
C-y
M-y
M-y
[..]
C-<backspace>
C-y
M-y
M-y
M-y
[..]
C-<backspace>
C-y
M-y
M-y
M-y
M-y
[..]

You see, this is very annoying. Here's how I fixed this: I just added a defadvice to my copying code of the above module, which puts the copied text into a emacs text register. And I created a new key binding to access this text register: C-v. I do not use this in emacs for cursor movement (its original binding) anyway and its the default PASTE key binding on some OS'es and applications - so I'm already somewhat used to it. Now I can always yank the last copied text and it doesn't matter how many items I added to the kill-ring since copying.

Here's the code:

(advice-add
  'mcyt--copy-thing :after
     '(lambda (&rest args)
        (with-temp-buffer
          (yank)
          (copy-to-register 'c (point-min) (point-max)))))

(defun my-insert-c-register ()
  (interactive)
  (insert-register 'c))

(global-set-key (kbd "C-v") 'my-insert-c-register)

]]>
scip hidden 2017-03-13T19:32:00Z 2017-03-13T19:32:00Z /blog/2017/03/13/444/portable-emacs-eshell-aliases/ Portable Emacs Eshell Aliases I maintain one emacs config file (.emacs) for all environments and systems whereever I use emacs. From time to time I use eShell but aliases were differing from system to system. The reason was, that they were stored in a separate file (~/.emacs.d/eshell/aliases) which I do not re-distribute.

So, my solution was to maintain eshell aliases inside my .emacs file. Here are my current alias definitions:

;; actual aliases
(+alias 'l      '(ls -laF))
(+alias 'll     '(ls -l))
(+alias 'la     '(ls -a))
(+alias 'lt     '(ls -ltr $*))
(+alias '..     '(cd ..))
(+alias '...    '(cd ../..))
(+alias '....   '(cd ../../..))
(+alias '.....  '(cd ../../../..))
(+alias 'md     '(mkdir -p))
(+alias 'emacs  '(find-file $1))
(+alias 'less   '(find-file-read-only $1))

As you can see, I use a pretty handy function +alias to create them and I use symbols, not strings which looks cleaner. For this to work, I use the following function:

(setq eshell-command-aliases-list ())

(defun +alias (al cmd)
  "handy wrapper function to convert alias symbols to alias
strings to avoid writing 4 quotes per alias. AL is a single-word
symbol naming the alias, CMD is a list symbol describing the
command."
(add-to-list 'eshell-command-aliases-list (list (symbol-name al) (mapconcat 'symbol-name cmd " "))))

So, first the aliases list will be cleared, just in case there's some aliases file left in the filesystem (which I ignore from now on). The function +alias then converts the given symbols to strings and adds them to the alias list.

I could of course use strings directly but that's too much quotes to type and looks confusing. Just for completeness, here's how the aliases list looks like after the above conversion:

(("less" "find-file-read-only-other-window $1")
 ("emacs" "find-file-other-window $1")
 ("md" "mkdir -p")
 ("....." "cd ../../../..")
 ("...." "cd ../../..")
 ("..." "cd ../..")
 (".." "cd ..")
 ("lt" "ls -ltr $*")
 ("la" "ls -a")
 ("ll" "ls -l")
 ("l" "ls -laF"))
]]>