Re: [GTALUG] Hardcore sed foo

2019-11-04 Thread William Park via talk
0 or 1 match is ?Eg.  echo /aaa/.bbb//ccc/123 | sed 
's,\(/\.\?[^/]\)[^/]*,\1,g'--William
Sent from Yahoo Mail on Android 
 
  On Mon, Nov 4, 2019 at 8:24 PM, Giles Orr via talk wrote:   
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
  
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


[GTALUG] TekSavvy or Rogers blocking apt user agent

2019-11-04 Thread Jamon Camisso via talk
On 04/11/2019 21:24, D. Hugh Redelmeier via talk wrote:
> Is this happening to you?  I will assume so.
> 
> - my main internet connection is directly through Rogers.
> 
> - I use Ubuntu infrequently.
> 
> - when I do update it, I have had no issue.  Most recently: a couple
>   of days ago.
> 
> The ip address in the wireshark log is 91.189.91.23 (AKA
> economy.canonical.com).  When I point (Fedora) firefox at it, it claims
> that it cannot connect to a web server there.  Of course that's with
> Firefox's User Agent String.  ping does get responses.

Teksavvy have done something on their end:

https://twitter.com/TekSavvyCSR/status/1191486635764068355
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] TekSavvy or Rogers blocking apt user agent

2019-11-04 Thread D. Hugh Redelmeier via talk
| From: Jamon Camisso via talk 

| Well this is a new low:
| 
| 
https://askubuntu.com/questions/1185612/apt-get-stuck-on-waiting-for-headers/1185713
| 
| Mind-boggling that it is/was even an issue at an ISP & HTTP level.
| 
| Either they have a giant whitelist of browser agents to maintain, or a
| blacklist to update and added apt to it.
| 
| In either case, they're looking at HTTP traffic and acting on it directly.
| 
| Still an issue for anyone?

Is this happening to you?  I will assume so.

- my main internet connection is directly through Rogers.

- I use Ubuntu infrequently.

- when I do update it, I have had no issue.  Most recently: a couple
  of days ago.

The ip address in the wireshark log is 91.189.91.23 (AKA
economy.canonical.com).  When I point (Fedora) firefox at it, it claims
that it cannot connect to a web server there.  Of course that's with
Firefox's User Agent String.  ping does get responses.

Could it be that you are somehow trying to use a mirror that has been
decommissioned?

I think that this problem is likely unintended and would be fixed if

1) the problem would be with your ISP
2) it were reported and
3) teksavvy could reproduce it.
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Hardcore sed foo

2019-11-04 Thread Giles Orr via talk
On Mon, 4 Nov 2019 at 18:36, William Witteman  wrote:

