[INFO & SCRIPT] Slackware Mirror Settings for USM

Post tutorials, HOWTO's and other useful resources here.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#46 by Ed_P » 04 Jul 2017, 00:33

Bogomips wrote:No idea how to make a gui,
:shock: Have you looked at the script shown here: http://forum.porteus.org/viewtopic.php? ... 233#p49231 ? It uses a gui.

Bogomips wrote:Very Final Enhancement: Script to Set Alternative Fast Mirror
I like the sound of this one. :)

And

Code: Select all

guest@porteus:~$ cd USM
guest@porteus:~/USM$     sed "s/\s*kpv\s*().*/masm \$*/;T;q"  safm.sh > masm.sh
guest@porteus:~/USM$ cat masm.sh
#!/bin/bash
# http://forum.porteus.org/viewtopic.php?f=39&t=7000&p=56042#p56042
# safm.sh   Set Alternative Fast Mirror for Repository by Bogomips  2017-07-02 19:29:46
# Last Update:  2017-07-03 21:26:32  
# Internal Reference:   usm/safm_030717.sh
# masm.sh   Manually set Slackware Mirror by Bogomips
# Last Update:  2017-06-19 23:44:55     Include 'sbo' as Repository
masm ()
 :
 :
not sure what the command means but it appears to work. :good:
Ed

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#47 by francois » 04 Jul 2017, 03:42

I understand that you overtly proposed jssouza competencies and know how to complete bogomips ingeniosity. :)
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#48 by Ed_P » 04 Jul 2017, 05:38

francois wrote:I understand that you overtly proposed jssouza competencies
No, just as an example of a gui code posted here not too long ago that he might be able to tweak like he has the others. :)
and know how to complete bogomips ingeniosity.
Not even close!! :lol:
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#49 by Bogomips » 05 Jul 2017, 00:20

Ed_P wrote:
Bogomips wrote:No idea how to make a gui,
:shock: Have you looked at the script shown here: http://forum.porteus.org/viewtopic.php? ... 233#p49231 ? It uses a gui.
That's just about my lot. Now have other fish to fry. ;)

Minor enhancement in safm.sh to show Current Mirror prior to displaying Alternatives: http://forum.porteus.org/viewtopic.php? ... 6fa#p55999
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#50 by Ed_P » 05 Jul 2017, 14:32

