Search found 934 matches

by seaside
Sat 17 Feb 2018, 17:25
Forum: Programming
Topic: Use rev command to get name of mounted share
Replies: 11
Views: 2800

When I tested df | awk '{ print $NF }' I discovered that it outputs a column of fields rather than the last field The solution was to use the 'echo' command. echo `df` | awk '{ print $NF }' Now I get the share folder /root/network/GOLD-XP-2016-SharedDocs __________________________________________ Y...
by seaside
Sun 31 Dec 2017, 22:18
Forum: Programming
Topic: Inject a wav file in to a bash script
Replies: 12
Views: 2936

Here's another way using tail.

Code: Select all

#!/bin/bash 
#chime.wav
#cat header chime.wav > hourlychime.sh ; chmod +x  hourlychime.sh
hours=`date +"%-l"` 
size=`stat -c %s chime.wav`
for (( i=1; i <= $hours; i++ )); do  tail -c $size hourlychime.sh | aplay;  done
exit;
Cheers,
s
by seaside
Mon 23 Jan 2017, 01:32
Forum: Programming
Topic: YAD - Tips
Replies: 837
Views: 336918

I have the same version- yad --version 0.38.1 (GTK+ 2.24.30) After "create folder" is clicked and a name entered, a "tab" writes the new folder and returns the dialog to a "no selected directory" mode. Or you could click on the dark section to the right of the entry. Th...
by seaside
Thu 19 Jan 2017, 00:34
Forum: Programming
Topic: GtkDialog - tips
Replies: 1504
Views: 911878

selection of tree items

@mavrothal, AFAIK, a widget can have only one associated variable. So a single tree with TREE1 and TREE2 variables isn't possible. @MochiMoppel, thanks for catching my typo! Fixed. Perhaps this also might be useful. # get fields from a tree selection # example file echo 'name1 | cat1 | desc1 | repo...
by seaside
Wed 11 Jan 2017, 14:35
Forum: Cutting edge
Topic: aufs specific snapmergepuppy
Replies: 10
Views: 4844

I suspect the "complain" is because box_* infrastructure is not in older puppies. Installing libstardust pet should fix that. Update also coreutilites to 8.21+ and older puppies should be OK. mavrothal, You're quite right. That test was with Precise 5.7.1, which does not have " /usr/...
by seaside
Tue 10 Jan 2017, 16:37
Forum: Cutting edge
Topic: aufs specific snapmergepuppy
Replies: 10
Views: 4844

gyro, I like this approach. There was a little item that crept into the code. error_msg () line 219 /usr/lib/gtkdialog/box_splash -timeout 30 -close box -icon gtk-dialog-warning -bg red -text "$1" (probably should be) yaf-splash -box_splash -timeout 30 -close box -icon gtk-dialog-warning -...
by seaside
Mon 26 Sep 2016, 22:04
Forum: Programming
Topic: Converting 12 digits number to 6 digits number and reverse?
Replies: 35
Views: 7192

Perhaps this will do.. if.....

#RRGGBB = (8 bits each)
#RRRRGGGGBBBB = (16 bits each)

then-
pick first two of each group

Code: Select all

# color_12='#440044004400'
#  cut -c 1-3,6,7,10,11 <<< "$color_12"
#444444
Cheers,
s
by seaside
Fri 02 Sep 2016, 15:37
Forum: Users ( For the regulars )
Topic: X failure to load flag file?
Replies: 2
Views: 438

Hey sunburnt,

file "/root/.XLOADED"

and it should be false or missing before loading. Usually caused by improper shutdown.

Best regards to you in the heat.

Cheers,
s
by seaside
Sun 21 Feb 2016, 17:47
Forum: Programming
Topic: GtkDialog - tips
Replies: 1504
Views: 911878

MochiMoppel wrote:
don570 wrote:
Anyway, time entry can be tricky. You would need more tests to catch invalid times like 25:11:22 or 22:1:122.
Perhaps adapting this approach-

Code: Select all

 [[ $time_entry =~ ^[0-2]?[0-9]:[0-5][0-9]:[0-5][0-9]$ ]] && echo yes 
Cheers,
s
by seaside
Thu 14 Jan 2016, 00:39
Forum: Programming
Topic: GtkDialog - tips
Replies: 1504
Views: 911878

