Re: [SLUG] Escaping illegal characters in filenames - how?

2010-10-06 Thread Owen Townend
On 7 October 2010 16:44, DaZZa  wrote:
> Folks.
>
> I've got an idiot user who has created a file on a Linux filesystem named
>
> -.mxf
>
> I need to rename this file, but can't for the life of me remember how
> to escape the - character so mv doesn't regard it as an "option"
> identifier.
>
> Can someone apply the cluestick, please?
>
> DaZZa

Hey,
>From the rm man page:
>   To remove a file whose name starts with a `-', for example `-foo', use 
> one of these commands:
> rm -- -foo
> rm ./-foo

$ rm -- -.mxf

Cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] can I make this recursive?

2009-07-27 Thread Owen Townend
2009/7/28 Ben Stringer :
>> I have a n000b question.
>> I found a neat housework script to change case & space but
>> I'm wondering is it possible to run it recursively?
>> If so where do I put the -r in it?
>>
>> #!/bin/bash
>> for f in *; do
>>       file=$(echo $f | tr A-Z a-z | tr ' ' _)
>>       [ ! -f $file ] && mv "$f" $file
>> done
>>
>> cheers,
>> Meryl
>>
>
> Hi Meryl,
>
> Change "for f in *; do" to be "find . -type f ; do"
>
> This will recursively find all files from the current directory down.
>

If you're going to do that then you will probably want to also use
'basename' and 'dirname'.


#!/bin/bash

find . -type f -exec sh -c '
file=$(basename "{}" | tr A-Z a-z | tr " " _)
[ ! -f "$file" ] && echo OLD:"{}" NEW:"$(dirname "{}")/$file"
' \;


Edit to 'mv' when you're sure that it works...

cheers,
Owen.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Synchronizing from Windows to Linux

2009-05-25 Thread Owen Townend
2009/5/26 Andre Kolodochka :
> Given that my Lacie Ethernet disk just died, I was thinking of solid
> backup solutions for my personal files (20-30Gb). Since I have already
> Linux hosting with way more disk space than I need, I thought it will
> be great if I could sync a folder on my local drive to a folder on
> that Linux box... somewhere there.
>
> The problem is my local box running Windows, otherwise rsync would do
> wonders. Anybody knows of a good tool I could use to sync Windows
> folders to Linux ones? And the one that will work over Internet, not
> just LAN.

One 'Microsoft' way would be to use SyncToy[0]. To use it you would only
have to mount a samba share from the linux box as a network drive.

Cheers,
Owen.

Footnotes:
--
[0] 
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=c26efa36-98e0-4ee9-a7c5-98d0592d8c52
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] FINALISED - HD ( 1920 x 1080) monitor and Linux - advice pls.]

2009-05-14 Thread Owen Townend
2009/5/15 Kevin Shackleton :
> On Thu, 2009-05-14 at 18:36 +0800, Dion wrote:
>> Actually its a 16:10 ratio.
>
> Terminology is curious.
>
> Did anyone do the arithmetic?  1920/1080 = 1.8 = 16/9
>
> However, that doesn't say anything about if items in a scene look blocky
> or skinny - that depends on the ratio of the length and width of the
> screen.  No-one said the pixels have to be square.

A large number of plasma tvs have 16x9 ratios with a 1024x768
resolution. Their pixels are obviously not square. The LCD
mentioned here though is 1920x1200... 1920/1200 = 1.6 = 16/10...

so...
> On Thu, 2009-05-14 at 18:36 +0800, Dion wrote:
>> Actually its a 16:10 ratio.

Some of the newer LCDs can handle a 1080p input (DVI or HDMI)
using letterboxing which (without rtfm) _may_ be the case here.

cheers,
Owen.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] recovering removed files

2009-05-13 Thread Owen Townend
2009/5/14 Barrie Hall :
[snip]
> I've recovered source code by dd'ing the volume to a file and then fishing
> for blocks of text. A JPEG would present more of a challenge but if it is
> contagious on the disk you might get lucky.
>

I almost forgot, there's also a jpeg specific recovery tool aptly
named 'recoverjpeg'
It's in the Ubuntu Universe repository, so it should be fairly
straight forward to try...

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] recovering removed files

2009-05-13 Thread Owen Townend
2009/5/14 david :
> Long story, but I have a photo that has been removed (rm file.jpg) on an
> ext3 filesystem, Ubuntu 8.10
>
> The hard drive is NOT the root drive and it has been unmounted and remounted
> read only - <# mount -t ext3 -o ro /dev/sdb1 /mountpoint>. Nothing was
> written on the drive as far as I know before unmounting.
>
> The obvious question: how to attempt recovery? I've stumbled on a thing
> called ext3undel but it's not in the Ubuntu repositories, which made me
> suspicious.
>
> There are lots of google comments saying "can't be done".
>
> What are my chances? any suggestions? Would be nice to have some success
> stories before I try the wrong thing and mess things up.