:(

Code: Select all

guest@porteus:~$ ./USM/masm.sh slackonly
bash: ./USM/masm.sh: /bin/bash^M: bad interpreter: No such file or directory
guest@porteus:~$ bash ./USM/masm.sh slackonly
./USM/masm.sh: line 9: syntax error near unexpected token `$'\r''
'/USM/masm.sh: line 9: `masm ()
guest@porteus:~$ cat ./USM/masm.sh
#!/bin/bash
# http://forum.porteus.org/viewtopic.php?f=39&t=7000&p=56042#p56042
# safm.sh   Set Alternative Fast Mirror for Repository by Bogomips  2017-07-02 19:29:46
# Last Update:  2017-07-03 21:26:32  
# Internal Reference:   usm/safm_040717.sh
# masm.sh   Manually set Slackware Mirror by Bogomips
# Last Update:  2017-07-04 13:07:16     Display Current Mirror followed by Heading
# 2017-06-19 23:44:55     Include 'sbo' as Repository
masm ()
{
if [[ ! $2 ]]; then 
echo -e "Argument usage:\t\t<Repository>\t\t<Mirror URL>";
return 0;
fi
# Check the Protocol
safm2masm.sh

Code: Select all

#!/bin/bash
#http://forum.porteus.org/viewtopic.php?f=39&t=7000&p=55999#p55999

#Script safm.sh makes use of masm, the script to Manually Set a Mirror for a Repository. Consequently masm.sh can be cut out from safm.sh:

cd USM
sed "s/\s*kpv\s*().*/masm \$*/;T;q"  safm.sh > masm.sh    

-edit-

To be clear, ./USM/safm.sh is created and updated using Firefox ESR 52. 2.1 (64bit) and Mousepad on a Porteus Cinnamon 3.2.2 (64bit) system. No Windows system used.
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#51 by Bogomips » 06 Jul 2017, 12:35

^ Looking at the 2nd code segment, the sed is copying lines from safm.sh to masm.sh, has not yet done the substitution, so must have reached end of data. This would imply that it has copied the whole of safm.sh, and in turn this would imply that the copy of safm.sh is incomplete. as the last line should be 'safm $*'.
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#52 by Ed_P » 06 Jul 2017, 13:22

My safm.sh

Code: Select all

 :
 :
do
    select  v in "${say[@]}"; 
    do 
        [[ $v ]] || continue; unset say[$REPLY-1]; say=("${say[@]}");   # Shrink Array  
        masm $1 ${v% *} || return $?; break; 
    done
    kpv "Another Alternative" || break;
done
((${#say[*]})) || echo -n "Choices Exhausted! ";
echo Terminating.
}
safm $*
My masm.sh code

Code: Select all

#!/bin/bash
# http://forum.porteus.org/viewtopic.php?f=39&t=7000&p=56042#p56042
# safm.sh   Set Alternative Fast Mirror for Repository by Bogomips  2017-07-02 19:29:46
# Last Update:  2017-07-03 21:26:32  
# Internal Reference:   usm/safm_030717.sh
# masm.sh   Manually set Slackware Mirror by Bogomips
# Last Update:  2017-06-19 23:44:55     Include 'sbo' as Repository
masm ()
{
if [[ ! $2 ]]; then 
echo -e "Argument usage:\t\t<Repository>\t\t<Mirror URL>";
return 0;
fi
# Check the Protocol
[[ $2 =~ ^(http|ftp):// ]] || { echo URL Error: Neither http nor ftp.; return 1; }
# Check the Repository
eval $(grep DISTROS= /etc/usm/usm.conf);        # Get distros list from usm.conf
[[ $DISTROS ]] || { echo Error\! File usm.conf corrupted; return 1; }
DISTROS+=" sbo";                                # 2017-06-19 23:44:55
[[ $DISTROS =~ ([[:space:]]|^)$1([[:space:]]|$) ]] || { echo Error\! Repository not found.; return 2; }
# Match the URL
m=$(grep -c "\s*#\?\s*$2" /etc/usm/mirrors-$1.txt);     # of Matches
! ((m)) && { echo \Error! No matching Mirror found.; return 3; }
url=$2;
# Exact Matches? Also check if Single Match is an Exact Match   2017-06-16 01:00:01
# Provide for Missing Trailing Slash        2017-06-17 15:50:45
n=$(grep -c "\s*#\?\s*$2\s*$" /etc/usm/mirrors-$1.txt); # More Exactly Stipulated   2017-06-16 16:57:49
# Two Part test caters for exact match not having trailing /.   #  2017-06-18 14:57:55
! ((n)) &&  n=$(grep -c "\s*#\?\s*${2%\/}\/\s*$" /etc/usm/mirrors-$1.txt); # More Exactly # No Exact Match
if ! ((n)); then    w=$(grep "\s*#\?\s*$2" /etc/usm/mirrors-$1.txt | sed s/^\s*#*\s*//)
    echo Partial Match found. Select a Mirror or Enter 0 to quit.; select p in $w; do break; done
    [[ $p ]] || return 4;
    url=$p;     # URL confirmed to exactly match.
fi
# If more than one Exact Match, first one will be used.
# Block All Mirrors
sudo sed -i -E 's/^\s*(http|ftp)/# &/' /etc/usm/mirrors-$1.txt    # 2017-06-09 01:10:11
# Unblock Selected  Just Once
sudo sed -i "0,\%^\s*#\s*$url%s??$url?" /etc/usm/mirrors-$1.txt
echo Done!; echo $1 mirror set to: $(grep -E "^\s*(http|ftp)" /etc/usm/mirrors-$1.txt);             # Providing more accurate information  2017-06-17 15:46:39
}
masm $*
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#53 by Bogomips » 06 Jul 2017, 22:10

^ This is what you should get:

Code: Select all

guest@porteus:~$ sed "s/\s*kpv\s*().*/masm \$*/;T;q"  safm.sh > masm.sh
guest@porteus:~$ sh  masm.sh  slacky  http://slack.isper.sk/pub
Done!
slacky mirror set to: http://slack.isper.sk/pub
           
Quoted your message, copied the msam.sh text from code block, and pasted into terminal:
  • Got something suspicious at end about an event not being found:

    Code: Select all

    > # Unblock Selected  Just Once
    > sudo sed -i "0,\%^\s*#\s*$url%s??$url?" /etc/usm/mirrors-$1.txt
    > echo Done!; echo $1 mirror set to: $(grep -E "^\s*(http|ftp)" /etc/usm/mirrors-$1.txt);             # Providing more accurate information  2017-06-17 15:46:39
    bash: !: event not found
    > }
    guest@porteus:~$ masm $*
    Argument usage:         <Repository>            <Mirror URL>
    
  • Invocation of masm gives no output, and check of repo mirror shows mirror with strange character at end

    Code: Select all

    guest@porteus:~$ masm slacky http://slack.isper.sk/pub
    guest@porteus:~$ source crm.sh slacky
    SLACKY
    Mirror: http://slack.isper.sk/pub
    \2 Commented Out
    
  • After being properly set, mirror looks like his:

    Code: Select all

    guest@porteus:~$ source  crm.sh slacky
    SLACKY
    Mirror: http://slack.isper.sk/pub
    2 Commented Out
    
Looks like we are going round in circles: http://forum.porteus.org/viewtopic.php? ... =15#p56120 Please bear in mind that your windoze file has to be made unix compatible before processing by a unix text processing utility., http://forum.porteus.org/viewtopic.php? ... =15#p56140

So, get rid of all that windoze impurity firstly, before entering pristine environment of unix: :twisted:

Code: Select all

tr -d '\15\32' < USM/safm.sh | sed "s/\s*kpv\s*().*/masm \$*/;T;q" > masm.sh
also have to do same with safm.sh:

Code: Select all

cd USM; cp safm.sh safm.wdz
tr -d '\15\32' < safm.wdz > safm.sh
BTW Ran script to set fastest slacware mirrors (aka sesm.sh), with geographic and 20 worst slackware mirrors on top of 30 from before excluded, also 3 salix worst mirrors excluded, and got timing of under 1 min:

Code: Select all

guest@porteus:~$ time source  sesm.sh all http://slack.isper.sk/pub

Exclusion URL Specified on Command Line:
http://slack.isper.sk/pub

All Exclusion URLs:
Cmd Line URLs=1         File (.usm/badmirrors.txt) URLs=87      Merged(Unique) URLs=88

SLACKWARE
Testing ftp://elektroni.phys.tut.fi/ 1.138931
Mirrors=152             Processed=38            Remaining=114
Testing http://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/ 0.168943
Mirrors=152             Processed=63            Remaining=89
Testing ftp://sunsite.icm.edu.pl/vol/rzm1/linux-slackware/ 0.548795
Mirrors=152             Processed=88            Remaining=64
Testing http://mirrors.easynews.com/linux/slackware/ 0.607301
Mirrors=152             Processed=135           Remaining=17
Done!
slackware mirror set to: http://mirror.ovh.net/mirrors/ftp.slackware.com/

SLACKWAREPATCHES
Done!
slackwarepatches mirror set to: http://mirror.ovh.net/mirrors/ftp.slackware.com/

SLACKY
Done!
slacky mirror set to: http://repository.slacky.eu/

SALIX
Testing ftp://ftp.mirrorservice.org/sites/download.salixos.org 0.592528
Mirrors=28              Processed=9             Remaining=19
Testing ftp://ftp.nluug.nl/pub/os/Linux/distr/salix 0.596608
Mirrors=28              Processed=19            Remaining=9
Testing http://mirrors.xmission.com/salix 0.357440
Mirrors=28              Processed=26            Remaining=2
Done!
salix mirror set to: http://ftp.nluug.nl/os/Linux/distr/salix

ALIEN
Done!
alien mirror set to: http://bear.alienbase.nl/mirrors/people/alien/sbrepos

PONCE
Done!
ponce mirror set to: http://ponce.cc/slackware

SLACKONLY
Done!
slackonly mirror set to: http://packages.slackonly.com/pub/packages

SBO
Done!
sbo mirror set to: http://slackbuilds.org/slackbuilds

real    0m52.209s
user    0m1.935s
sys     0m1.349s
:Yahoo!:
Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#54 by Ed_P » 06 Jul 2017, 22:52

Bogomips wrote:Looks like we are going round in circles: http://forum.porteus.org/viewtopic.php? ... =15#p56120 Please bear in mind that your windoze file has to be made unix compatible before processing by a unix text processing utility., http://forum.porteus.org/viewtopic.php? ... =15#p56140
So it seems. I give up.
Ed_P wrote:To be clear, ./USM/safm.sh is created and updated using Firefox ESR 52. 2.1 (64bit) and Mousepad on a Porteus Cinnamon 3.2.2 (64bit) system. No Windows system used.
Ed

Bogomips
Full of knowledge
Full of knowledge
Posts: 2564
Joined: 25 Jun 2014, 15:21
Distribution: 3.2.2 Cinnamon & KDE5
Location: London

Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

Post#55 by Bogomips » 07 Jul 2017, 16:17

Ed_P wrote:To be clear, ./USM/safm.sh is created and updated using Firefox ESR 52. 2.1 (64bit) and Mousepad on a Porteus Cinnamon 3.2.2 (64bit) system. No Windows system used.
Okay, then. Let's get to the bottom of this, and doing it with mirrors should make it foolprrof. :twisted:

Code: Select all

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
  1. Quote this post and copy above code block to clipboard. Do Preview to see remaining steps.
    • Decode to binary file
      • Enter in terminal

        Code: Select all

        guest@porteus:~$ base64 -d > safm.xz
        
      • At the input prompt paste from clipboard:

        Code: Select all

        /Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4BDWBxRdABGIQkY99Bhqpmevep/hkeUyGDB63KA6oNDB
        ...
        Nsu6HtsjIt4ygaGjDcZzsQrr6AC0/cCXXYYk1QABsA7XIQAAPtSj5LHEZ/sCAAAAAARZWg==
        ^D
        
        Enter Ctl+D for End of Data, as shown above. ^C will also work. i.e. immediately after pasting, enter ^D.
    • Code: Select all

      guest@porteus:~$ ls -lh safm.xz
      -rw-r--r-- 1 guest users 1.9K Jul  7 13:36 safm.xz
      guest@porteus:~$ md5sum safm.xz
      ea0a7483efcb8039ae9d91c65b6ad918  safm.xz
      
    • Now an old xz issue rears its head:

      Code: Select all

      guest@porteus:~$ xz -d < safm.xz > safm.sh
      guest@porteus:~$ ls -lh safm,*
      /bin/ls: cannot access 'safm,*': No such file or directory
      
    • So continuing in another terminal tab:

      Code: Select all

      guest@porteus:~$ ls -lh safm.xz
      -rw-r--r-- 1 guest users 1.9K Jul  7 13:36 safm.xz
      guest@porteus:~$ ls -lh safm.sh
      -rw-r--r-- 1 guest users 4.3K Jul  7 13:49 safm.sh
      guest@porteus:~$ md5sum safm.sh
      91201d440b41099abdeba87aff4238f0  safm.sh
      guest@porteus:~$ diff safm.sh $g/safm.sh
      
    • Note the diff above had $g from my system, so on yours I'm guessing g=USM. Cut Out of masm.sh:

      Code: Select all

      guest@porteus:~$ sed "s/\s*kpv\s*().*/masm \$*/;T;q"  safm.sh > masm.sh
      guest@porteus:~$ ls -lh masm.sh
      -rw-r--r-- 1 guest users 2.2K Jul  7 18:11 masm.sh
      guest@porteus:~$ md5sum masm.sh
      2c61b88200194ccab50d07b6d9f157b9  masm.sh
      guest@porteus:~$ sh masm.sh slacky http://slack.isper.sk/pub
      Done!
      slacky mirror set to: http://slack.isper.sk/pub
      
    • Finally try setting another mirror:

      Code: Select all

      guest@porteus:~$ bash safm.sh slacky
      
      Current Mirror: http://slack.isper.sk/pub
      Alternative Mirrors
      1) http://repository.slacky.eu/ 0.142210
      2) http://slackware.org.uk/slacky 0.186717
      #? 1
      Done!
      slacky mirror set to: http://repository.slacky.eu/
      Another Alternative? [Y/n]
      Terminating.
      
    Now surely it will all be Hunky Dory! :%)


    Edit Sat Jul 8 15:05:42 UTC 2017

    Set fastest slackware mirrors using almost exclusively file with URLs to exclude. Some 30 odd mirrors excluded on Geographical basis, then 30 of worst slackware mirrors, followed by 20 of warst after that. Also on same basis excluded three salix mirrors thrice i.e. lot of 3 after lot of 3 after lot of 3. Resultant time of under 40 seconds:

    Code: Select all

    bash  sesm.sh  all http://slack.isper.sk/pub
    
    Exclusion URL Specified on Command Line:
    http://slack.isper.sk/pub
    
    All Exclusion URLs:
    Cmd Line URLs=1         File (.usm/badmirrors.txt) URLs=93      Merged(Unique) URLs=94
    
    SLACKWARE
    Testing http://mirror.ovh.net/mirrors/ftp.slackware.com/ 0.091285
    Mirrors=152             Processed=40            Remaining=112
    Testing http://mirror2.mirror.garr.it/pub/1/slackware/ 0.167928
    Mirrors=152             Processed=65            Remaining=87
    Testing ftp://z-ftp.wcss.wroc.pl/pub/linux/slackware/ 0.797724
    Mirrors=152             Processed=90            Remaining=62
    Testing http://mirrors.us.kernel.org/slackware/ 0.395426
    Mirrors=152             Processed=138           Remaining=14
    Done!
    slackware mirror set to: http://ftp.nluug.nl/os/Linux/distr/slackware/
    
    SLACKWAREPATCHES
    Done!
    slackwarepatches mirror set to: http://ftp.nluug.nl/os/Linux/distr/slackware/
    
    SLACKY
    Done!
    slacky mirror set to: http://repository.slacky.eu/
    
    SALIX
    Testing ftp://salix.mirror.garr.it/mirrors/salix 0.963834
    Mirrors=28              Processed=17            Remaining=11
    Done!
    salix mirror set to: http://ftp.nluug.nl/os/Linux/distr/salix
    
    ALIEN
    Done!
    alien mirror set to: http://bear.alienbase.nl/mirrors/people/alien/sbrepos
    
    PONCE
    Done!
    ponce mirror set to: http://ponce.cc/slackware
    
    SLACKONLY
    Done!
    slackonly mirror set to: http://packages.slackonly.com/pub/packages
    
    SBO
    Done!
    sbo mirror set to: http://slackbuilds.org/slackbuilds
    
    real    0m38.663s
    user    0m1.863s
    sys     0m1.275s
    
    Reckon this is just about best we can get without throwing out baby with bath water. 8)
    Last edited by Bogomips on 08 Jul 2017, 14:53, edited 1 time in total.
    Reason: Latest Timing
    Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
    NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

    User avatar
    Ed_P
    Contributor
    Contributor
    Posts: 8341
    Joined: 06 Feb 2013, 22:12
    Distribution: Cinnamon 5.01 ISO
    Location: Western NY, USA

    Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

    Post#56 by Ed_P » 08 Jul 2017, 22:39

    OMG!! :shock: Good grief!!
    Bogmips wrote:Okay, then. Let's get to the bottom of this, and doing it with mirrors should make it foolprrof. :twisted:

    Code: Select all

    /Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4BDWBxRdABGIQkY99Bhqpmevep/hkeUyGDB63KA6oNDB
     :
     :
    Nsu6HtsjIt4ygaGjDcZzsQrr6AC0/cCXXYYk1QABsA7XIQAAPtSj5LHEZ/sCAAAAAARZWg==
    
    1. Quote this post and copy above code block to clipboard.
    OK but apparently your system is different than mine since my results differ.

    terminal 1

    Code: Select all

    guest@porteus:~$ base64 -d > safm.xz
    /Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4BDWBxRdABGIQkY99Bhqpmevep/hkeUyGDB63KA6oNDB
     :
     :
    s66vSEfdOU8yuYiMBBio7fy3iMDxiSilu2kL5taYHMjTxVsvdmuPuI8Lsm5XtGP1rgD4LbDpXmfP
    Nsu6HtsjIt4ygaGjDcZzsQrr6AC0/cCXXYYk1QABsA7XIQAAPtSj5LHEZ/sCAAAAAARZWg==guest@porteus:~$ ls -lh safm.xz
    -rw-r--r-- 1 guest users 1.9K Jul  8 13:06 safm.xz
    guest@porteus:~$ md5sum safm.xz
    ea0a7483efcb8039ae9d91c65b6ad918  safm.xz
    guest@porteus:~$ xz -d < safm.xz > safm.sh
    guest@porteus:~$ ls -lh safm.*
    -rw-r--r-- 1 guest users 4.3K Jul  8 13:08 safm.sh
    -rw-r--r-- 1 guest users 1.9K Jul  8 13:06 safm.xz
    guest@porteus:~$ ls -lh safm,*
    /bin/ls: cannot access 'safm,*': No such file or directory
    guest@porteus:~$ 
    
    terminal 2

    Code: Select all

    guest@porteus:~$ ls -lh safm.xz
    -rw-r--r-- 1 guest users 1.9K Jul  8 13:06 safm.xz
    guest@porteus:~$ ls -lh safm.sh
    -rw-r--r-- 1 guest users 4.3K Jul  8 13:08 safm.sh
    guest@porteus:~$ md5sum safm.sh
    91201d440b41099abdeba87aff4238f0  safm.sh
    guest@porteus:~$ diff safm.sh USM/safm.sh
    1a2
    > # http://forum.porteus.org/viewtopic.php?f=39&t=7000&p=56042#p56042
    44c45
    < ## Verification by Key Press		2015-02-12 00:11:36 
    ---
    > ## Verification by Key Press        2015-02-12 00:11:36 
    50,53c51,54
    <       "$nu"	)	echo ""; return 0;;
    <       [yY]	)	echo ""; return 0;;
    <       [nN]	)	echo ""; return 1;;
    < 	*	)  echo $'\n'"Invalid Key '$k'"
    ---
    >       "$nu"    )    echo ""; return 0;;
    >       [yY]    )    echo ""; return 0;;
    >       [nN]    )    echo ""; return 1;;
    >     *    )  echo $'\n'"Invalid Key '$k'"
    95c96
    < safm $*
    ---
    > safm $*
    \ No newline at end of file
    guest@porteus:~$ sed "s/\s*kpv\s*().*/masm \$*/;T;q"  safm.sh > masm.sh
    guest@porteus:~$ ls -lh masm.sh
    -rw-r--r-- 1 guest users 2.2K Jul  8 13:13 masm.sh
    guest@porteus:~$ md5sum masm.sh
    2c61b88200194ccab50d07b6d9f157b9  masm.sh
    guest@porteus:~$ sh masm.sh slacky http//slack.isper.sk/pub
    URL Error: Neither http nor ftp.
    guest@porteus:~$ sh masm.sh slacky http://slack.isper.sk/pub
    
    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    
    Password: 
    You do that again and see what happens...
    Password: 
    Done!
    slacky mirror set to: http://slack.isper.sk/pub
    guest@porteus:~$ bash safm.sh slacky
    
    Current Mirror: http://slack.isper.sk/pub
    Alternative Mirrors
    Choices Exhausted! Terminating.
    guest@porteus:~$ 
    
    terminal 3

    Code: Select all

    guest@porteus:~$ bash USM/sesm.sh all http://slack.isper.sk/pub
    
    Exclusion URL Specified on Command Line:
    http://slack.isper.sk/pub
    
    All Exclusion URLs:
    Cmd Line URLs=1		File (.usm/badmirrors.txt) URLs=0	Merged(Unique) URLs=1
    
    SLACKWARE
    Testing http://mirrors.slackware.com/slackware/ 1.669
    Mirrors=152		Processed=2		Remaining=150
    Testing ftp://ftp.iinet.net.au/pub/slackware/ 4.000
    Mirrors=152		Processed=5		Remaining=147
    Testing http://mirror.aarnet.edu.au/pub/slackware/ 0.570
    Mirrors=152		Processed=8		Remaining=144
    Testing ftp://mirror.internode.on.net/.pub2/slackware/ 4.000
    Mirrors=152		Processed=11		Remaining=141
    Testing ftp://ftp.slackware.at/ 3.999
    Mirrors=152		Processed=14		Remaining=138
    Testing ftp://gd.tuwien.ac.at/opsys/linux/freesoftware.com/ 4.000
    Mirrors=152		Processed=16		Remaining=136
    Testing ftp://ftp.slackware-brasil.com.br/ 2.938
    Mirrors=152		Processed=20		Remaining=132
    Testing ftp://mirror.csclub.uwaterloo.ca/slackware/ 0.946
    Mirrors=152		Processed=24		Remaining=128
    Testing http://mirrors.ustc.edu.cn/slackware/ 2.223
    Mirrors=152		Processed=30		Remaining=122
    Testing ftp://odysseus.linux.cz/pub/linux/slackware/ 3.775
    Mirrors=152		Processed=34		Remaining=118
    Testing ftp://elektroni.phys.tut.fi/ 2.785
    Mirrors=152		Processed=38		Remaining=114
    Testing ftp://nephtys.lip6.fr/pub/linux/distributions/slackware/ 3.865
    Mirrors=152		Processed=41		Remaining=111
    Testing ftp://ftp.gwdg.de/pub/linux/slackware/ 2.740
    Mirrors=152		Processed=44		Remaining=108
    Testing ftp://sunsite.informatik.rwth-aachen.de/pub/comp/Linux/slackware/ 3.456
    Mirrors=152		Processed=48		Remaining=104
    Testing ftp://ftp.cc.uoc.gr/mirrors/linux/slackware/ 4.000
    Mirrors=152		Processed=52		Remaining=100
    Testing ftp://patroklos.noc.ntua.gr/pub/linux/slackware/ 4.000
    Mirrors=152		Processed=56		Remaining=96
    Testing http://kambing.ui.ac.id/slackware/ 1.820
    Mirrors=152		Processed=60		Remaining=92
    Testing ftp://ftp.heanet.ie/mirrors/ftp.slackware.com/pub/slackware/ 3.102
    Mirrors=152		Processed=62		Remaining=90
    Testing ftp://ftp.nara.wide.ad.jp/pub/Linux/slackware/ 3.999
    Mirrors=152		Processed=66		Remaining=86
    Testing ftp://riksun.riken.go.jp/Linux/slackware/ 4.000
    Mirrors=152		Processed=70		Remaining=82
    Testing ftp://ftp.nluug.nl/vol/4/slackware/ 2.117
    Mirrors=152		Processed=73		Remaining=79
    Testing ftp://ftp1.uninett.no/slackware/ 2.535
    Mirrors=152		Processed=78		Remaining=74
    Testing ftp://ftp.pwr.wroc.pl/pub/linux/slackware/ 3.662
    Mirrors=152		Processed=81		Remaining=71
    Testing ftp://gepard.pbone.net/mirror/ftp.slackware.com/ 2.231
    Mirrors=152		Processed=85		Remaining=67
    Testing ftp://sunsite.icm.edu.pl/vol/rzm1/linux-slackware/ 2.458
    Mirrors=152		Processed=88		Remaining=64
    Testing ftp://darkstar.ist.utl.pt/pub/slackware/ 3.690
    Mirrors=152		Processed=92		Remaining=60
    Testing ftp://mirror.yandex.ru/slackware/ 2.839
    Mirrors=152		Processed=95		Remaining=57
    Testing http://mirror2.etf.bg.ac.rs/slackware/ 4.002
    Mirrors=152		Processed=98		Remaining=54
    Testing ftp://ftp.wa.co.za/pub/slackware/ 4.000
    Mirrors=152		Processed=101		Remaining=51
    Testing ftp://ftp.df.lth.se/pub/slackware/ Fail
    Mirrors=152		Processed=105		Remaining=47
    Testing ftp://mirror.switch.ch/mirror/slackware/ 3.193
    Mirrors=152		Processed=109		Remaining=43
    Testing ftp://ftp.twaren.net/pub/Linux/Slackware/ 4.000
    Mirrors=152		Processed=113		Remaining=39
    Testing ftp://mirrors.mithril.org.ua/linux/slackware/ 3.148
    Mirrors=152		Processed=117		Remaining=35
    Testing ftp://mirror.bytemark.co.uk/slackware/ 3.071
    Mirrors=152		Processed=121		Remaining=31
    Testing ftp://ftp.gtlib.gatech.edu/nv/ao2/lxmirror/ftp.slackware.com/ 1.924
    Mirrors=152		Processed=125		Remaining=27
    Testing http://mirror.metrocast.net/slackware/ 0.244
    Mirrors=152		Processed=133		Remaining=19
    Testing ftp://mirrors.xmission.com/slackware/ 2.334
    Mirrors=152		Processed=139		Remaining=13
    Testing ftp://slackware.virginmedia.com/mirrors/ftp.slackware.com/ 4.000
    Mirrors=152		Processed=147		Remaining=5
    Testing ftp://teewurst.cc.columbia.edu/pub/linux/slackware/ 0.782
    Mirrors=152		Processed=151		Remaining=1
    Password: 
    Done!
    slackware mirror set to: http://teewurst.cc.columbia.edu/pub/linux/slackware/
    
    SLACKWAREPATCHES
    Done!
    slackwarepatches mirror set to: http://teewurst.cc.columbia.edu/pub/linux/slackware/
    
    SLACKY
    Done!
    slacky mirror set to: http://repository.slacky.eu/
    
    SALIX
    Testing http://mirror.its.dal.ca/salix 0.170
    Mirrors=27		Processed=5		Remaining=22
    Testing ftp://ftp.mirrorservice.org/sites/download.salixos.org 2.019
    Mirrors=27		Processed=9		Remaining=18
    Testing ftp://ftp.heanet.ie/pub/salix 2.328
    Mirrors=27		Processed=15		Remaining=12
    Testing ftp://ftp.nluug.nl/pub/os/Linux/distr/salix 3.252
    Mirrors=27		Processed=19		Remaining=8
    Testing ftp://ftp.gtlib.gatech.edu/pub/salixos 1.368
    Mirrors=27		Processed=24		Remaining=3
    Done!
    salix mirror set to: http://mirror.its.dal.ca/salix
    
    ALIEN
    Done!
    alien mirror set to: http://bear.alienbase.nl/mirrors/people/alien/sbrepos
    
    PONCE
    Done!
    ponce mirror set to: http://ponce.cc/slackware
    
    SLACKONLY
    Done!
    slackonly mirror set to: http://packages.slackonly.com/pub/packages
    
    SBO
    Done!
    sbo mirror set to: http://slackbuilds.org/slackbuilds
    guest@porteus:~$ 
    
    However, on my system...

    win2unix.sh

    Code: Select all

    #!/bin/sh
    # https://forum.porteus.org/viewtopic.php?f=39&t=7000&p=56496#p56484
    # syntax error near unexpected token `$'\r''  fix
    
    cd USM
    cp $1 $1x
    tr -d '\15\32' < $1x > $1
    rm $1x
    terminal (almost 100%)

    Code: Select all

    guest@porteus:~$ ./USM/win2unix.sh sesm.sh
    guest@porteus:~$ ./USM/sesm.sh
    Argument usage:		all	[<Toggle Debug: 0/1>]	[ URL .. ]
    URL .. Optional Exclusion Mirror List on Command Line
    Optional Exclusion File of URLs: .usm/badmirrors.txt (following format of 'mirrors-<repo>,txt')
    guest@porteus:~$ ./USM/safm.sh
    Argument usage:		<Repository>		[<# of Mirrors to Display (default=6)>]
    guest@porteus:~$ ./USM/masm.sh
    Argument usage:		<Repository>		<Mirror URL>
    guest@porteus:~$ ./USM/fasm.sh
    Argument usage:		<Repository>		[<Toggle Debug: 0/1>]	[ URL .. ]
    URL .. Optional Exclusion Mirror List on Command Line
    Optional Exclusion File of URLs: .usm/badmirrors.txt (following format of 'mirrors-<repo>,txt')
    guest@porteus:~$ ./USM/badm.sh
    Argument usage:	< # of Worst Mirrors to Display >	[Repository(default:slackware)]
    Only run after script to set fatest usm mirrors (aka sesm.sh) has run.
    guest@porteus:~$ ./USM/sam.sh
    bash: ./USM/sam.sh: /bin/bash^M: bad interpreter: No such file or directory
    guest@porteus:~$ bash ./USM/sam.sh
    ./USM/sam.sh: line 4: syntax error near unexpected token `$'\r''      <-------------------------   Another one!! 
    '/USM/sam.sh: line 4: `sam ()
    guest@porteus:~$ ./USM/win2unix.sh sam.sh                           <-----------------------------
    guest@porteus:~$ bash ./USM/sam.sh
    
    Distro Mirrors
    
    SLACKWARE
    Mirror: http://mirrors.slackware.com/slackware/
    151 Commented Out
    
    SLACKWAREPATCHES
    Mirror: http://ftp.slackware-brasil.com.br/
    151 Commented Out
    
    SLACKY
    Mirror: http://repository.slacky.eu/
    2 Commented Out
    
    SALIX
    Mirror: http://mirror.its.dal.ca/salix
    26 Commented Out
    
    ALIEN
    Mirror: http://bear.alienbase.nl/mirrors/people/alien/sbrepos
    0 Commented Out
    
    PONCE
    Mirror: http://ponce.cc/slackware
    0 Commented Out
    
    SLACKONLY
    Mirror: http://packages.slackonly.com/pub/packages
    0 Commented Out
    
    guest@porteus:~$ 
    
    :)



    -edit- Sun 09 Jul 2017, 00:39 EDT

    While it appears we have a solution to the problem I'm still not sure HOW the problem occurred. If a script is copied and pasted into a Windows app like Notepad and saved then opened in Porteus with Mousepad doesn't Mousepad then save the file without the carriage return and line feed characters? (It's kinda wierd that I have used those functions before there were pcs. :( )
    Ed

    Bogomips
    Full of knowledge
    Full of knowledge
    Posts: 2564
    Joined: 25 Jun 2014, 15:21
    Distribution: 3.2.2 Cinnamon & KDE5
    Location: London

    Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

    Post#57 by Bogomips » 10 Jul 2017, 00:26

    Ed_P wrote:
    terminal 2

    Code: Select all

    guest@porteus:~$ md5sum safm.sh
    91201d440b41099abdeba87aff4238f0  safm.sh
    guest@porteus:~$ sh masm.sh slacky http://slack.isper.sk/pub
    
    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    
    Password: 
    You do that again and see what happens...
    Password: 
    Done!
    slacky mirror set to: http://slack.isper.sk/pub
    guest@porteus:~$ bash safm.sh slacky
    
    Current Mirror: http://slack.isper.sk/pub
    Alternative Mirrors
    Choices Exhausted! Terminating.
    guest@porteus:~$ 
    
    However something is not adding up! Going by above output there is only one slacky mirror,
    Ed_P wrote:terminal 3 However, on my system...

    win2unix.sh

    Code: Select all

    guest@porteus:~$ bash ./USM/sam.sh
    ./USM/sam.sh: line 4: syntax error near unexpected token `$'\r''      <-------------------------   Another one!! 
    '/USM/sam.sh: line 4: `sam ()
    guest@porteus:~$ ./USM/win2unix.sh sam.sh                           <-----------------------------
    guest@porteus:~$ bash ./USM/sam.sh
    
    Distro Mirrors
    
    
    SLACKY
    Mirror: http://repository.slacky.eu/
    2 Commented Out
    
    But from above we see there are 3 slacky mirrors, just like mine, in which case output of safm run should have been:

    Code: Select all

    guest@porteus:~$ bash safm.sh slacky
    
    Current Mirror: http://slack.isper.sk/pub
    Alternative Mirrors
    1) http://repository.slacky.eu/ 0.142210
    2) http://slackware.org.uk/slacky 0.186717
    #?       
    Ed_P wrote:-edit- Sun 09 Jul 2017, 00:39 EDT

    While it appears we have a solution to the problem I'm still not sure HOW the problem occurred. If a script is copied and pasted into a Windows app like Notepad and saved then opened in Porteus with Mousepad doesn't Mousepad then save the file without the carriage return and line feed characters?
    Inspect output of this command:

    Code: Select all

    od  -cx  <scriptfile saved by mousepad> | less
    Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
    NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

    User avatar
    Ed_P
    Contributor
    Contributor
    Posts: 8341
    Joined: 06 Feb 2013, 22:12
    Distribution: Cinnamon 5.01 ISO
    Location: Western NY, USA

    Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

    Post#58 by Ed_P » 10 Jul 2017, 01:10

    Bogomips wrote:However something is not adding up! Going by above output there is only one slacky mirror,
    My file:

    Code: Select all

    # mirrors - List of Slacky Linux mirrors
    
    ## EUROPE
    http://repository.slacky.eu/
    
    ## UNITED KINGDOM
    #http://slackware.org.uk/slacky
    
    ## SLOVAKIA
    #http://slack.isper.sk/pub
    :unknown:

    Inspect output of this command:

    Code: Select all

    od  -cx  <scriptfile saved by mousepad> | less
    flashfix.sh

    Code: Select all

    #!/bin/sh
    #  https://forum.porteus.org/viewtopic.php?f=117&t=6526&p=51788#p51764
    
    [[ -d .mozilla ]] || mkdir .mozilla
    ls .mozilla
    ln -s /usr/lib64/mozilla/plugins/ .mozilla/
    ls .mozilla
    How does this help??

    Code: Select all

    od -cx flashfix.sh | less
    0000000   #   !   /   b   i   n   /   s   h  \n   #           h   t   t
               2123    622f    6e69    732f    0a68    2023    6820    7474
    0000020   p   s   :   /   /   f   o   r   u   m   .   p   o   r   t   e
               7370    2f3a    662f    726f    6d75    702e    726f    6574
    0000040   u   s   .   o   r   g   /   v   i   e   w   t   o   p   i   c
               7375    6f2e    6772    762f    6569    7477    706f    6369
    0000060   .   p   h   p   ?   f   =   1   1   7   &   t   =   6   5   2
               702e    7068    663f    313d    3731    7426    363d    3235
    0000100   6   &   p   =   5   1   7   8   8   #   p   5   1   7   6   4
               2636    3d70    3135    3837    2338    3570    3731    3436
    0000120  \n  \n   [   [       -   d       .   m   o   z   i   l   l   a
               0a0a    5b5b    2d20    2064    6d2e    7a6f    6c69    616c
    0000140       ]   ]       |   |       m   k   d   i   r       .   m   o
               5d20    205d    7c7c    6d20    646b    7269    2e20    6f6d
    0000160   z   i   l   l   a  \n   l   s       .   m   o   z   i   l   l
               697a    6c6c    0a61    736c    2e20    6f6d    697a    6c6c
    0000200   a  \n   l   n       -   s       /   u   s   r   /   l   i   b
               0a61    6e6c    2d20    2073    752f    7273    6c2f    6269
    0000220   6   4   /   m   o   z   i   l   l   a   /   p   l   u   g   i
               3436    6d2f    7a6f    6c69    616c    702f    756c    6967
    0000240   n   s   /       .   m   o   z   i   l   l   a   /  \n   l   s
               736e    202f    6d2e    7a6f    6c69    616c    0a2f    736c
    0000260       .   m   o   z   i   l   l   a
    lines 1-23/25 97%
    
    :unknown:
    Ed

    Bogomips
    Full of knowledge
    Full of knowledge
    Posts: 2564
    Joined: 25 Jun 2014, 15:21
    Distribution: 3.2.2 Cinnamon & KDE5
    Location: London

    Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

    Post#59 by Bogomips » 10 Jul 2017, 15:01

    Ed_P wrote:
    Inspect output of this command:

    Code: Select all

    od  -cx  <scriptfile saved by mousepad> | less
    flashfix.sh

    Code: Select all

    #!/bin/sh
    #  https://forum.porteus.org/viewtopic.php?f=117&t=6526&p=51788#p51764
    
    [[ -d .mozilla ]] || mkdir .mozilla
    ls .mozilla
    ln -s /usr/lib64/mozilla/plugins/ .mozilla/
    ls .mozilla
    How does this help??

    Code: Select all

    od -cx flashfix.sh | less
    0000000   #   !   /   b   i   n   /   s   h  \n   #           h   t   t
               2123    622f    6e69    732f    0a68    2023    6820    7474
    0000020   p   s   :   /   /   f   o   r   u   m   .   p   o   r   t   e
               7370    2f3a    662f    726f    6d75    702e    726f    6574
    0000040   u   s   .   o   r   g   /   v   i   e   w   t   o   p   i   c
               7375    6f2e    6772    762f    6569    7477    706f    6369
    0000060   .   p   h   p   ?   f   =   1   1   7   &   t   =   6   5   2
               702e    7068    663f    313d    3731    7426    363d    3235
    0000100   6   &   p   =   5   1   7   8   8   #   p   5   1   7   6   4
               2636    3d70    3135    3837    2338    3570    3731    3436
    0000120  \n  \n   [   [       -   d       .   m   o   z   i   l   l   a
               0a0a    5b5b    2d20    2064    6d2e    7a6f    6c69    616c
    0000140       ]   ]       |   |       m   k   d   i   r       .   m   o
               5d20    205d    7c7c    6d20    646b    7269    2e20    6f6d
    0000160   z   i   l   l   a  \n   l   s       .   m   o   z   i   l   l
               697a    6c6c    0a61    736c    2e20    6f6d    697a    6c6c
    0000200   a  \n   l   n       -   s       /   u   s   r   /   l   i   b
               0a61    6e6c    2d20    2073    752f    7273    6c2f    6269
    0000220   6   4   /   m   o   z   i   l   l   a   /   p   l   u   g   i
               3436    6d2f    7a6f    6c69    616c    702f    756c    6967
    0000240   n   s   /       .   m   o   z   i   l   l   a   /  \n   l   s
               736e    202f    6d2e    7a6f    6c69    616c    0a2f    736c
    0000260       .   m   o   z   i   l   l   a
    lines 1-23/25 97%
    
    :unknown:
    Ed_P wrote:doesn't Mousepad then save the file without the carriage return and line feed characters? (It's kinda wierd that I have used those functions before there were pcs. :( )
    Do you not remember? 0x0d0a

    Code: Select all

    od -cx flashfix.sh | less
    0000000   #   !   /   b   i   n   /   s   h | \n |  #           h   t   t
               2123    622f    6e69    732f   [ 0a ]68    2023    6820    7474
    0000020   p   s   :   /   /   f   o   r   u   m   .   p   o   r   t   e
               7370    2f3a    662f    726f    6d75    702e    726f    6574
    0000040   u   s   .   o   r   g   /   v   i   e   w   t   o   p   i   c
               7375    6f2e    6772    762f    6569    7477    706f    6369
    0000060   .   p   h   p   ?   f   =   1   1   7   &   t   =   6   5   2
               702e    7068    663f    313d    3731    7426    363d    3235
    0000100   6   &   p   =   5   1   7   8   8   #   p   5   1   7   6   4
               2636    3d70    3135    3837    2338    3570    3731    3436
    0000120 | \n  \n |  [   [       -   d       .   m   o   z   i   l   l   a
               [0a0a]    5b5b    2d20    2064    6d2e    7a6f    6c69    616c
    0000140       ]   ]       |   |       m   k   d   i   r       .   m   o
               5d20    205d    7c7c    6d20    646b    7269    2e20    6f6d
    0000160   z   i   l   l   a | \n |  l   s       .   m   o   z   i   l   l
               697a    6c6c    [0a]61    736c    2e20    6f6d    697a    6c6c
    0000200   a  \n   l   n       -   s       /   u   s   r   /   l   i   b
               0a61    6e6c    2d20    2073    752f    7273    6c2f    6269
    0000220   6   4   /   m   o   z   i   l   l   a   /   p   l   u   g   i
               3436    6d2f    7a6f    6c69    616c    702f    756c    6967
    0000240   n   s   /       .   m   o   z   i   l   l   a   / | \n |   l   s
               736e    202f    6d2e    7a6f    6c69    616c   [ 0a ] 2f    736c
    0000260       .   m   o   z   i   l   l   a
    lines 1-23/25 97%
    
    No 0x0d so all clean, all unix :)
    Linux porteus 4.4.0-porteus #3 SMP PREEMPT Sat Jan 23 07:01:55 UTC 2016 i686 AMD Sempron(tm) 140 Processor AuthenticAMD GNU/Linux
    NVIDIA Corporation C61 [GeForce 6150SE nForce 430] (rev a2) MemTotal: 901760 kB MemFree: 66752 kB

    User avatar
    Ed_P
    Contributor
    Contributor
    Posts: 8341
    Joined: 06 Feb 2013, 22:12
    Distribution: Cinnamon 5.01 ISO
    Location: Western NY, USA

    Re: [INFO & SCRIPT] Slackware Mirror Settings for USM

    Post#60 by Ed_P » 10 Jul 2017, 15:25

    ^ Searching for 0x0d0a in the od -cx output of a file the size of sesm.sh or funcpackageGet.hic much harder to do.
    Ed

    Post Reply