tomoyo – tomoyo-loadconfig doesn’t load

You want to load a exception/domain file into tomoyo but you can’t because of some strange errors (exit with 1)?
And you are sure that tomoyo is loaded (has to be in the kernel bootline) and you ran tomoyo-initpolicy as root?

Here is the solution:
You may have not the permission to write into the /sys/…/tomoyo dir. You have to authorize some programs to do so.
Now check /etc/tomoyo/manager.conf. You see multiple paths. Now check if they are all real or went over links.
You can do this with realpath:

realpath <path>
e.g.
realpath /usr/sbin/tomoyo-editpolicy

if the output is not the same as the input, then replace the path in the file with the output.Now reboot the PC (is needed to load the manager.conf) and now it should work

blender multiple smoke domains

sometimes you need more than one object to produce smoke but hups? what’s that? Just one object produces smoke.

The solution and the reason for this problem are simple:both objects are in the same flow group

What’s flow group?
You can create for an object a group via:
pressing on the cube in the right side bar (where can preferences of objects)
then scroll down to groups and press on the + sign to create a new one

And now you have a group. To asign a smoke domain to a group go to the smoke menu and click into the field flow group, then assign the group with the right smoke producing object.

tomoyo howto

First forget the curse tools tomoyo gives to you. They are good but very limited

The begin:
install tomoyo,( configure the kernel for tomoyo if your distribution hasn’t done it, here a guide:
http://tomoyo.sourceforge.jp/2.5/chapter-3.html.en)
run sudo /usr/lib/tomoyo/init-policy to init the config
and append security=tomoyo to the kernel boot line in grub.cfg (better: /etc/default/grub and update bootloader) or whatever
and reboot

Create a rule for a program:
Important rule: name important resources with an speaking name, you can also insert comments with #
Now append:

1. initialize_domain yourprogram from any
2.

use_profile x
use_group 0
to /etc/tomoyo/domain_policy.conf
where x is the number of the ruleset.
an overview gives: http://tomoyo.sourceforge.jp/2.5/chapter-4.html.en
and load it with:
tomoyo-loadpolicy -df </etc/tomoyo/domain_policy.conf

basicly there are now two ways to develope now a ruleset
1. switch to policy 1, run the program, close it, save down the changes
2. use policy 2/3, run tomoyo-auditd and look in /var/log/tomoyo/rejected00 2 or 3.log what permissions the program needs to run.
for using wildmarks have a look in
http://tomoyo.sourceforge.jp/2.5/policy-specification/expression-rules.html.en
add the new rules to domain policy and reload the config via:
tomoyo-loadpolicy -df </etc/tomoyo/domain_policy.conf

some links which will explain some aspects more detailed:

http://stolowski.blogspot.de/2010/12/tomoyo-linux-5-tips-to-streamline-your.html

here you have a sample file:

https://wiki.archlinux.org/index.php/Skype

blender – useful navigation view

With the normal navigation view you will have soon many problems. For example you cannot/can bad zoom into buildings, other objects.
So press shift-f to get an kick-ass view (navigation should be obvious but I explain it in detail: zoom – mouse wheel, left, right,up, down: mouse). Then press the left mouse button and switch back to the normal zoom mode in the new position or ESC to jump back to where you began to use the view.

webcam flickers under linux -powerline frequency false

problem was: my logitech c270 webcam had stripes wandering around, I think you could call it flicker. I tried everything but nothing helped. Just changing the resolution helped a bit.
now the real solution and the real problem: adjust via v4l2-ctl -c powerline_frequency the powerline frequency. The flickering immediately stopped for me. To see which values it can have use v4l2-ctl -L
for me worked:
v4l2-ctl -c powerline_frequency=1
It was simply the power supply!!! It has an other frequency in Germany than in the home country of logitech. The technicians saw this problem coming so include such an option but… they were too silent (should have dropped an entry in the FAQ explaining that).

Ok, I use linux and the tool of logitech would surely have adjusted this but I’m windows free.

networkmanager: /etc/Networkmanager/system-connections: connections doesn’t show up

If you play a bit with the configuration under /etc and you accidentally change the permissions of /etc/Networkmanager you can end up with no connection to the internet.

The problem is not too less permissions but too much:
- root with group root must own /etc/Networkmanager/system-connections and have the octal permissions 755
- and root with group root must own the files beyond this directory. But the octal permissions of the files have to be set on 700

how to close small wounds

If you cannibalize old devices for example you will sometimes cut yourself. Of course you don’t want to have a longer break so here is a guide how to close a small wound quickly.

If it’s just a little wound (at best a cut) you can wash the wound (nothing should be in the wound) and your other hand and then press your finger on the wound so the edges of the wound are pressed together. You mustn’t press softly but also you needn’t press ultra-hard.
After some minutes (1-3) you will feel the hurt ceasing but press a bit longer.
Afterwards remove your finger and voila, it doesn’t bleed anymore (but don’t strain it).
This technique is also useful for stopping the bleeding after removing cannulas (with injections I’m not sure if there are sideeffects).

Disclaimer: I’m not a physician. I’m just a tinkerer who learned it from one.

bash: coproc

sometimes you need to run a function or whatever in background. One possibility is to use bg but this isn’t very elegant and you have often problems.A better way is to use coproc. Syntax:

coproc [optional NAME] command [optional redirects]

The killing feature  is the name. Finally no %1 and so on. The command is bit strange to code: you enclose the command with curly brackets and end the command with ; (important!).
Here a coding example:

coproc mycoproc { for (( i=0; $i<4; i++ ));do sleep 3; echo $i; done; } #running command
echo "I'm not blocked"
cat <&${mycoproc} #get the results

If you don’t want the “[1]+ finished” you can use head or sed to cut it out.

http://wiki.bash-hackers.org/syntax/keywords/coproc

how to create a bookmarklet (aka smart bookmark)

1. What is a bookmarklet?
A bookmarklet is basically a script which is executed by open a  special link. It can appear as bookmark or as an address in a link (href=”bookmarklet”) but not not as an address in the URLbar (prohibited by default). The script programming language is in most cases javascript (don’t know if there are other ones).

2. How to use a bookmarklet?
The only problem to use a smart bookmark is the raw access to the address bar of a link. Many browsers have lots of fancy interfaces but just one hidden interface for entering the address directly.
In firefox it is the right click on the bookmark bar or an Odyssey through the bookmark menu

3. How can I program a bookmarklet?
Before I come to an example in javascript some important points for programming a bookmarklet:

  1. you have access to the current page (or if somebody drops a page on the bookmarklet to this page)
  2. javascript knows lambda functions (function (){………})
  3. but sadly not sleep (use setTimeout instead)
  4. you can define functions (with names) in other functions (including lambda functions)
  5. you can use just one single line delimited by ;
    But programming isn’t easy this way. Write normal javascript code and use a converter (or convert by hand).
    For example my converter (; aren’t set on line breaks;this means you need to set them manually):

    https://github.com/devkral/librarything_link/blob/master/convert_to_bookmarklet.sh

  6. ‘javascript:’ can have a strange construct:  javascript:(function(){……})()
  7. You can test your scripts before converting or squashing on one line in mozilla scratchpad (firefox->scratchpad (DE: Notizblock)

ok, now a little example:

javascript:alert("Hello World")

now a bit more complicate script which doesn’t change the address bar

javascript:(function(){alert("Hello%20World")})()

and in the end a timeout driven function

javascript:(function(){
function d(){
alert("Hello%20World")};
window.setTimeout("d()",1000);
}
)()

squashed to one line:

javascript:(function(){function d(){alert("Hello%20World")};window.setTimeout("d()",1000);})()