I have had success in the past using autopsy/sleuthkit
(http://www.sleuthkit.org)
There's a slight learning curve, but it should be able to do what you
ask if the data still exists.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] FINALISED - HD ( 1920 x 1080) monitor and Linux - advice pls.]

2009-05-13 Thread Owen Townend
2009/5/14 bill :
> This AM drove to Alexandria and visited Allans Music ( waste of time) and
> had intended to visit Harris Technology (gone) which used to be next door.
>
> On way home I spied a small computer shop (also in Alexandria) which
> happened to have a BenQ E2400WD in stock, unopened. Pric quoted was $345,
> $85 and $200 cheaper than local shops, so I took it on the spot.
[snip]

What was the shop in Alexandria?
My usual is Megaware (near Green Square station) but I'd be interested
if there was decent competetition for them in the area...

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: useful bash tricks thread

2009-02-08 Thread Owen Townend
2009/2/9 Rick Welykochy :
> Owen Townend wrote:
>>
>> 2009/2/9 Amos Shapira :
>> [snip]
>>>
>>> And one last thing, related to security - if you type a sensitive
>>> string on the command line and get it into your history, use "history
>>> -d" to delete this line.
>>>
>>
>> There is an easier way around this. Most shells, bash included will
>> exclude a line from the history if you begin it with a space.
>
> My bash doesn't do this. It includes the line in the history :(
>
> but
>
> HISTSIZE=2000
> SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
>
> might have an effect on this behaviour.

Ah, my default bashrc has HISTCONTROL set.

~$ echo $HISTCONTROL
ignoreboth

This sets ignorespace and ignoredups, see the man page for details.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Re: useful bash tricks thread

2009-02-08 Thread Owen Townend
2009/2/9 Amos Shapira :
[snip]
>
> And one last thing, related to security - if you type a sensitive
> string on the command line and get it into your history, use "history
> -d" to delete this line.
>

There is an easier way around this. Most shells, bash included will
exclude a line from the history if you begin it with a space.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] useful bash tricks thread

2009-02-07 Thread Owen Townend
2009/2/6 Tony Sceats :
> It's been a while since there's been a thread like this, so I thought it
> would be fun :)
>
> so, have you got any?
>

Really quick, basic one that most know, but is handy:
Instead of redirecting output to /dev/null simply use '&-' to close the stream.
e.g.
$ find . 2>&-

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Mythbuntu set up not 'quite' right

