Search found 88 matches

by potong
Mon 26 Sep 2011, 13:09
Forum: Programming
Topic: GtkDialog - tips
Replies: 1504
Views: 907641

2byte: "Sometimes it's hard to see the wood for the trees..." Simplify the code by removing all the flesh and then add it bit by bit back on to the skeleton. # export PUPSAVE_HOT_BKP=$(cat <<EOV | sed -e 's/#.*//' # allow comments in gui EOV) # echo "$PUPSAVE_HOT_BKP" # export PU...
by potong
Fri 23 Sep 2011, 17:02
Forum: Programming
Topic: Insert LineFeed into string? ( echo -e ) [ Solved ]
Replies: 19
Views: 6312

Nearly forgot! # yas=$(set a b c d e;printf "%s\n" "$@") # printf "$yas\n" a b c d e For an array-like method good for functions. Lastly... "%s\n" can be any kind of format you like, check it out here . HTH Potong p.s. big_bass: if your using gnu sed # sed 's/...
by potong
Fri 23 Sep 2011, 14:47
Forum: Programming
Topic: Insert LineFeed into string? ( echo -e ) [ Solved ]
Replies: 19
Views: 6312

technosaurus: printf can replace echo (and I think it's posix too): # string='a,b,c,d,e' # echo -e "${string//,/\n}" a b c d e # printf "${string//,/\n}\n" a b c d e Of course you have to remember to add your own newline! For those that like to work with arrays (non-posix?) # IFS...
by potong
Wed 14 Sep 2011, 14:57
Forum: Programming
Topic: sed problem with a table file <solved> bypass sed for awk
Replies: 22
Views: 6836

ps is a wonder! # ps -A|head -5 PID TTY TIME CMD 1 ? 00:00:00 init 2 ? 00:00:00 kthreadd 3 ? 00:00:01 ksoftirqd/0 4 ? 00:00:00 migration/0 # # elimiate headers # ps -A --no-headers|head -5 1 ? 00:00:00 init 2 ? 00:00:00 kthreadd 3 ? 00:00:01 ksoftirqd/0 4 ? 00:00:00 migration/0 5 ? 00:00:00 migrati...
by potong
Mon 12 Sep 2011, 21:21
Forum: Programming
Topic: sed problem with a table file <solved> bypass sed for awk
Replies: 22
Views: 6836

printf is a very useful builtin. # ps -a >/tmp/ps.txt # wc /tmp/ps.txt 26 104 906 /tmp/ps.txt # head /tmp/ps.txt PID TTY TIME CMD 1759 tty1 00:00:00 sleep 1775 pts/1 00:00:00 ps-FULL 7036 tty1 00:00:00 xinit 7049 tty1 00:00:00 icewm-session 7059 tty1 00:00:16 pup_event_front 7120 tty1 00:00:01 ROX-...
by potong
Fri 12 Aug 2011, 20:00
Forum: Programming
Topic: sed escapes
Replies: 30
Views: 8068

Bash can be quite powerful! This example shows how to use arrays and pattern matching: # cd /tmp # use the /tmp for testing # mkdir test # make a test directory # cd test # mkdir -p path/to/directory/{aaa,bbb,ccc} # make some test directories # touch path/to/directory/{aaa,bbb,ccc}/tesfiles.{a..c} #...
by potong
Wed 29 Jun 2011, 20:25
Forum: Users ( For the regulars )
Topic: New XML Paring Error encountered - solved
Replies: 6
Views: 2434

For the user that may want to solve this problem by hand, here is an easy method that works for Seamonkey, Firefox and Conkeror. 1. Open the browser and enter about:config instead of a url. 2. Confirm you wish to proceed. 3. Enter general.useragent.override in the filter dialogue. 4. If it does not ...
by potong
Wed 06 Apr 2011, 10:24
Forum: Programming
Topic: Why is goto a bad programming practice?
Replies: 49
Views: 18685

The answer to "Why is goto a bad programming practice?" is ... As a trainee COBOL programmer I was told GOTO's use 3 machine instructions PERFORM's use four. From which I derived that GOTO's were quicker (if a little fiddly). However, every programmers manual I was handed derided GOTO's as...
by potong
Wed 06 Apr 2011, 08:59
Forum: Beginners Help ( Start Here)
Topic: Window size in ppm unmanageable..
Replies: 5
Views: 2044

olewilly: An alternative way to access the buttons on an over-large gui is to move the gui around the desktop. If your using the JWM windows manager, here are four ways to do it: 1. Left click and drag the gui title bar (the one with the window decorations on). 2. Right click and drag the gui in the...
by potong
Wed 30 Mar 2011, 11:08
Forum: Programming
Topic: [Solved ] - echo command to file ?
Replies: 7
Views: 3692

stu90: For scripts that write scripts, I've found the here-document to be your friend. # cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 7 model name : Pentium III (Katmai) stepping : 3 cpu MHz : 598.584 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no com...
by potong
Tue 16 Nov 2010, 08:23
Forum: Users ( For the regulars )
Topic: Firefox/Seamonkey silly trick, new tab homepage
Replies: 17
Views: 5667

If you have a mouse with a scroll wheel, clicking the scroll wheel like a button has the same effect.

HTH

Potong

p.s. If you dislike the mouse try Shift-NumLock to use the mouse keys.
p.p.s. Look here too.
by potong
Sun 14 Nov 2010, 12:19
Forum: Programming
Topic: CDE: automatic packaging of Code, Data, and Environment
Replies: 1
Views: 2087

CDE: automatic packaging of Code, Data, and Environment

This may be useful when you want to back/forward port applications. The senario I used it for... I use 4.3.1 and wanted mplayer ogv support but the version of mplayer supplied as a pet was not compiled with it. Wary 0.9 does have ogv support but when I tried the pet on 4.3.1 I encountered library p...
by potong
Fri 12 Nov 2010, 01:45
Forum: Wireless
Topic: GPRS Modems
Replies: 25
Views: 14052

nanap44: Clutching at straws here, if by any miracle this works please continue to work with rerwin so he can refine his solution which in the long run will be more robust and easier. Now... as I see it so far you can connect but have no DNS addresses. Please check if /etc/resolv.conf exists after y...
by potong
Thu 11 Nov 2010, 10:22
Forum: Wireless
Topic: GPRS Modems
Replies: 25
Views: 14052

nap44: I think after reading your posts again, you may already have established a connection but were unable to get the browser to show anything from the internet. Clicked connect on the desktop. Dialogue box opened up as below. Press CTRL-C to close the connection at any stage! defining PDP context...
by potong
Wed 10 Nov 2010, 12:35
Forum: Wireless
Topic: GPRS Modems
Replies: 25
Views: 14052

nap44:

Have you entered /dev/ttyUSB2 yet?

Potong

p.s. Although p/fluppy only identifies /dev/ttyUSB0 and /dev/USB/ttyUSB0 and hasn't found /dev/ttyUSB2, you can force it to accept it.
p.p.s Please show th output from the pgprs-connect.
by potong
Wed 10 Nov 2010, 11:20
Forum: Wireless
Topic: GPRS Modems
Replies: 25
Views: 14052

nap44: I think you're very nearly there! My system has found two devices /dev/ttyUSB0 and /dev/USB/ttyUSB0. Both of these must be my dongle as they disappear if I remove the dongle. I don't know which one is correct, but neither work. My dongle also has a 32Mb storage space on it so maybe the second...
by potong
Wed 10 Nov 2010, 08:49
Forum: Wireless
Topic: GPRS Modems
Replies: 25
Views: 14052

nap44: Fluppy may be the distro for you. It's very well suited to the Acer Aspire One netbook and I found the range of software pre-configured especially usefull. As to connecting your GPRS dongle this thread and my own input may get you started. Alternatively, I first got my dongle working by using...
by potong
Sun 07 Nov 2010, 20:04
Forum: Dialup
Topic: Dialup/Wireless Modem Upgrade Packages for Puppy 4.3+
Replies: 192
Views: 260923

rerwin: Out of interest, does the dev# on the T: line of /proc/bus/usb/devices refer to ttyUSBn? In my case dev#=3, therefore starting from zero would mean ttyUSB2, correct? I ask because I repeated the steps in my howto and sometimes the port is not detected at all or detected incorrectly i.e. zilt...
by potong
Sat 06 Nov 2010, 13:26
Forum: Users ( For the regulars )
Topic: Middle mouse button (scroll) makes Seamonkey windows vanish
Replies: 20
Views: 7279

For my own peace of mind I configured jwm so that I can shade and unshade using ALT-F3. I added this: <Key mask="A" key="F3">shade</Key> to my /root/.jwm/jwmrc-personal file. Another thing I find useful is to be able view the desktop without any windows (frames). I added this: <K...
by potong
Fri 05 Nov 2010, 09:53
Forum: Users ( For the regulars )
Topic: Middle mouse button (scroll) makes Seamonkey windows vanish
Replies: 20
Views: 7279

PaulBx1: The scrollwheel have some interesting features not documented in the config document but may be found in the history notes. The 'disappearing window' effect is caused by two scrollwheel effects in succession. 1) scrollwheel on a border or title "shades" the frame. 2) scrollwheel i...