R&D Publishing‎ > ‎

Pi Command Hint

lokir's linux notes

just my notes

    Raspberry pi monitoring with Munin

    Posted: 02/20/2015 Author:  | Filed under: Other | Leave a comment

    Original post:  http://www.aymerick.com/2013/12/25/munin_client_on_raspberrypi.html

    Add this line:

    [pisense_*]
    user root

    to

    /etc/munin/plugin-conf.d/munin-node
    cd /usr/share/munin/plugins
    
    sudo wget -O pisense_ https://raw.github.com/perception101/pisense/master/pisense_
    sudo chmod a+x pisense_
    sudo ln -s /usr/share/munin/plugins/pisense_ /etc/munin/plugins/pisense_temp
    sudo ln -s /usr/share/munin/plugins/pisense_ /etc/munin/plugins/pisense_clock

    Example output:
    pisense_temp-day


    Denyhosts – bash script

    Posted: 04/28/2014 Author:  | Filed under: linux | Leave a comment


    #!/bin/bash
    # Author(s): Chris Trombley

    LIST=""
    LIST=$(cat /var/log/auth.log | grep "authentication failure" | awk '{print$14}' | grep -v tty=ssh |sed -e 's/rhost=//g' -e 's/ /_/g' | uniq)
    excludeList=( "10.10.6.1" "10.10.9.207" "static-xxx-xxx-xxx-xxx.isp.domain.net" )

    function chkExcludeList()
    {
    for j in "${excludeList[@]}"; do
    if [[ "$1" == $j ]]; then
    return 10
    fi
    done
    return 11
    }

    for i in $LIST; do
    chkExcludeList "$i"
    if [ $? != "10" ]; then
    if [ "$(grep $i /etc/hosts.deny)" = "" ]; then
    echo "ALL: $i : DENY" >> /etc/hosts.deny
    fi
    fi
    done


    How to delete files older than …

    Posted: 03/22/2013 Author:  | Filed under: linux Tags:  | Leave a comment

    find PATH TO FILES GOES HERE* -mtime +5 -exec COMMAND GOES HERE {} \;


    How to update munin-node plugins.

    Posted: 02/10/2013 Author:  | Filed under: Munin Tags:  | Leave a comment

    After installation of new service on server is nice to update Munin plug-ins.


    munin-node-configure
    /usr/sbin/munin-node-configure --suggest
    /usr/sbin/munin-node-configure --shell | sh
    /etc/init.d/munin-node restart

    Plug-in list is up-to-date.


    OpenElec Raspberry PI – tweaks

    Posted: 01/12/2013 Author:  | Filed under: raspberry pi | Leave a comment

    Increase video buffering:

    Create a file advancedsettings.xml here /Storage/.xbmc/userdata

    <advancedsettings>
      <network>
        <cachemembuffersize>30242880</cachemembuffersize>
      </network>
      <fanartheight>560</fanartheight>
      <thumbsize>256</thumbsize>
      <gui>
        <algorithmdirtyregions>3</algorithmdirtyregions>
        <nofliptimeout>0</nofliptimeout>
      </gui>
      <bginfoloadermaxthreads>2</bginfoloadermaxthreads>
    </advancedsettings>

    more settings here: http://mrpfister.com/journal/setting-up-openelec-on-the-raspberry-pi/#comment-31801

    Overclocking:
    (Be careful those setting will void your warranty)

    /system/config.txt

    arm_freq=850
    core_freq=250
    sdram_freq=400
    force_turbo=1
    initial_turbo=30
    disable_overscan=1
    hdmi_force_hotplug=1


    Raspberry PI CPU Temperature and current speed – bash script

    Posted: 01/05/2013 Author:  | Filed under: raspberry pi | 7 Comments

    echo Raspberry Pi SysInfo.
    echo ---------------------
    MHZ=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
    TEMPE=$(cat /sys/class/thermal/thermal_zone0/temp)

    echo Hardware:
    echo CPU Speed $(($MHZ/1000)) Mhz "|" CPU Temp $(($TEMPE/1000)) C

    output:


    Raspberry Pi SysInfo.
    ---------------------
    Hardware:
    CPU Speed 850 Mhz | CPU Temp 28 C


    gconftool-2 --set "/apps/metacity/general/button_layout" --type string ":minimize,maximize,close"

    Raspberry PI 512 MB RAM – memory split

    Posted: 10/20/2012 Author:  | Filed under: Other Tags:  | 2 Comments

    New Raspberry PI 512 MB of RAM possible memory splits:


    arm128_start.elf
    arm192_start.elf
    arm224_start.elf
    arm240_start.elf
    arm256_start.elf
    arm384_start.elf
    arm448_start.elf
    arm496_start.elf


    Raspberry Pi Debian – How to change swap size

    Posted: 10/13/2012 Author:  | Filed under: Other Tags:  | Leave a comment

    sudo nano /etc/dphys-swapfile
    sudo dphys-swapfile setup
    sudo dphys-swapfile swapon


    Linux – how to check which process is using most memory

    Posted: 10/04/2012 Author:  | Filed under: Other Tags:  | Leave a comment

    ps -elf|awk '{print $10, $3, $4, $15, $16}'|sort -nr|head


    Raspberry PI kiosk mode with Chromium.

    Posted: 09/16/2012 Author:  | Filed under: Otherraspberry pi Tags:  | 48 Comments

    1. Install chromium, x11-xserver-utils and unclutter

    sudo apt-get update && apt-get upgrade -y
    sudo apt-get install chromium x11-xserver-utils unclutter

    2. We need to prevent screen from going blank and disable screen saver.
    – edit /etc/xdg/lxsession/LXDE/autostart and comment # screen saver line and add those lines:

    @xset s off
    @xset -dpms
    @xset s noblank
    @chromium --kiosk --incognito http://some.web.

    Done.


    Slow Wifi, Problem Solved- Ubuntu 10.04, 10.10

    Posted: 11/08/2010 Author:  | Filed under: ubuntu Tags:  | Leave a comment

    1. The Debian Avahi (nss-mdns) Bug
    There is a known bug doing the rounds in Debian based distros, this includes Ubuntu.
    The problem is in the nsswitch.conf file where wins mdns causes a slowdown of DNS resolution on some machines.
    https://bugs.launchpad.net/ubuntu/+s…ahi/+bug/94940
    A simple workaround for this problem is to remove mdns4_minimal entry from the nsswitch.conf file, or change mdns4_minimal to just mdns4 (whichever works best for you):
    Edit this file- /etc/nsswitch.conf
    Scroll down to the entry which says:
    hosts: files dns wins mdns4_minimal
    and delete the mdns4_minimal entry. (I removed wins as well), s it looks like this:
    hosts: files dns
    2. Check your DNS in resolv.conf
    You should only have two entries (usually) which are your Internet Service Provider’s DNS servers.
    Check and/or edit your dns servers:
    gksudo scite /etc/resolv.conf
    It should look something like this:
    search my.isp.com
    nameserver 4.4.2.2
    nameserver 4.4.2.4
    You may have an extra IP address there, possibly your router (192.168.1.1), and if you haven’t got dns servers configured in your router config, this may cause a problem/slowdown as well. EG:
    search my.isp.com
    nameserver 192.168.1.1
    nameserver 4.4.2.2
    nameserver 4.4.2.4
    Just remove the first one and leave the two ISP DNS server IP’s.

    original link http://ubuntuforums.org/showthread.php?t=1487039&page=2


    How change WiFi Rates – Linux

    Posted: 11/05/2010 Author:  | Filed under: ubuntu | Leave a comment

    sudo iwconfig wlan0 rate 54M

    Available rates: 1, 2, 6, 9, 12, 18, 24, 36, 48 and 54


    Useful configuration tools

    Posted: 06/19/2010 Author:  | Filed under: ubuntu | Leave a comment

    gconf-editor – gnome configuration tool
    rcconf – system services configuration tool


    Mounting NTFS partition /etc/fstab

    Posted: 05/11/2010 Author:  | Filed under: ubuntu | Leave a comment

    1. Open a Terminal and type

    gksudo gedit /etc/fstab

    2. Add this line

    /dev/sdaX /media/sdaX ntfs-3g user,defaults 0 0

    X – depend on your partition layout. To check partition layout type:

    sudo fdisk -l


    How To Restore Nautilus Address Bar or Location Bar in Ubuntu 10.04

    Posted: 04/30/2010 Author:  | Filed under: ubuntu | 2 Comments

    1 Open terminal or press Alt+F2

    gconf-editor

    2. locate this

    /apps/nautilus/preferences/always_use_location_entry

    and tick a box.

    Source: http://ubuntuforums.org/showthread.php?t=77346


    xorg.conf – when Ubuntu is not detecting your monitor correctly

    Posted: 04/17/2010 Author:  | Filed under: ubuntu | Leave a comment

    1. touch /etc/X11/xorg.conf

    2. open file and paste this:

    Section "Monitor"
    Identifier "Monitor1"
    Vendorname "Generic LCD"
    Horizsync 31.5-48.0
    Vertrefresh 56.0-65.0
    EndSection

    Section "Screen"
    Identifier "Screen1"
    Monitor "Monitor1"
    Subsection "Display"
    Modes "1024x768" "800x600"
    EndSubsection
    EndSection

    3. save & restart xorg


    Terminal programs – tools, games, eye candy

    Posted: 03/27/2010 Author:  | Filed under: ubuntu | Leave a comment

    tools:

    htop, nload, wavemon, mtr

    games:

    tetris, greed, ninvaders

    eye candy:

    cmatrix


    iptables IP blocking

    Posted: 03/22/2010 Author:  | Filed under: ubuntu | Leave a comment

    to make a new rule:
    sudo iptables -I INPUT -s 11.11.11.11 -j DROP

    to delete a rule:
    sudo iptables -D INPUT x
    x=rule number

    to list iptables rules:
    iptables -L


    right click image resizer

    Posted: 03/19/2010 Author:  | Filed under: ubuntu | Leave a comment

    sudo aptitude install nautilus-image-converter

    right click on a picture
    – resize
    – rotate


    What is swappiness and how do I change it?

    Posted: 02/23/2010 Author:  | Filed under: ubuntu Tags:  | 1 Comment

    The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

    • swappiness can have a value of between 0 and 100
    • swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
    • swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache

    The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment. Note: Ubuntu server installations have different performance requirements to desktop systems, and the default value of 60 is likely more suitable.

    To check the swappiness value

    cat /proc/sys/vm/swappiness

    To change the swappiness value A temporary change (lost on reboot) with a swappiness value of 10 can be made with

    sudo sysctl vm.swappiness=10

    To make a change permanent, edit the configuration file with your favorite editor:

    gksudo gedit /etc/sysctl.conf

    Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:

    vm.swappiness=10

    Save the file and reboot.

    ——–

    original article https://help.ubuntu.com/community/SwapFaq


    Ubuntu 9.10 Vodafone Pay As You Go (UK)

    Posted: 02/23/2010 Author:  | Filed under: ubuntu Tags:  | Leave a comment

    Vodafone Pay As You Go (UK) config
    APN is pp.internet should be ppbundle.internet
    user / password: web / web


    Comments