2009-01-27 Thread Owen Townend
elliott-brennan wrote:
> Hi all,
>
> I'm looking for some ideas to help me complete my
> installation set-up.
>
> I've just installed Myth on top of Ubuntu 8.04.1.
>
> The machine:
>
> - 3Ghz P4
> - 1.3G RAM
> - HDD x 2 (160G primary, 500G secondary)
> - PVR-150 x 2
> - Nvidia MX4000 128Mb RAM
> - On-board Intel sound card - I only have three
> PCI slots on the mobo and no AGP - so can't
> install another sound card.
> - I have a Hauppauge IR remote but am buggered
> about setting it up (will have to wait for another
> month :))
> - Standard analogue TV connected to the PC by an
> s-video to RCA (I think it's called) adapter.
> - BlueRay player/DVD burner
>
> I did start with a PVR-500 (dual tuner) but could
> NOT get the damn thing to be recognised by
> Mythbuntu - in fact it refused to install at all.
>

Try using the latest linuxtv.org drivers instead:

This works for me: (different card, similar issue)
wget http://linuxtv.org/hg/v4l-dvb/archive/bb3888b47e93.tar.bz2  (or
see http://linuxtv.org/repo for instructions)
Make sure you have the kernel headers and build tools installed
('build-essential' package)
extract the tarball
backup & remove /lib/modules/`uname -r`/kernel/drivers/media/*  (
avoids conflicts with existing drivers, if you have issues, there may
also be conflicting drivers in '/lib/modules/`uname
-r`/ubuntu/media/', again, make backups )
make all && sudo make install
restart


> I have sound, but not through the telly (I can
> plug-in headphones to the on-board sound and it
> works). I'm assuming I can plug in a cable to the
> on-board output and see if that works by plugging
> it into the telly's audio input.

How are you plugging it into the telly now?
If it is a composite cable (yellow) then you will also need to use the
other two (black and red) for audio.
This will probably require a '3.5mm Stereo to 2xRCA' cable to get from
the headphone port to the tv audio in.

>
> I can access telly via the Ubuntu desktop - NOT
> what I want - with Xawtv - so at least one of the
> tuners is working.
>
> 1. The text is slightly blurry on the desktop (I'm
> assuming this is the consequence of my telly not
> having the resolution of a computer monitor)
>
> 2. there is a slight 'interference' running on the
> screen. I'm assuming this is the result of an
> incorrect refresh rate.

Look into setting a modeline that conforms to the PAL spec and you should be ok.
If that doesn't mean anything to you (yet), then either ask more or it
at least gives you some keywords to search with.

>
> 4. I cannot get the machine to boot into the
> lovely Mythbuntu GUI (with the big buttons that
> say things like 'Watch Telly'). I can only boot
> into a desktop like Gnome.
>

Sounds like you installed the myth packages directly.
If this is going to be a dedicated myth box then look into installing
the 'mythbuntu-desktop' package.

Or you can just add 'mythfrontend' to your startup applications under
System -> Preferences -> Sessions

> 3. The desktop image is slightly drawn to the
> left. I have an older analogue telly, so there are
> no 'display' controls as on some LCD telly's and
> PC monitors.

This is most likely also caused by the refresh rate issues you mentioned above.

>
> 4. Do I have to plug both tuners into the telly
> aerial? I'll have to buy a second adapter
> (male/male) to do this - not a great cost of course)

yes, definitely.  Both tuners will need their own input.

>
> Any help would be most appreciated. This is not a
> 'mission critical' unit :)) though my wife may
> criticise my mission if I can't get it to work!
>
> Thanks in advance.
>
> Regards,
>
> Patrick
>

Hope this helps a little,
Cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] comparing directory trees

2009-01-20 Thread Owen Townend
2009/1/21 Erik de Castro Lopo :
> david wrote:
>
>> I have a directory tree, plus an approximate copy of the same tree.
>> du reports 35mb for one and 36 for the other. They  are quite complex trees.
>>
>> My task is to figure out where and why they are different. Is there a simple 
>> way
>> to do this? A kind of diff for directories/files/filesizes.
>
> I'm pretty sure the diff program will actually do this.
>
[snip diff options]
>
> You may also want to try doing "ls -lR dirname > dirname.txt" on both
> directories and then viewing the outputs in a graphical diff program.
>
> HTH,
> Erik
[snip footer]

For a different type of formatted output you could also try something
like tree[0]
$ tree -ah dir1 > dir1.out
$ tree -ah dir2 > dir2.out
$ diff -wy --left-column dir1.out dir2.out

cheers,
Owen.

[0] `tree` is in its own package by the same name under Ubuntu, I
imagine it is similar for other distros.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] MythTV Quite Multi-streaming H.Drives

2009-01-11 Thread Owen Townend
2009/1/12 Grahame Kelly :
>
> Hi MythTV Users.
>
> < In a effort to have the most silent MythTV backend integrated frontends' >
>
> Those of you with some available dosh may be interested in the following
> hard drives just released that are specially suited to multi-streaming media
> data (DTV).  That is of course until Solid State Drives become affordable
> and appropriate sizes for DTV Media Centres, will probably do the best
> available job of storage.
>
> URL  -->
>  http://www.crn.com.au/News/92392,seagate-launches-new-pipeline-hd-drives.aspx
>
> Cheers. Grahame.

Hey,

I imagine this is to compete directly with the Western Digital 'AV'
branded drives which have been around for a while now and have very
similar characteristics.
http://www.westerndigital.com/en/company/releases/PressRelease.asp?release=%7BB1A99C2C-27CC-4575-9CC3-253DA4AB6A63%7D
(N.B. Dated: April 9, 2007)

It is also possible on most drives to adjust the acoustic profile
using `hdparm -M`.  Using this you can sacrifice performance for
reduced noise. Even better of course is to have the drives spun down
when not in use, then they're very quiet...

Cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] VLC to TV

2009-01-07 Thread Owen Townend
2009/1/8 jam :
> On Thursday 08 January 2009 10:00:05 slug-requ...@slug.org.au wrote:
>> I'm looking to setup a pc with an output to a tv (big flatscreen) to
>> play video files. Sort of like home theatre.
>>
>> or video files over a lan connection from a server.
>>
>> recording tv is not necessary but may be good.
>>
>> Is there a Linux distro that does this or do people go for a hardware
>> appliance?
>
> As others have enthused, mythtv on your choice of distro.
> I'd never go without myth either HOWEVER the actual graphics performance is
> aweful. Even on high end nvidea cards the display jitters, movies are 'OK'
> footy or Motor  Racing etc is terrid.
> Even modest hardware is distinctly better and high end hardware eg sony bravia
> is much smoother.
>
> We've tried Core2, AMD-X2, Intel and Nvidia graphics: Mobo, 8500, 8600 without
> significant -aaah's
>
> James

Hey,

Sounds like you're doing something wrong in the setup...
My combined front/backend has an AMD 780G chipset mobo with onboard
HD3200 graphics and an AMD 4850e CPU (45W, low power dual core 2.5GHz)
and outputs to a 1080p display without issue [0] including audio over
HDMI.
MythTV is crisp, clear and smooth, including motorsports (E.g. F1 on TenHD).

It may be worth starting a thread and comparing configurations.

cheers,
Owen.

[0] Almost. One remaining display driver bug.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] amaroK OSD issues

2009-01-06 Thread Owen Townend
2009/1/7 Ben :
> I don't know if it's just because I'm running Gnome with amarok, but
> the OSD has some serious issues.
>
> I run a dual monitor setup using nVidia binary drivers and twinview
> with compiz enabled.
>
> If I watch a video, on either screen, full screen or otherwise, then
> sometimes the video playback goes weird:
> 1. Imagine dividing video window into a grid at roughtly 20pixel increments.
> 2. Now number the blocks 1,2,3,4,1,2,3,4 etc.
> 3. Now picture a combination of blocks turning black, eg. all the 1s,
> or all the 1s,2s and 3s, or just the 2s and 4s, but only for a
> fraction of a second.
>
[snip]

Not a solution per se, but I believe that in the nvidia-settings app
you can force 'triple buffering' on which may alleviate the symptoms.

Triple buffering basically stores a copy of the frame between build
and display which helps stop partly complete frames from being
displayed. (e.g. If the display poll rate is faster than the rate at
which the system can render them)

Might help,
Cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Advice on upgrading.

2009-01-01 Thread Owen Townend
2009/1/2 david :
> adding memory usually helps and the only downside is the cost.
>
> Depends what you are doing, I guess. Photo rendering definitely likes lots
> of memory, but reading mail probably doesn't.
>

More on the cost issue:
The lshw output shows that both of the memory slots are taken so any
memory upgrade will have to take that into account.
Even so, upgrading the memory usually has the most noticable effect.
Especially before reaching the 2GB mark.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] How do I mount a RAID1 disk?

2008-12-02 Thread Owen Townend
2008/12/3 Michael Lake <[EMAIL PROTECTED]>:
> Hi all
>
> Owen can go home tonight knowing that it all is working fine for me and
> thanks for enabling me to get access to the data I needed.
>
> Owen Townend wrote:
>>  I know I put in the disclaimer that I hadn't checked the syntax, but
>> I still feel bad that I now realise that the initial command may have
>> tried to use /dev/sdc5 as the node for the resultant raid array.  This
>> may be the culprit for the missing superblock.  You are in a good
>> position though having both the original --examine data (if you wish
>> to recreate the superblock) and a second copy of the data (the other
>> disk from the mirror).
>
> No probs. I just rebooted the host machine I'm copying this stuff onto and
> when it came up again I did a "/sbin/mdadm --examine /dev/sdc5" and now it
> shows all the details for it like before.
> So I did your
>  # /sbin/mdadm --assemble /dev/md0 --run -u
>   b6035660:c11a8a2e:7026aea2:99d23bfc /dev/sdc5
> and then mounted it OK.
>
> So now I'm copying stuff off this partition fine.
> I have copied the stuff off partition 1 OK too.
>
[snip]

Great to hear it worked in the end!

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] How do I mount a RAID1 disk?

2008-12-02 Thread Owen Townend
2008/12/3 Michael Lake <[EMAIL PROTECTED]>:
> Owen Townend wrote:
>>
>> I pulled the /dev/md1 from the 'prefered minor' that was in the
>> examine output. You can use a different one without hassle.
>> The ordering for the command is:
>> Usage: mdadm --assemble md-device options-and-component-devices...
>
> So it assembles physical devices onto the virtual /dev/md0
>
>> The '--run' is because with a missing device it would usually only
>> assemble the array and leave it stopped which is the safest default.
>
> OK
>
>> Try
>> # /sbin/mdadm --assemble /dev/md0 --run -u
>> b6035660:c11a8a2e:7026aea2:99d23bfc /dev/sdc5
>
> No recognisable superblock on /dev/sdc5
> dev/sdc5 has wrong uuid
> No devices found for /dev/md0
>
> BUT! I tried it with sdc1 using it's uuid and it works!
> I message came up that /dev/md0 has been started with 1 drive out of 2
> Then mount /dev/md0 /mnt worked and I can see the files and directories.
>
> I can now see the old /etc/fstab and it tells me that it was a reiserfs
> system.
>
> What I don't follow is that now If I run:
>  /sbin/mdadm --examine /dev/sdc5
>
> "No md superblock detected on /dev/sdc5" where as before it said
> /dev/sdc5:
>  Magic : a92b4efc
>   etc
>
> I have some playing to do to work it out but am now much relived I can see
> data.
>
> Mike

Hey,

 I know I put in the disclaimer that I hadn't checked the syntax, but
I still feel bad that I now realise that the initial command may have
tried to use /dev/sdc5 as the node for the resultant raid array.  This
may be the culprit for the missing superblock.  You are in a good
position though having both the original --examine data (if you wish
to recreate the superblock) and a second copy of the data (the other
disk from the mirror).

Hope it works out ok...

cheers,
Owen.

N.B. Read the man pages, check the syntax, only then then run commands
as root on data you're trying to recover...
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] How do I mount a RAID1 disk?

2008-12-02 Thread Owen Townend
2008/12/3 Michael Lake <[EMAIL PROTECTED]>:
> Michael Lake wrote:
>>
>> (Also this new machine I'm trying to mount it on is a raid system using
>> mdraid
>
> Oops. I meant dmraid not mdraid
>
> This should not affect trying to mount the old raid disk - I hope.
>
> Mike

Hey,

dmraid I believe is the linux implementation of 'fakeraid' - the
onboard motherboard raid.
In my understanding this has none of the benefits of either software
_or_ hardware raid and many of the pitfalls.  With the buzz-word
'fakeraid' it should be trivial to find more info if you so desire.
dmraid and mdadm can co-exist quite happily, they should choose
non-conflicting /dev/ nodes and/or fail gracefully.
By placing /dev/md1 where you did in the mdadm command line you were
effectively listing it as a component device of the array you were
trying to start.  Not a problem, but not the desired result.  I'm not
sure why 'missing' didn't work, perhaps it is a 'create' mode only
option.

How'd you go?

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] How do I mount a RAID1 disk?

2008-12-02 Thread Owen Townend
2008/12/3 Michael Lake <[EMAIL PROTECTED]>:
> Hi Own and all
>
> Owen Townend wrote:
>>>
>>> # mdadm --assemble --run --uuid b6035660:c11a8a2e:7026aea2:99d23bfc
>>>  /dev/sdc5
>>> # mount /dev/md1 /mnt
>>>
>>> N.B.
>>> I haven't checked the syntax, you may need to add /dev/md1 to the
>>> mdadm line.. I don't have a box in front of me to check...
>>> The general idea should be right though..
>>
>> You can give 'missing' as a component device name along with /dev/sdc5
>> if mdadm gives a 'not enough devices' type error.
>
> Okies I worked out to give the uuid its -u or --uuid= so I'm using -u and
> the magic number from the --examine output.
>
> Here is what I tried.
> # /sbin/mdadm --assemble --run -u b6035660:c11a8a2e:7026aea2:99d23bfc
>/dev/sdc5 missing
> mdadm: cannot open device missing: No such file or directory
> mdadm: missing has wrong uuid.
> mdadm: no devices found for /dev/sdc5
>
> I then tried specifying the /dev/md1
>
> # /sbin/mdadm --assemble --run -u b6035660:c11a8a2e:7026aea2:99d23bfc
> /dev/md1
>/dev/sdc5 missing
> mdadm: no recogniseable superblock on /dev/sdc5
> mdadm: /dev/sdc5 has wrong uuid.
> mdadm: cannot open device missing: No such file or directory
> mdadm: missing has wrong uuid.
> mdadm: no devices found for /dev/md1
>
> In the above I added /dev/md1 for it to be assembled onto.
>
> By the way I do have a /dev/md1 existing already. But no /dev/md0
>
>
> (Also this new machine I'm trying to mount it on is a raid system using
> mdraid which I gather is different software for raid to mdadm. I think the
> older machine used mdadm and this new machine uses mdraid. It was setup by a
> previous sysadmin so I'm learning.)
>
> Mike

I pulled the /dev/md1 from the 'prefered minor' that was in the
examine output. You can use a different one without hassle.
The ordering for the command is:
Usage: mdadm --assemble md-device options-and-component-devices...

The '--run' is because with a missing device it would usually only
assemble the array and leave it stopped which is the safest default.

Try
# /sbin/mdadm --assemble /dev/md0 --run -u
b6035660:c11a8a2e:7026aea2:99d23bfc /dev/sdc5

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] How do I mount a RAID1 disk?

2008-12-02 Thread Owen Townend
2008/12/3 Owen Townend <[EMAIL PROTECTED]>:
> 2008/12/3 Michael Lake <[EMAIL PROTECTED]>:
>> Hi all
>>
>> I am trying to get data off someones old machine that died and place it onto
>> a new machine for them. The old machine had two Western Digital IDE drives
>> as RAID1. I have inserted one of the drives into a new machine in place of
>> the CDROM drive and connected it's IDE cable up and it shows up as /dev/sdc
>>
>> /dev/sdc
>> sdc1
>> sdc2
>> sdc3
>> sdc5
>>
>> Both of the drives show the same info above. By trying mount I can see that
>> partition 2 is the swap, 1 is probably a /boot and the data that I wish to
>> retrieve is on either or both of 3 or 5. See "Try to mount the Partitions"
>> below.
>>
>> I also used mdadm to get some detailed info on sdc5 (see below).
>>
>> My problem is that I can't work out how to mount sdc3 (have tried -t ext3,
>> -t reiserfs, -t auto) or sdc5. The latter is probably the one I want. I
>> gather the partition table says it 'mdraid' and I need to change that?
>>
> [snip]
>
> Hey,
>
> Try starting the raid array with a missing member and then mounting
> the resulting md device.
>
> # mdadm --assemble --run --uuid b6035660:c11a8a2e:7026aea2:99d23bfc  /dev/sdc5
> # mount /dev/md1 /mnt
>
> N.B.
> I haven't checked the syntax, you may need to add /dev/md1 to the
> mdadm line.. I don't have a box in front of me to check...
> The general idea should be right though..
>
> cheers,
> Owen.
>

You can give 'missing' as a component device name along with /dev/sdc5
if mdadm gives a 'not enough devices' type error.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] How do I mount a RAID1 disk?

2008-12-02 Thread Owen Townend
2008/12/3 Michael Lake <[EMAIL PROTECTED]>:
> Hi all
>
> I am trying to get data off someones old machine that died and place it onto
> a new machine for them. The old machine had two Western Digital IDE drives
> as RAID1. I have inserted one of the drives into a new machine in place of
> the CDROM drive and connected it's IDE cable up and it shows up as /dev/sdc
>
> /dev/sdc
> sdc1
> sdc2
> sdc3
> sdc5
>
> Both of the drives show the same info above. By trying mount I can see that
> partition 2 is the swap, 1 is probably a /boot and the data that I wish to
> retrieve is on either or both of 3 or 5. See "Try to mount the Partitions"
> below.
>
> I also used mdadm to get some detailed info on sdc5 (see below).
>
> My problem is that I can't work out how to mount sdc3 (have tried -t ext3,
> -t reiserfs, -t auto) or sdc5. The latter is probably the one I want. I
> gather the partition table says it 'mdraid' and I need to change that?
>
[snip]

Hey,

Try starting the raid array with a missing member and then mounting
the resulting md device.

# mdadm --assemble --run --uuid b6035660:c11a8a2e:7026aea2:99d23bfc  /dev/sdc5
# mount /dev/md1 /mnt

N.B.
I haven't checked the syntax, you may need to add /dev/md1 to the
mdadm line.. I don't have a box in front of me to check...
The general idea should be right though..

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] how to find if cpu is 32 or 64 bit

2008-12-02 Thread Owen Townend
2008/12/3 Dean Hamstead <[EMAIL PROTECTED]>:
> ahh you want to know if the cpu will do 64bit, even if the current OS is
>  32bit
>
> tricky
>
> Dean

Sorry, posted before I saw you realised it :)

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] how to find if cpu is 32 or 64 bit

2008-12-02 Thread Owen Townend
2008/12/3 Sonia Hamilton <[EMAIL PROTECTED]>:
> How do I find out if a cpu is 32 or 64 bit? (Notice: cpu, not kernel).
>
> Googling seems to suggest 'cat /proc/cpuinfo' and look for lm in the flags.
>
> Are there any other ways of doing this?
>
> Yes you can look at the model name, but this is only useful if you know from
> memory that model x is 32 bit and model y is 64 bit.
>
> Sonia.

Hey,
 Searching for the lm flag should be sufficient, but you can also check using
`lshw -class processor` and check the 'width' line for 32/64 bit
and/or find x86-64 in the 'capabilities'.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] X11 Forwarding over ssh

2008-11-16 Thread Owen Townend
2008/11/16 Kyle <[EMAIL PROTECTED]>:
> Peter,
>
> for some clarification please.
>
> Peter Chubb wrote:
>>
>> On Linux, BSD, Solaris, MacOSX or other Unices that are running X
>> locally, you do
>>
>> $ ssh -f -X host xterm &
>>
>> On the host you need to have
>> X11Forwarding yes
>> X11DisplayOffset 10
>>
>> in /etc/ssh/sshd_config
>
> ## So to be clear on this;
>
> The 2 X11 params above are set in sshd_confing on the host I wish to control
> ()?
>
> From a Linux box, I would issue your above command; and from an OSX host, I
> can use the X11.app (which is I believe and Xterm application). Correct?
>
>> And providing you have xauth and xterm installed on the remote host,
>> you should get a local terminal window, from which you can run
>> anything you want.
>>
> ## So these need to be installed on the ?
>
>
>> You *won't* be able to run the window manager there (is that what you
>> mean by `The gui' ???).  It runs on your local machine.
>>
>
> ## I can see the possibility for confusion here.
>
> To be clear;  My initial question has to do with running the  host>'s desktop much like a VNC or RDP session. Which host it physically
> runs on, I don't suppose I really mind too much. So long as I can have it
> all running through std. corporately-available ports.
>
>> You should however be able to run anything else.
>>
>> The way this works is that clients on the host talk to the SSH proxy
>> on that host which tunnels the protocol back to the display indicated by
>> the
>> DISPLAY variable in ssh's environment on yo
>
> ## But if I understand your post correctly, you're telling me how to connect
> to a host and then run X-based applications displaying on my controlling
> host, but which are actually running from the ?

Hey,

Why not just use VNC over ssh?

Crash course:
Setup the vnc server on the linux box (system->preferences->remote
desktop on Ubuntu)
Then in the putty options add a port forward from an available port
(e.g. '12345') to 'localhost:5900'.
On your windows VNC client you then connect to 'localhost:12345' and
it should connect to the remote VNC server.

VNC might not be secure or run on the desired (corporate friendly)
port, but forwarding it over ssh can help solve both of those
issues...

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] ssh certificate logins

2008-10-12 Thread Owen Townend
2008/10/12 Del <[EMAIL PROTECTED]>:
> Mary Gardiner wrote:
>
>> There is one potential disadvantage of non-standard ports: there are a
>> few networks with a default-deny outgoing connection policy who open
>> port 22, but do not open most ports. (I find 443 the most useful
>> alternative port to run SSH on, outgoing to 443/HTTPS is very often
>> open!)
>
> OK, raise their hand everyone here who runs an SSH server somewhere out on
> the net on port 443 for the deliberate purpose of tunneling through a
> work-related proxy server / firewall combination to do non-proxy-allowed
> stuff.
>
> (/me sheepishly raises hand)
>
> (/me points at *everyone* at a certain large organisation that will remain
> nameless)
>
> :)
>
> Del

/me raises hand
Though only since contracting at said large organisation[1]... there
are other ways at uni.

cheers,
Owen.

Footnotes:
--
[1] Assuming we're thinking of the same one... otherwise... it's the same idea.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] ssh certificate logins

2008-10-11 Thread Owen Townend
2008/10/12 Daniel Pittman <[EMAIL PROTECTED]>:
[snip]
> To me, this is like airport security: I am all in favour of securing air
> travel.  I am not in favour of doing things that make people *feel*
> secure without actually doing a damn thing.
>
> Regards,
>Daniel

Hey,

Just to quickly weigh in on this...
Port knocking, as long as it is not the entire security strategy could
be a relevent addition here.
The problem as stated by the OP is 'idiots from eastern Europe and
Russia tring to crack my server'.

The layer of obscurity that port knocking adds could be considered
akin to changing the port number and even that small change often
drops the number of attempts to zero (judging by the many reports and
responses on other lists and forums).  If someone is actually trying
to break _your_ server then it won't help much, as you said, but if
the intent is to break _a_ server then it may be sufficient to make
them move on. In this regard a really simple sequence is just as
effective as anything more complex.

The vaunted airport 'security theatre' efforts are similar here in
that they help prevent casual or impulsive incidents but (arguably)
don't do much for any true, concerted efforts.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] ssh certificate logins

2008-10-09 Thread Owen Townend
2008/10/9 Phill O'Flynn <[EMAIL PROTECTED]>:
>
>
> Hi everyone
> I am running a fedora server and currently using hosts.allow to
> only allow ssh accesses from specific ip addresses. I did this because I was 
> getting
> a lot of idiots from eastern Europe and Russia tring to crack my server.
>
> This has been ok  but now is prooving to be too restrictive. Can I get the
> server to force certificate based logins only?? If so how do I do it?? Is 
> this the
> best approach anyway??

In debian based systems it's done by editing /etc/ssh/sshd_config to
disable password auth
I imagine that Fedora would be very similar... see:
http://www.debuntu.org/ssh-key-based-authentication-p3

There was a good thread arguing ssh protection measures a few months
back on debian-security:
http://www.nabble.com/What-to-do-about-SSH-brute-force-attempts--tt19090071.html#a19090071

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] mountinig a USB flash drive

2008-09-22 Thread Owen Townend
2008/9/22 R.G.Salisbury <[EMAIL PROTECTED]>:
>
>
> Brief howto .
>
> to enable sudo for a non priveleged user
>
> you will need to
>
> 1/   edit /etc/sudoers  (you need root passwd to do so)
>
> 2/
>   you will need to boot in safe mode (runlevel 1) from grub  & create a root
> password as below:
>
> #passwd
>
> 3/ add a line to /etc/sudoers   ( run visudo) as below:
> your_username ALL=(ALL) ALL
>
> 4/ reboot &
> prepend sudo to all priveleged system commands.
>
> You may need this explained in more detail ( as very brief).
>
> Cheers
> Roger

Hey,

Ubuntu by default has '%admin ALL=(ALL) ALL' in sudoers so if you're
not already in the admin group then simply running `adduser 
admin` from the safemode described above would fix that.
Though, during installation the first user created should be added to
the admin group and given privileges for devices by default.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] mountinig a USB flash drive

2008-09-22 Thread Owen Townend
2008/9/22 Chris Allen <[EMAIL PROTECTED]>:
> A friend at work has installed Ubuntu (hardy heron) on an Asus EEE pc.  When
> he plugs in a in a USB flash drive, he gets an error message explaining that
> he need SU rights to do this.  this surprises me because I have no trouble
> on  my machine.
>
> I said he should see what happens if he logs in as "root".  He knows nothing
> about "root" and certainly does not know root's password.  I said he should
> remember being prompted for this in the install. "no".
>
> In the install, he created a login only for himself (which works) except
> that he cannot use his USB flash drive.
>
> The system is clearly trying to mount the drive when it is plugged in.  It
> just thinks the that access rights do not allow it.
>
> Any suggestions? (remember that he does not know root's password)

By default Ubuntu does not prompt for nor set the root password and
instead uses `sudo`.
If you find a need to use `su` you can either set the password using
`sudo passwd` or use `sudo -i`.

While there is the brute force solution above, it sounds like there is
a separate issue, because as you said, it usually just works.  One
possible issue may be his account privileges.  While the sole account
that Ubuntu creates _should_ be an administrator, it might be worth
checking it. Go to:
 System->Administration->Users and
Groups->(username)->Properties->User Privileges
Make sure that 'Access external storage devies automatically' is ticked.
To change these options you need to click 'Unlock' and enter the
user's password (uses gksudo).  IIRC in the older versions (pre Hardy)
you are prompted before the User settings app will open.

Hope this helps,
cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Putting the panel at the side.

2008-08-28 Thread Owen Townend
2008/8/29  <[EMAIL PROTECTED]>:
> I received the latest updates to Hardy Heron.
>
> Can anyone tell me, please, why Hardy now insists on putting the
> applications panel to the right side of the monitor? I went searching for
> instructions on how to place it back at the top, but even these have
> disappeared.
>
> Bill Bennett.
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>

Hey,
 Upgrading to Hardy left my application bar at the top where I put it.
 You should be able to simply click and drag to move it back to the
top.

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Gnome application menus

2008-08-28 Thread Owen Townend
2008/8/29 david <[EMAIL PROTECTED]>:
> can anyone tell me where the application menus are in gnome (Feisty)?
>
> I want to look through an old system hard drive which is not the current
> boot disk and figure out which programs I was using, but I can't find
> the menus.
>
> thanks...
>
>
>
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>

Hey,
 Have a look in `/etc/xdg/menus` and `~/.config/menus`. These are the
default locations for the menu definition files.
 If you're after a list of _everything_ that was installed then
another way to find out would be to chroot to the disk and run
something like `dpkg --get-selections | grep -v deinstall >
/tmp/aptlist.out`

cheers,
Owen.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html