I have a directory full of files and sub-directories which I've pulled
from an emulator. But it has extra filename extensions on it. I would
like to traverse this directory, stripping off the extensions and so
I've been trying to write a script to do it but it's failing.
An example of a file is this :- lamborghini miura_1024.jpg,c85 and so
there, I'd like to remove the ,c85. But a bigger problem is where I have
the odd file which has a numeric extensions such as .;1 and that's where
I …
[View More]struggle. How do I do a substitution in my script to cope with things
like that?
I've been reading things like this -
http://www.cyberciti.biz/tips/renaming-multiple-files-at-a-shell-prompt.html
and
http://www.unix.com/answers-frequently-asked-questions/13774-unix-tutorials…
but I'm still struggling.
Can somebody point me in the right direction please, even if it's
towards the door ;-)
--
__ __| |_ __ __ .----------------------------------------------.
/ _/ _` \ V V / | mailto:cdw_alug@the-walker-household.co.uk |
\__\__,_|\_/\_/ |______________________________________________|
[View Less]
Hi everyone,
I joined the mailing list yesterday and I thought I would introduce myself.
I am a woman. And I work and live in Ipswich. I’ve been interested in
GNU/Linux since 2002/2003.
The first distro I saw and got installed on my HP nx9020 laptop was
Slackware. Someone told me ‘if you learn Slackware, you will be fine with
any distro”, so I gave it a go.
I used to work on Windows 98, Windows XP and HP, HP-UX.
The job I do now has nothing to do with Linux or computers. I neither am IT
…
[View More]professional nor a geek. (OK, maybe a very little one:))
Today I use Ubuntu on my old HP nx9020 and Windows 7 on my brand new, shiny,
lovely ThinkPad T420s. It’s just a few weeks old baby and the only reason
it’s got Windows 7 on board is that I was curious how it looks and feels
like and if it’s any better than XP. I’m not impressed. Actually, it annoys
me more and more every day. So, the time to install some nice and working OS
is coming.
I like reading books, walking, chatting on IRC and learning new things. I’m
not a very talkative person (as for a woman!) so you may see me hanging
quietly at #ALUG quite often.
So, this is me. And I look forward to chatting to all of you ALUGers!
Krystyna
(Medea)
[View Less]
Hi everyone,
I'm wondering if anyone has had any luck or
otherwise with USB Port Replicators - and specifically the sound and
serial outputs on them.
I've a system at home that lives underneath my
desk, but has no sound card, but given my radio is on the blink I was
looking at getting some use out of my mp3 collection and rediscovering
some old tunes.
Looking at something like the following ebay lot:
http://www.ebay.co.uk/itm/Targus-Mobile-USB2-0-Port-Replicator-PAEPR092E-NE……
[View More]Appreciate any feedback :)
Jim
[View Less]
I'd like to play with one of the various energy monitoring gadgets that seem
to be everywhere these days. I'm looking for one that will transfer data to my
PC, and obviously that PC is running Linux (Ubuntu 11.04 at the moment, not
sure if it will go to 11.10 yet...)
Any suggestions/recommendations?
I'm as lazy as they come so ideally I'm looking for something that can be
permanently connected to my PC (therefore presumably a wireless connection
will be involved at some point); I don't …
[View More]really want a box that collects data
that I then take to my PC to download it once a week/month/year/never. And I'm
also looking for access to the raw data, but also suggestions for suitable
GUIs welcome too.
Mark
--
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450
Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER
[View Less]
I'm flummoxed by this error, even worse is that the code seems to work
sometimes but I can't see any pattern in the data that causes it.
The code is as follows:-
try
{
$insQuery = "INSERT INTO log ";
// $insQuery .= "(seqno, year, month, day, hour, minute, waterway, pk, place, distance, eng_hrs, fuel_cm, fuel_lt, note, type, sailing)";
$insQuery .= "(seqno, year, month, day)";
$insQuery .= " VALUES ";
// $insQuery .= "…
[View More](:seqno, :year, :month, :day, :hour, :minute, :waterway, :pk, :place, :distance, :eng_hrs, :fuel_cm, :fuel_lt, :note, :type, :sailing );";
$insQuery .= "(:seqno, :year, :month, :day);";
$st = $db->prepare($insQuery);
foreach ($rows as $row)
{
$row['seqno'] = $seqno++;
$st->execute($row);
}
$st->closeCursor;
}
catch (PDOException $e)
{
dbglog("PDO() insert error" . $e->getMessage());
dbglog("insquery: $insQuery");
foreach($row as $k=>$v)
{
dbglog("k is: $k, v is $v");
}
}
... and what I'm seeing in the log is:-
13:53:59 192.168.1.4: PDO() insert errorSQLSTATE[HY000]: General error: 25 bind or column index out of range
13:53:59 192.168.1.4: insquery: INSERT INTO log (seqno, year, month, day) VALUES (:seqno, :year, :month, :day);
13:53:59 192.168.1.4: k is: year, v is 2011
13:53:59 192.168.1.4: k is: month, v is 11
13:53:59 192.168.1.4: k is: day, v is 12
13:53:59 192.168.1.4: k is: hour, v is 10
13:53:59 192.168.1.4: k is: minute, v is 00e
13:53:59 192.168.1.4: k is: waterway, v is
13:53:59 192.168.1.4: k is: pk, v is
13:53:59 192.168.1.4: k is: place, v is Cappy
13:53:59 192.168.1.4: k is: distance, v is
13:53:59 192.168.1.4: k is: eng_hrs, v is 2695.3
13:53:59 192.168.1.4: k is: fuel_cm, v is 8.5
13:53:59 192.168.1.4: k is: fuel_lt, v is
13:53:59 192.168.1.4: k is: note, v is Engine started after replacing blown mega-fuse, all OK otherwise
13:53:59 192.168.1.4: k is: type, v is TEF
13:53:59 192.168.1.4: k is: price, v is
13:53:59 192.168.1.4: k is: sailing, v is 1
13:53:59 192.168.1.4: k is: seqno, v is 0
So what does "General error: 25 bind or column index out of range"
actually mean, I could find nowhere that explains it. Now my guess is
that it's telling me that I have a column name wrong somewhere but my
'log' table definitely has columns year, month, day and seqno of the
correct type. Maybe I have the syntax wrong somehow for the VALUES()
bit but again I can't find any really good explanation of exactly what
the syntax is, it seems decidedly woolly.
--
Chris Green
[View Less]
I've been developing a simple web site for someone using WordPress
(along with zillions of others I believe).
I've now discovered that it is horrendously awful to move it to another
domain! Not only are links in WordPress absolute but there are also
loads of database entries which have the absolute URL in them.
So one has to fix all the links in pages one has created *and* one has
to search through the database and fix URLs there too. Aaaarrrrgggghhhh!!!!
Setting the 'WordPress Address' …
[View More]and the 'Site Address' on the dashboard
settings page only fixes URLs generated by the code (i.e. the menu links
to pages).
Apart from anything else it makes doing maintenance/development a
nightmare.
Is there any way around this or is the only approach for maintenance to
have two parallel sites one 'development' and one 'live' where one tries
out changes on the development site and then repeats them (hopefully
correctly) on the live site.
--
Chris Green
[View Less]
Now it may be that I've missed something obvious here but I've got
Clam installed but can't see anyway of running it, either with mouse
clicks or otherwise. How do I do that? (Lucid, 10.10)
Bev.
Hi,
Has anyone done anything with GNU enhanced getopt in bash to process
incoming command line parameters?
My understanding is that I have the choice of using the built-in
"getopts" command within bash (on a CentOS 5.3 derivative distro),
which doesn't support long options (e.g. --long-option as opposed to
-l), or I can use the getopt (enhanced) 1.1.4 binary which lives in
/usr/bin/getopt.
I want to use long options, so I'm using the GNU getopt binary. An
example script is below. Note that …
[View More]there is one oddity - for
compatibility with some other related scripts, I need the first
parameter to be something else ... so the first few lines are intended
to munch $1 and pass all the remaining parameters to getopt. I don't
think that should affect anything, but I've left it in as that's how
I'm currently testing it.
My problem is that I don't seem to be able to get the parsing to work
as I expect. Specifically:
# ./cmd.sh . -i -o 1
input -i is -o
So the problem here is that it's quite happy to set the required
parameter for -i to be -o ... when actually I was expecting it to
catch that -i was missing a parameter. I think I had this working
using getopts, but I need to be able to support long options now.
I've messed around a bit with several different ways of writing the
case script, but not managed to get it working any better.
So, idle question ... has anyone got a script like this where the
error checking is a bit more robust than the sample below?
Cheers,
Peter.
#!/bin/bash
paramArray=("${@}")
unset paramArray[0]
paramArray=("${paramArray[@]}")
getopt -T
if [ "$?" != "4" ]; then
echo GNU enhanced getopt not detected. Quitting ...
exit 1;
fi
# Override defaults with incoming parameters, if specified
PN=`basename $0`
ARGS=`getopt --name "$PN" --longoptions
input:,output:,noshort:,verbose --options i:o: -- "${paramArray[@]}"`
if [ $? -ne 0 ]; then
echo "Invalid option specified or expected parameter argument
missing. Quitting ..."
exit
fi
eval set -- "$ARGS"
while [ $# -gt 0 ]; do
case "$1" in
-i | --input)
echo input $1 is "$2";
shift;;
-o | --output)
echo output $1 is "$2";
shift;;
--noshort)
echo noshort $1 is "$2";
shift;;
-v | --verbose)
VERBOSE=yes;
shift;;
--)
shift;
break;;
esac
shift
done
exit;
[View Less]
I'm wondering what are the relative risks of the different ports I have
opened up on my firewall.
Currently the ports I have open are:-
22 - ssh (but limited to only allowing two IP addresses to connect)
80 - http
25 - smtp
873 - rsync (not sure if I actually use this now, must check!)
I'm considering what the risks of opening up port 443 (https) are to use
with shellinabox and ssh. This would allow ssh from a web browser
anywhere into my desktop machine (in addition to …
[View More]https access to the
apache server of course), is this a significantly bigger risk than the
limited ssh access that I have now?
My thinking is that the port 443 access to ssh *is* significantly
riskier than my existing ssh access, however I'm not sure if I'm being
overly paranoid given that I already have open access on port 80 to my
web server.
What I'm really asking is whether worrying about open ssh access (with a
good secure password) is a bit irrelevant given that port 80 is open to
web browsers? Or is the damage that could be done if someone *does*
guess my password (or it gets out by some other means, quite possible)
for ssh much worse than anything using a browser/apache exploit?
Any/all help appreciated, including ways that I could limit the
shellinabox access to specific clients. As it is the client I'm
thinking of is my Kindle but nothing at the shellinabox end can see
anything to do with the Kindle because the proxying in between
effectively anonymises the connection.
--
Chris Green
[View Less]
ALUG Announce
Please send announcements to Announce(a)lists.alug.org.uk
Unsub, change settings via http://lists.alug.org.uk/mailman/listinfo/announce
-----
The monthly "Third Monday" ALUG Ipswich Social Meeting is back
tonight, Monday 21st November, at 20:00:
P J McGinty & Sons
15 Northgate Street
Ipswich
Suffolk
IP1 3BY
Tel: 01473 251 515
Map/Directions URI: http://maps.google.co.uk/?q=IP1+3BY
WWW: http://www.pjmcgintys.co.uk/
McGintys pub is in the centre of Ipswich. It's directly …
[View More]opposite the
town's central library and has a reputation for good Irish beer. We're
usually to be found in the lowest section of the bar, near the library
entrance to the pub.
All are welcome, novices and experienced users. Feel free to ask for
further information on the Main ALUG mailing list.
Peter.
-----
Send discussion replies to main(a)lists.alug.org.uk (Reply-To set)
Unsub, change settings via http://lists.alug.org.uk/mailman/listinfo/announce
[View Less]