Moe's Techblog

Mousse-au-chocolat

Endlich mal mein Rezept für Mousse-au-chocolat aufgeschrieben, nachdem ich es bisher immer Pi-mal-Daumen gemacht hab. Ist eine Mousse die nicht vegan ist, sie enthält Zucker und auch Fett. Und sie besteht nicht aus 90% Kakao Schokolade --> sie schmeckt :-)

Zutaten:

  • 3 Eier
  • 150g Zartbitterschokolade
  • 33 g Puderzucker
  • halber Becher Schlagsahne

Schokolade vorsichtig im Wasserbad schmelzen. Währenddessen die Eier trennen und das Eigelb mit dem Puderzucker gut verrühren. Das Eiweiß mit der Rührmaschine steif schlagen. Dann die Schokolade in das Eigelb-Zucker-Gemisch einrühren. Anschließend vorsichtig den Eischaum unterheben. Schließlich die Sahne ebenfalls steif schlagen und ebenfalls unterheben. Einige Stunden kaltstellen und fest werden lassen. Himbeersose passt gut.

Defect initramfs during Ubuntu startup

Trying to start a computer with Ubuntu 16.04 LTS leads to the following error message

 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

and the computer will not boot into the OS.

The problem is, that the initramfs is a defect due to update processes of the linux kernel.

By googleing you can find this error message and possible solutions quite often and I just want to summarize their and my experiences.

A good solution is to boot your computer with a Ubuntu Live from an USB stick or DVD. Just follow the instructions on the Ubuntu homepage how to create such an USB stick (or DVD). After booting in your rescue system, open a terminal and identify the harddisk with your systems is on.

sudo fdisk -l

Mount this harddisk (e.g. /dev/sda1) and the devices from your host rescue system to create a chroot environemnt.

sudo mount /dev/sdax /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt 

To create a new initramfs you have to find out which kernel you want to boot. Just have a look into /boot and identify the latest one. Just type

update-initramfs -u -k 4.4.0-66-generic

with the version number you found.

When no error occurs you can finally reinstall grub by typing the following and reboot

update-grub2

In my case I got some erros due to the big number of older kernels in the /boot directory. After deleting them manually the grub update worked fine and I could manage to restart the computer.

 

 

 

 

 

Einträge in der Legende verhindern

Mit dem Eintrag '_nologend_' kann man mit der Python Matplotlib verhindern, dass ein Plot in der Legende aufgeführt wird

 

import numpy as np 
import matplotlib.pyplot as plt 

x1,y1 = np.random.rand(2,10) 
x2,y2 = np.random.rand(2,10) 
x3,y3 = np.random.rand(2,10) 
x4,y4 = np.random.rand(2,10) 

plt.plot(x1, y1, label='Test 1') 
plt.plot(x2, y2) #Kein Label, also auch nicht drin 
plt.plot(x3, y3, label='_nolegend_') # Aktiv unterdrückt
plt.plot(x4, y4, label='Test 4') 

plt.legend()  # Legende mit Einträgen des ersten und  vierten Plots

 

 

Colored python output

For a clear representation of some (verbose) text output from python program, it is nice to have some colors to highlight some (important) results. Just by adding some ANSI coding, you can easily color your text.

 

print('\x1b[31mRed Text \x1b[0m') 
print('\x1b[32mGreen Text \x1b[0m')

Saving embedded video streams in firefox

Some time you see an embedded video stream in your firefox browser and you want to download it. There are several addons, but yozu can also manage without any additional software.

 

  1. Enlarge your firefox cache
  2. open the page with the video
  3. clear your browser cache
  4. open a new browser tab and enter
    about:cache?device=disk
  5. go back to the tab with video and reload the page
  6. refresh the tab with the cache overview and locate the largest file (which should be your video)
  7. copy the shown location to an other browser tab.
  8. by right clicking , you can save the video

Insert event frames in Photron Fastcam Videos

With a Photron Fastcam SA5 highspeed camera it is easily possible to mark events by applying a electrical TTL signal on the general input connector. This enables you to jump to certain positions in the video by pressing a single button.

On the other hand it is completely impossible to mark frames in the Photron software.

But you can just write into the CIH file. You have to give the total number of  events (maximum of 10)  and the Frame numer where the event takes place.

 In this example you will get three event markers at Frame 214, 426 and 638.

Number Of Event Marker : 3
Event Frame1 : 214
Event Frame2 : 426
Event Frame3 : 638

 

Home ← Ältere Posts