2024. április 30., kedd

Gyorskeresés

Blog

[ ÚJ BEJEGYZÉS ]   [ ÚJ CIKK ]

  • Linux programok - kedvcsináló

    Smem - selenic.com/smem
    Memory usage calculator

    Install: sudo apt-get install smem

    A memória felhasználás egyike a könnyen félreértelmezhető topicoknak.
    Kezdetekben amig nem létezett a Multi task és a dinamic link library (dll), shared library és igy tovább...
    a valós RAM felhasználás kiszámitása lényegesen egyszerűbb volt.
    A legegyszerűbben a top paranccsal kérdezhetjük le az aktuális RAM fogyasztást amit a RES (resident set size) oszlop mutat.
    RES - mennyi fizikai memória lett lefoglalva, viszont a közös library-k igy akár többször is beleszámolódhatnak a memória felhasználásba.
    Ezzel szemben az smem képes kezelni a shared program részeket és ezáltal valósabb képet ad. Ezt a módot hivják resident set size -nak, röviden RSS.
    smem - alap információk (hasonlóan,mint a top)
    smem -m - library-oriented nézet
    smem -u - user oriented nézet
    smem -t -p - teljes felhasználás százalékos eloszlásban
    smem -c "name user pss" - oszlopokba rendezve
    smem -s rss -r - Sort by reverse RSS
    smem -M libxml - Show processes filtered by mapping
    smem -m -P [e]volution - Show mappings filtered by process
    smem --pie name -s rss - Show a pie chart of RSS labeled by name

    Folytatás...

    sonar 11 éve 0

  • Howto: Backup and restore your Linux system

    1: Backing-up

    To do this, become root with
    sudo su
    and go to the root of your filesystem
    cd /
    Now, below is the full command I would use to make a backup of my system:
    tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt --exclude=/sys /
    'cvpfz' are the options we give to tar, like 'create archive' (obviously),
    'preserve permissions'(to keep the same permissions on everything the same), and 'gzip' to keep the size down.
    Next, the name the archive is going to get. backup.tgz in our example.
    Next comes the root of the directory we want to backup. Since we want to backup everything; /

    tar zcvf backup.tgz --one-file-system /
    Mounted folders wont be part of the backup. Easier than previous method.

    2: Restoring

    tar xvpfz backup.tgz -C /
    WARNING: this will overwrite every single file on your partition with the one in the archive!
    Create the excluded folders
    mkdir proc
    mkdir lost+found
    mkdir mnt
    mkdir sys
    etc...

    sonar 11 éve 1

  • tftpd.remap -- TFTP Daemon Path Remapping

    #
    # tftpd.remap -- TFTP Daemon Path Remapping
    #
    # This file has three fields: operation, regex, remapping
    #
    # The operation is a combination of the following letters:
    #
    # r - rewrite the matched string with the remapping pattern
    # i - case-insensitive matching
    # g - repeat until no match (used with "r")
    # e - exit (with success) if we match this pattern, do not process
    # subsequent rules
    # s - start over from the first rule if we match this pattern
    # a - abort (refuse the request) if we match this rule
    # G - this rule applies to TFTP GET requests only
    # P - this rule applies to TFTP PUT requests only
    #
    # The regex is a regular expression in the style of egrep(1).
    #
    # The remapping is a pattern, all characters are verbatim except \
    # \0 copies the full string that matched the regex
    # \1..\9 copies the 9 first (..) expressions in the regex
    # \\ is an escaped \
    #
    # "#" begins a comment, unless \-escaped
    #
    ri ^[a-z]: # Remove drive letters
    rg \\ / # Convert backslashes to slashes
    rg \# @ # Convert hash marks to @ signs
    rg /../ /..no../ # Convert /../ to /..no../
    e ^incoming/ # These are always ok
    r ^[^/] /\0 # Convert nonabsolute files
    a ^\. # Reject requests for hidden files

    sonar 11 éve 0

  • Linux parancsgyűjteményem 2

    1. Get Internal IP Address(es) on Linux Shell / Command Line

    1.1 Get Single IP Address by Interface

    Returns plain IP address.
    ## Example usage ##
    /sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'
    10.20.10.1

    Create simple bash function (example int-ip) with following command.

    function int-ip { /sbin/ifconfig $1 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'; }

    ## Example usage ##
    int-ip eth0
    10.20.10.1

    1.2 Get Every Interfaces IP Address

    Returns every interface and IP address pairs.

    /sbin/ifconfig |grep -B1 "inet addr" |awk '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' |awk -F: '{ print $1 ": " $3 }'

    ## Example output ##
    eth0: 10.20.10.1
    eth1: 10.20.1.168
    lo: 127.0.0.1

    Create simple bash function (example int-ips) with following command.

    Folytatás...

    sonar 11 éve 0

  • raspberry pi

    Image to SD
    1. sha1sum ~/2012-12-16-wheezy-raspbian.zip
    2. unzip ~/2012-12-16-wheezy-raspbian.zip
    3. Run df -h to see what devices are currently mounted -> note which is the SD card
    4. umount /dev/mmcblk0p1
    5. dd bs=4M if=~/2012-12-16-wheezy-raspbian.img of=/dev/mmcblk0

    sonar 11 éve 0

Hirdetés

Copyright © 2000-2024 PROHARDVER Informatikai Kft.