Hi All. I have a problem about size of window. When I just use <notebook>, or i use show-tabs="true", The size of notebook is so wide. Then I think, by use show-tabs="false", it can be fixed. But no. Anybody know how to normal it? Thank you. recobayu, You might specify the windo...
by seaside
Thu 03 Dec 2015, 19:11
Forum: Programming
Topic: (Solved) How to replace text blocks inside a Script?
Replies: 13
Views: 4874

LazY Puppy,

How about this for lines in bash-

Code: Select all

line='some line to replace'
line_2='a replacing line'
# echo ${line/$line/$line_2}
a replacing line
Text blocks would be tricky.

Cheers,
s
(when can we see the "topless" code :D )
by seaside
Sat 07 Nov 2015, 01:24
Forum: Programming
Topic: YAD - Tips
Replies: 837
Views: 336918

image-on-top

Bert,

It seems that "image-on-top" isn't what it appears to be. :D

https://code.google.com/p/yad/issues/detail?id=113

Cheers,
s
by seaside
Fri 04 Sep 2015, 20:45
Forum: Beginners Help ( Start Here)
Topic: Execute Bash commands from Gnumeric?
Replies: 12
Views: 2701

Some years back, I remember doing a workaround where I renamed one of the Gnumeric allowable types for the default file opener. (defaultxxx -eg defaulttexteditorHOLD). Made a redirection script that contained exec rxvt -hold -e "$@" then linked that redirection script back to "default...
by seaside
Wed 02 Sep 2015, 21:05
Forum: Programming
Topic: Web Programming
Replies: 93
Views: 75802

Converting scanned bitmap images of graphs from books and journals to csv files (data points) is done quite well by this windows program. http://www.chem.uoa.gr/misc/specscan.htm I wonder how it works? Is there web code that could do similar? kjdixo, I've often thought of converting bitmaps to svg ...
by seaside
Sun 05 Jul 2015, 15:48
Forum: Programming
Topic: SMS backup messages - strip text from .vmg files [SOLVED]
Replies: 68
Views: 16572

Another approach would be to grab the data between "BEGIN:VBODY" and "END:VBODY" (that's assuming all messages only go there)

Code: Select all

sed  '/^BEGIN:VBODY/,/^END:VBODY/!d;//d' msgfile
Then any multi-line data after "TEXT" could be handled.

Cheers,
s
by seaside
Sat 04 Jul 2015, 17:58
Forum: Programming
Topic: SMS backup messages - strip text from .vmg files [SOLVED]
Replies: 68
Views: 16572

This is a very engaging discussion. MochiMoppel mentioned- @seaside Wouldn't fdate=${fdate%% *} remove the time strings? Yes, starting from the end of the string remove all chars up to and including the furthermost space. Greengeek, this is probably not a good time to bring this up, but isn't this s...
by seaside
Sat 04 Jul 2015, 01:29
Forum: Programming
Topic: SMS backup messages - strip text from .vmg files [SOLVED]
Replies: 68
Views: 16572

for f in /path/to/msgs/* ; do while read line || [ "$line" ]; do case $line in Date:*) fdate=${line#*:} fdate=${fdate%% *} ;; TEXT:*) ftext=${line#*:} result="$fdate\t$ftext" ;; esac done <$f echo -e "$result" done I think the technosaurus technique would handle it as ...
by seaside
Mon 29 Jun 2015, 15:26
Forum: Programming
Topic: Geany - automate "replace" with regular expressions??
Replies: 36
Views: 8808

greengeek, you mentioned.... The first time i tried these they seemed to work ok but now I try them again it seems that they do not process the final text field. No matter how many Date/TEXT lines I add, the last TEXT field is always missing. Is it just me? Probably, there is no blank line at the en...
by seaside
Sat 27 Jun 2015, 16:44
Forum: Programming
Topic: Geany - automate "replace" with regular expressions??
Replies: 36
Views: 8808

Here's a one liner sed...

Code: Select all

sed  -e 'N;s/\(.*\)\n\(.*\)/\1\2/' -e 's/Date:/ /' -e 's/TEXT:/ /' -e 's/\.[0-9]\{4\}//' msgs
It just appends the line below to the one above and removes unwanted items.

Cheers,
s
by seaside
Mon 22 Jun 2015, 19:54
Forum: System
Topic: savefile2dir 1.6 - Convert savefile to savefolder
Replies: 29
Views: 19192

gyro,

Code: Select all

FSTYP="`df --output=fstype \"$imgFile\" | tail -1`"
Another way to get the filesystem type

Code: Select all

file "$imgFile"|awk '{print $5}'
Cheers,
s