> No sed knowledge here, but what if you turn it around, and grab two
> characters and conditionally truncate, rather than the other way around?
>
> My only useful programming advice is when you get stuck, turn your problem
> around.
>
> On Mon., Nov. 4, 2019, 18:31 Giles Orr via talk,  wrote:
>
>> I've tinkered with Bash prompts for a lot of years.  That's where this
>> problem originates, but it can be considered just as a thought experiment
>> if you prefer.
>>
>> We have the directory we're in, for example:
>>
>> /Users/gorr/.bashprompt/really/deep/directory/structure/even/deeper
>>
>> (I keep my prompts in ~/.bashprompt/ , and a very long directory name is
>> often a cause of breakage, so I keep one around to break them ...)
>>
>> I want to shorten the directory name to just the first letters:
>>
>> export newPWD=$(echo ${PWD} | sed -e "s@${HOME}@~@" -e 's@
>> \(/.\)[^/]*@\1@g')
>> echo $newPWD
>> ~/./r/d/d/s/e/d
>>
>> This does '~' replacement for $HOME and then substitutes the first letter
>> of each directory for the full directory name.
>>
>> Here's the question: if the first letter of the directory name is a dot
>> '.', can sed then capture one character more so that the output would
>> become:
>>
>> ~/.b/r/d/d/s/e/d
>>
>> I think this would be pretty easy with Bash and a loop, but that's a lot
>> of processing so I'd rather not go down that road.  I suspect sed is
>> capable of this, but I haven't delved deeply enough into the tool to even
>> know where to start.  This may in fact be a regex problem more than a sed
>> problem - either way I'm kind of stumped.  I'm open to simpler
>> implementations using other (standard system) tools as well.
>>
>
All that was needed was a walk home to think and solve it:

 export newPWD=$(echo ${PWD} | sed -e "s@${HOME}@~@" -e 's@
\(/[.].\|/.\)[^/]*@\1@g') ; echo $newPWD
~/.b/r/d/d/s/e/d

It's a regex problem: capture a group that's a slash, a dot, and a
character, OR a slash and a character.

-- 
Giles
https://www.gilesorr.com/
giles...@gmail.com
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Hardcore sed foo

2019-11-04 Thread William Witteman via talk
No sed knowledge here, but what if you turn it around, and grab two
characters and conditionally truncate, rather than the other way around?

My only useful programming advice is when you get stuck, turn your problem
around.

On Mon., Nov. 4, 2019, 18:31 Giles Orr via talk,  wrote:

> I've tinkered with Bash prompts for a lot of years.  That's where this
> problem originates, but it can be considered just as a thought experiment
> if you prefer.
>
> We have the directory we're in, for example:
>
> /Users/gorr/.bashprompt/really/deep/directory/structure/even/deeper
>
> (I keep my prompts in ~/.bashprompt/ , and a very long directory name is
> often a cause of breakage, so I keep one around to break them ...)
>
> I want to shorten the directory name to just the first letters:
>
> export newPWD=$(echo ${PWD} | sed -e "s@${HOME}@~@" -e 's@
> \(/.\)[^/]*@\1@g')
> echo $newPWD
> ~/./r/d/d/s/e/d
>
> This does '~' replacement for $HOME and then substitutes the first letter
> of each directory for the full directory name.
>
> Here's the question: if the first letter of the directory name is a dot
> '.', can sed then capture one character more so that the output would
> become:
>
> ~/.b/r/d/d/s/e/d
>
> I think this would be pretty easy with Bash and a loop, but that's a lot
> of processing so I'd rather not go down that road.  I suspect sed is
> capable of this, but I haven't delved deeply enough into the tool to even
> know where to start.  This may in fact be a regex problem more than a sed
> problem - either way I'm kind of stumped.  I'm open to simpler
> implementations using other (standard system) tools as well.
>
> --
> Giles
> https://www.gilesorr.com/
> giles...@gmail.com
> ---
> Post to this mailing list talk@gtalug.org
> Unsubscribe from this mailing list
> https://gtalug.org/mailman/listinfo/talk
>
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


[GTALUG] Hardcore sed foo

2019-11-04 Thread Giles Orr via talk
I've tinkered with Bash prompts for a lot of years.  That's where this
problem originates, but it can be considered just as a thought experiment
if you prefer.

We have the directory we're in, for example:

/Users/gorr/.bashprompt/really/deep/directory/structure/even/deeper

(I keep my prompts in ~/.bashprompt/ , and a very long directory name is
often a cause of breakage, so I keep one around to break them ...)

I want to shorten the directory name to just the first letters:

export newPWD=$(echo ${PWD} | sed -e "s@${HOME}@~@" -e 's@
\(/.\)[^/]*@\1@g')
echo $newPWD
~/./r/d/d/s/e/d

This does '~' replacement for $HOME and then substitutes the first letter
of each directory for the full directory name.

Here's the question: if the first letter of the directory name is a dot
'.', can sed then capture one character more so that the output would
become:

~/.b/r/d/d/s/e/d

I think this would be pretty easy with Bash and a loop, but that's a lot of
processing so I'd rather not go down that road.  I suspect sed is capable
of this, but I haven't delved deeply enough into the tool to even know
where to start.  This may in fact be a regex problem more than a sed
problem - either way I'm kind of stumped.  I'm open to simpler
implementations using other (standard system) tools as well.

-- 
Giles
https://www.gilesorr.com/
giles...@gmail.com
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] TekSavvy or Rogers blocking apt user agent

2019-11-04 Thread James Knott via talk

What does Wireshark show?  That article shows "Connection reset by peer".

On 2019-11-04 04:13 PM, Jamon Camisso via talk wrote:

Well this is a new low:

https://askubuntu.com/questions/1185612/apt-get-stuck-on-waiting-for-headers/1185713

Mind-boggling that it is/was even an issue at an ISP & HTTP level.

Either they have a giant whitelist of browser agents to maintain, or a
blacklist to update and added apt to it.

In either case, they're looking at HTTP traffic and acting on it directly.

Still an issue for anyone?

Jamon
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Problem with /dev/ttyUSB* serial port

2019-11-04 Thread Russell Reiter via talk
On Thu, Oct 31, 2019, 1:07 PM Jim Ruxton via talk,  wrote:

>
>
> Is your user a member of the dialout group? You can't access serial ports
> unless you are.
>
> Yes I am a member of dialout and I have no problem when my device uses
> /dev/ttyUSB0 .
>
>
> Also, 'baudrate=57142' looks a bit odd. 57600 is more standard, but I've
> seen that number used for a couple of motor controllers.
>
> Yes this is a Dynamixel motor controller , they seem to prefer this baud
> rate.
>
>
> Is there a way you can try it without the USB extender?
>
> I can try this later when I have access to it again but I will need to run
> it eventually with the extension.
>
>
> Are you using more than one usb serial device? If you are and they are
> both Prolific devices, there is no way of telling them apart by any device
> path. They will swap freely at enumeration. Unlike FTDI adapters, Prolific
> have no serial numbers. I try to avoid having two PL2303s on the same
> machine, preferring a mix of FTDI, Qinheng and SiLabs.
>
> My problem occurs when I am only using the one adapter. It is an FTDI
> device.
>
>
> If a /dev/ttyUSB0 path works then the /dev/serial/* equivalent must work:
> they're symlinks to the same device. The only time I've seen it not work
> was in software that hard-coded the device path to be 12 bytes.
>
> Yes the /dev/serial equivalent works as long as it's the equivalent of
> /dev/ttyUSB0 .
>
> To communicate with the motor I'm using the pyax12 communication library
> https://github.com/jeremiedecock/pyax12/blob/master/pyax12/connection.py
>
> Thanks,
>
Persistant connections are usually managed by udisk for block devices and
udev for usb. It looks to me like you need to use udevadm to retrieve the
serial attributes of the device as well as a vendor id and put a rule in
/etc/udev/rules.d

udevadm info -a -n /dev/ttyUSB0 | grep '{serial}' | head -n1

I pulled that command from this primer from another stepper motor setup
config, looks like they are an observatory.

https://indilib.org/support/tutorials/157-persistent-serial-port-mapping.html

I seem to recall from older serial modem usb modeswitching the connection
required a serial message info type to be sent in order to handshake on
connection. I cant be sure thats the case here but perhaps the examples of
the rules which are used to create and define the symlink node on the above
observatorys rules for persistant links can help.

If that does help, one of the features of udev is that udevadm info
--attribute-walk will list all the parent connections and you can use the
actual device id and one parent id to uniquely identify and bind your
adapter in the chain, when it comes to that.

Jim
>
Russell

>
>>
>>
> ---
> Post to this mailing list talk@gtalug.org
> Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk
>
> ---
> Post to this mailing list talk@gtalug.org
> Unsubscribe from this mailing list
> https://gtalug.org/mailman/listinfo/talk
>
---
Post to this mailing list talk@gtalug.org
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk