Debian Wheezy, Atom N2800 and graphic

I recently upgraded some debian installations to the currently newest Version (wheezy).
While most of the upgrades went very smooth, I ran into some trubles updating a system running on a Intel Atom Board.
As I reboted the mentiond system to boot the new kernel the VGA signal droped.

In the end it seems to be a bug in the 'gma500_gfx' module witch caused the Graphic-Blackout.
After blacklisting the mentiond modul, it worked again as it should.

Posted in Technik | Tagged , , , , , | Leave a comment

`cat` as a shell builtin

Recently i blogged about how to get a process list if you aren’t able to fork any processes . Also a process list is allways handy, i allways find cat a very usefull tool too. But as you might have noticed cat is not a shell builtin. So everytime cat is called a new process needs to be forked. In case you can’t fork processes it’s a problem, and even if you can fork them you may save resources by “creating” a shell builtin cat.
So lets do this,
open your .profile for usage with your user only or /etc/profile for global usage (You may also use your .bashrc or .zshrc instead).
Append the following lines to the file:

#pseudo bash builtin cat function
function cat { echo “$(< $1)" }

Siehe Kommentar :)

function cat {
  if [ $# -eq 1 -a "${1:0:1}" != "-" ]
  then
    exec 3< "${1:-/dev/stdin}"
    while read -r -u3 line
    do
      echo -E ''"${line}";
    done
    echo -nE ''"${line}";
    exec 3<&-
    else
     /bin/cat "$@"
fi
}

Voila, if you start a new loginshell the cat should refer to a shell function and not to a binary.
(to test this simply type type cat result should be something like cat is a shell function )

Posted in Allgemein, Technik | Tagged , , | 2 Comments

Shortcut to lock the screen on a mac

Sometimes i don’t want to put my macbook air asleep because of some job that is running. But i have to leave the room so i need to lock it.
So there is a shortcut for locking the screen:

Shift+Crtl+Eject

This works on the most macs, but the macbook air has no Eject button on the Keyboard. So on systems without an Eject button you have to use:

Shift+Crtl+Power

Posted in Allgemein, Technik | Tagged , , , | 1 Comment

How to get a process list if you can’t fork any processes?

Recently I got the question what to do if one got a bash session but can’t fork processes on a Linux system.
So here is an attempt to get a processlist just by using bash buildins:

OLDPWD=$PWD
cd /proc
for x in [0-9]*
do
read cmd < /proc/${x}/comm
read cmdl < /proc/${x}/cmdline
printf "%8s - %15s - %s" $x $cmd $cmdl
echo
done
cd $OLDPWD
Posted in Pastes, Technik | Tagged , , , | Leave a comment

some usefull commands to transfer files via tar & netcat

I recently needed to transfer some folders from one machine to an other via lan.
I could have used scp or rsync, but the cryptographic layer seems a kind of overhead to me, additonal the two pc’s weren’t the fastest. So netcat came into my mind, and I just wanted to share the commands i used (and keep them for a later use).
So here they are:

Linux version:
Recieve:
netcat -l -p 1234 | pv | tar x
Send:
tar cf - * | pv | netcat [ip] 1234
BSD version:
Recieve:
nc -l 1234 | tar -xpf -
Send:
tar -cf - * | nc [ip] 1234

Posted in Allgemein, out of my life, Technik | 2 Comments
Seite 1 von 5112345...letzte »