/home/drscream

  • home
  • blog
  • gallery
  • studies
  • about
  • grsec pax update-grub, terminating task grub-probe

    I’ve installed a debian machine with the grsec kernel from kernelsec.cr0.org. Everything looks good and working fine, after some time i’ve found out that update-grub doesn’t work anymore.

    [root@grapefruit]:~ # update-grub
    Searching for GRUB installation directory ... found: /boot/grub
    

    So looking in the dmesg output we will see the problem is grub-probe:

    Nov  7 23:07:57 grapefruit kernel: [96585.754724] PAX: From 127.0.0.6: execution attempt in: , ...
    Nov  7 23:07:57 grapefruit kernel: [96585.761809] PAX: terminating task: /usr/sbin/grub-probe(grub-probe):20649, uid/euid: 0/0, ...
    Nov  7 23:07:57 grapefruit kernel: [96585.769773] PAX: bytes at PC: 41 ...
    Nov  7 23:07:57 grapefruit kernel: [96585.776171] PAX: bytes at SP-8: 0000000000000006 ...
    

    Now it’s time to checking the pax flags of grub-probe, here we will see the default options:

    [root@grapefruit]:~ # chpax -v /usr/sbin/grub-probe
    ---[ chpax 0.7 : Current flags for /usr/sbin/grub-probe (PeMRxS) ]---
     * Paging based PAGE_EXEC       : enabled (overridden)
     * Trampolines                  : not emulated
     * mprotect()                   : restricted
     * mmap() base                  : randomized
     * ET_EXEC base                 : not randomized
     * Segmentation based PAGE_EXEC : enabled
    

    We should disable paging and segmentation based PAGE_EXEC:

    [root@grapefruit]:~ # chpax -ps /usr/sbin/grub-probe
    

    And, tadaaaaa, update-grub working:

    [root@grapefruit]:~ # update-grub
    Searching for GRUB installation directory ... found: /boot/grub
    Searching for default file ... found: /boot/grub/default
    Testing for an existing GRUB menu.lst file ...
       found: /boot/grub/menu.lst
    Searching for splash image ... none found, skipping ...
    Found kernel: /boot/vmlinuz-2.6.32.15-1-grsec
    Updating /boot/grub/menu.lst ... done
    

    Posted

    November 8, 2010

    Tags

    debian, grsec, grub, grub-probe, linux, pax, update-grub

  • airport – command line tool

    Als Linux User ist man es irgendwie gewohnt ein command line tool zur Verwaltung von bestimmten Anwendungen zu verwenden. Doch naja unter Mac OS X vermisst man das einfach. Durch etwas Googlen hab ich es dann gefunden *juhu*:

    cd /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/
    ./airport -I
    


         agrCtlRSSI: -51
         agrExtRSSI: 0
        agrCtlNoise: -96
        agrExtNoise: 0
              state: running
            op mode: station
         lastTxRate: 54
            maxRate: 54
    lastAssocStatus: 0
        802.11 auth: open
          link auth: wpa2-psk
              BSSID: 0:18:84:17:28:3a
               SSID: cienfuegos
                MCS: -1
            channel: 2
    

    Da man das ganze sicher einfach nur ueber den Befehl airport verwenden moechte, linked man das ganze einfach nach /usr/sbin:

    sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
    

    Posted

    December 24, 2008

    Tags

    cmd, linux, macosx, tool

  • bash variable set default value

    Yeaaa :-) Yesterday i’ve found a nice way to set an default value for bash variables.
    I use this way if parameter 1 isn’t assigned by the user. Here a small example:

    ip=${1-'10.1.1.1'}

    If $1 isn’t assigned by the user the default 10.1.1.1 is set as value of $ip.

    Posted

    March 29, 2008

    Tags

    bash, linux

  • Mutt move mails by pattern

    In mutt it isn’t so easy to move mails by pattern because the best solution is to move mails not in the mail client but with procmail or mailfilter. Here is a solution that works also in mutt:

    Tag all mails by specific pattern:
    Limit the mails that are displayed.

    L


    Tag messages matching a pattern.

    T


    Move all taged mails to destination:

    s =INBOX.dest.here

    Posted

    March 25, 2008

    Tags

    linux, mutt

  • Find easy empty directorys with ‘find’

    With find you can everything but you must know it :)

    find . -type d -empty

    [drscream@havanna] ~/Pictures/upload
     % find . -type d -empty
    ./Artwork/html/thumb
    ./Artwork/Photography/html/thumb
    ./html/thumb
    

    Posted

    March 2, 2008

    Tags

    bash, linux

  • How to find out your Tcl version

    It’s so easy, i’ve only searched a day long for that easy result:-P

    [drscream@havanna] ~
     % tclsh
    % puts $tcl_version
    8.4
    

    Posted

    March 1, 2008

    Tags

    bash, linux, macosx, tcl

  • Router, check the internet connection

    Currently i’ve some problems with my router. The reconnect only work sometimes… . So i’ve started to write a small bash script, to check that connection. The script run every hour and start a reconnection if no pppoe connection is available.

    
    #!/bin/bash
    #--------------------------------------------------------------------
    # $Id: checkIConnect,v 0.1 2008/02/11 17:17:26 drscream Exp $
    # Copyright 2008 Frubar Network (drscream@frubar.net)
    #--------------------------------------------------------------------
    
    ##
    ## main
    ##
    errors=0
    ns_ip=$(cat /etc/resolv.conf | sed 's/nameserver //g' | head -n 1)
    
    ## device check
    $(/sbin/ip a s dev ppp0 > /dev/null 2>&1)
    if [ $? -gt 0 ]; then
            echo "ERROR: Device not found!"
            let errors=$errors+1
    fi
    
    ## nameserver, ping check
    $(ping -c 4 $ns_ip > /dev/null 2>&1)
    if [ $? -gt 0 ]; then
            echo "ERROR: Ping doesn't work!"
            let errors=$errors+1
    fi
    
    echo "Code: $errors"
    
    if [ $errors -gt 0 ]; then
            echo "INFO: reconnect internet"
            /opt/fruky/bin/pppoe-restart
    fi
    

    Posted

    February 11, 2008

    Tags

    bash, linux

  • Bash, get the last day of the month

    Easy way to get the last day is to look if the next day is the first of the month. Now here are a small bash script thats show you the functionality:

    if [ $(date -d tomorrow +%d) -eq 1 ]; then
        echo "OK: last day of the month"
    else
        echo "NOK: not the last day of the month"
    fi
    

    Posted

    January 27, 2008

    Tags

    bash, linux

  • Argument list too long

    Wer kennt es nicht, gerade wenn man viele Datein loeschen moechte:

    Argument list too long.

    Ein einfacher “workaround” ist das verwenden von xargs:

    ls | xargs rm

    ( Vielen Dank an adminlife.net )

    Posted

    January 25, 2008

    Tags

    bash, linux

  • The UNIX Wizard …

    just found by Flickr:

    unix wizard

    The picture is under the creative commons license and the full sized picture can be downloaded here.

    Posted

    January 24, 2008

    Tags

    drawing, linux

« Previous Entries