The Following User Says Thank You to peterleinchen For This Useful Post: | ||
|
2012-12-04
, 22:41
|
Posts: 1,163 |
Thanked: 1,873 times |
Joined on Feb 2011
@ The Netherlands
|
#12
|
dc --help BusyBox v1.20.2 (Debian 1.20.2power4+thumb0) multi-call binary. Usage: dc EXPRESSION... Tiny RPN calculator. Operations: +, add, -, sub, *, mul, /, div, %, mod, **, exp, and, or, not, eor, p - print top of the stack (without popping), f - print entire stack, o - pop the value and set output radix (must be 10, 16, 8 or 2). Examples: 'dc 2 2 add p' -> 4, 'dc 8 8 * 2 2 + / p' -> 16
|
2012-12-04
, 22:51
|
Posts: 2,290 |
Thanked: 4,134 times |
Joined on Apr 2010
@ UK
|
#13
|
/media/mmc1 $ bash swapblocks.sh 261896 ublocks 134090752 ubytes 130948 ukbytes, 127 umbytes, 0 ugbytes 838852608 totalswapbytes 1 lasttotalsb 134090751 getcurrent 13409075100 timeshundred 15 % Swap Fragmented
/media/mmc1 $ sh swapblocks.sh 261896 ublocks 134090752 ubytes 130948 ukbytes, 127 umbytes, 0 ugbytes 838852608 totalswapbytes 1 lasttotalsb 134090751 getcurrent 524173212 timeshundred 0 % Swap Fragmented
|
2012-12-04
, 23:11
|
Posts: 2,290 |
Thanked: 4,134 times |
Joined on Apr 2010
@ UK
|
#14
|
dc --help -sh: dc: not found
|
2012-12-05
, 08:01
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#15
|
The Following 4 Users Say Thank You to peterleinchen For This Useful Post: | ||
|
2012-12-05
, 08:16
|
Posts: 1,808 |
Thanked: 4,272 times |
Joined on Feb 2011
@ Germany
|
#16
|
BASH
ASHCode:/media/mmc1 $ bash swapblocks.sh 261896 ublocks 134090752 ubytes 130948 ukbytes, 127 umbytes, 0 ugbytes 838852608 totalswapbytes 1 lasttotalsb 134090751 getcurrent 13409075100 timeshundred 15 % Swap Fragmented
Code:/media/mmc1 $ sh swapblocks.sh 261896 ublocks 134090752 ubytes 130948 ukbytes, 127 umbytes, 0 ugbytes 838852608 totalswapbytes 1 lasttotalsb 134090751 getcurrent 524173212 timeshundred 0 % Swap Fragmented
The Following 5 Users Say Thank You to reinob For This Useful Post: | ||
|
2012-12-05
, 19:09
|
Posts: 2,290 |
Thanked: 4,134 times |
Joined on Apr 2010
@ UK
|
#17
|
#!/bin/sh # Setup notification banner banner(){ o=org f=freedesktop n=Notifications run-standalone.sh dbus-send --type=method_call \ --dest=$o.$f.$n /$o/$f/$n $o.$f.$n.SystemNoteInfoprint string:"$1" } # Setup notification dialog dialog(){ o=org f=freedesktop n=Notifications run-standalone.sh dbus-send --type=method_call \ --dest=$o.$f.$n /$o/$f/$n $o.$f.$n.SystemNoteDialog string:"$1" uint32: string: } #Get current swap from /proc/swaps disk=$(cat /proc/swaps | awk '/dev/ {print $1}' | cut -d "/" -f 3) #Get blocks used since boot from /proc/diskstats ublocks=$(awk '{if ($3=="'"$disk"'") print $10}' /proc/diskstats) echo $ublocks ublocks #Multiply blocks by 512 to get used bytes ubytes=$(($ublocks*512)) #Calculate used bytes into Kb, Mb and Gb echo $ubytes ubytes ukbytes=$(($ubytes/1024)) umbytes=$(($ubytes/1024/1024)) ugbytes=$(($ubytes/1024/1024/1024)) echo $ukbytes ukbytes, $umbytes umbytes, $ugbytes ugbytes #Get Swap size from /proc/swaps swapsize=$(awk '{if ($1=="'"/dev/$disk"'") print $3}' /proc/swaps) #Divide by 1024 to get swap size in megabytes swapsizembytes=$(($swapsize/1024)) echo $swapsizembytes swapsizembytes #Get last megabytes value from /tmp folder lasttotalsmb=$(cat /tmp/flopswaplast | awk '{print $1}') echo $lasttotalsmb lasttotalsmb #Subtract last from current value to get latest used value getcurrent=$(($umbytes-$lasttotalsmb)) echo $getcurrent getcurrent timeshundred=$(($getcurrent*100)) echo $timeshundred timeshundred #Get divide to get percent getpercent=$(($timeshundred/$swapsizembytes)) echo $getpercent % Fresh Swap Written #Print banner banner "$getpercent % Fresh Swap Written $getcurrent Mb of $swapsizembytes Mb" #If 94% show warning dialog if [ $getpercent -ge 94 ]; then dialog " ***Fresh Swap Recommended*** Used \"$getcurrent Mb ($getpercent)\" of \"$swapsizembytes Mb\" Device $(hostname) on $(date) " fi
/media/mmc1 $ sh swapblocks.sh 262984 ublocks 134647808 ubytes 131492 ukbytes, 128 umbytes, 0 ugbytes 799 swapsizembytes 1 lasttotalsmb 127 getcurrent 12700 timeshundred 15 % Fresh Swap Written
The Following User Says Thank You to sixwheeledbeast For This Useful Post: | ||
I would also guess anon-numeric string?
Or what is the error message. Or full output of script.
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!
Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257
editsignature, http://talk.maemo.org/profile.php?do=editsignature