Quicktime bypasses proxy script.
Hello,
We are using a proxy to access the internet. So all traffic points in IE to a proxy script that forwards to the proxy server. The problem is that quickitme doens't seem to read that script and tries to access the internet directly so the firewall blocks it because it doesn't come from the proxy server. Works fine when specifying the proxy server address directly in IE settings but we need to make it work with the script. Does anyone know if quicktime has problems reading proxy scripts? Thanks
Windows 2000
Windows 2000
Wow what a good discussion forum. Thanks for the help
Similar Messages
-
Arch Linux Pacman Proxy Script
Since my Arch box has no internet connection (yes, I'm that much of a masochist), I wrote a bash script to act as a proxy of sorts for pacman, at least as regards downloading. It took a while to get it working (intermittent web access and all) but here it finally is, as promised.
It works well for me, and I only hope that it will help anyone else in the same situation (if there is anyone else in the same situation).
The script has various options to explain everything you need to know, but here's a quick word of warning: it only works on POSIX-compatible computers (i.e. no Wintendows, usually) and the proxy box needs to have bash, wget, tar, grep and sed installed. I don't see this as being a problem, but if I'm wrong, tell me all about it.
#!/bin/bash
readonly VER="2.1"
readonly wgetVER=`wget -V|sed '1!d'`
# DEBUG levels:
# Set to 0 for ALERT-level messages only
# Set to 1 for INFO-level messages (I prefer this)
# Set to 2 for DEBUG-level messages
# Set to 3 for all messages
readonly DEBUG=0
# Set DEBUGLOG=1 to print ALERT, INFO and DEBUG messages to DEBUG.log
readonly DEBUGLOG=0
readonly COLOUR=true
if [[ $COLOUR == true ]] ; then
readonly red='\e[31m'
readonly warn='\e[31;7m '
readonly green='\e[32m'
readonly lgreen='\e[32;1m'
readonly yellow='\e[33;1m'
readonly lblue='\e[34;1m'
readonly dull='\e[0m' ; fi
# Sticky details:
# tar seems very slow (vfat? transform? USB?)
function bugspray {
[[ -z $2 ]] && verbosity=1 || verbosity=$2
if (( DEBUG >= verbosity )) ; then
(( $2 == 0 )) && intro="${warn}ALERT${dull} | "
(( $2 == 1 )) && intro=" INFO | "
(( $2 > 1 )) && intro=" ${yellow}DEBUG${dull} | "
echo -e "$intro$1"
(( DEBUGLOG == 1 )) && echo "`date +%F_%T` | $1">>log-alpps/DEBUG.log ; fi ; }
function compare_versions {
# Requires two ordinary, untweaked version strings, first local, second distant
if [[ -z $2 ]] ; then
bugspray "compare_versions didn't receive two variables." 2 ; fi
update='no'
[[ -z $2 ]] && return
local localversion=(`echo $1|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local distantversion=(`echo $2|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local max=$((${#distantversion[*]}))
bugspray "localversion: ${localversion[*]}; distantversion: ${distantversion[*]}" 2
for (( x=0 ; (( x < $max )) ; $((x++)) )) ; do
bugspray "local version part: `echo ${localversion[$x]}` | distant version part: `echo ${distantversion[$x]}`" 2
if [[ `echo ${localversion[$x]}|grep -E '^[0-9]*$'` && `echo ${distantversion[$x]}|grep -E '^[0-9]*$'` ]] ; then
bugspray "Numerical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): $(( 10#${localversion[$x]} < 10#${distantversion[$x]} ))" 3
# Different compare methods for numbers, single letters and multiple letters.
if (( 10#${localversion[$x]} < 10#${distantversion[$x]} )) ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]$'` ]] ; then # single letter -> compare
bugspray "Lexicographical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): [[ ${localversion[$x]} < ${distantversion[$x]} ]]" 3
if [[ ${localversion[$x]} < ${distantversion[$x]} ]] ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]+$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]+$'` ]] ; then # string -> drop
# cvs / git / beta -> what are the rules?
bugspray "Sequence of letters. Not treating as version number." 2 ; fi
done ; }
function find_dependencies {
# Determine existence via unique path
bugspray "+ ${lgreen}Building download list for package \"$1\"${dull}" 1
local packagename
local dlfile
local package_found=no
if [[ `ls .temp-alpps/*.db/$1-* 2>/dev/null` ]] ; then
bugspray "Analogous package-name file(s) found" 2
for x in `ls .temp-alpps/*.db/$1-*/desc` ; do
bugspray "Checking $x" 2
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$1 ]] ; then
bugspray "Exact match found: $packagename = $1" 2
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
local distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
local package_full=$packagename-$distantversion
local the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
local the_path=`echo $x|sed -r 's/desc//'`
unplus=`echo $packagename|sed 's/\+/\\\+/g'`
local local_version=`sed -r '/^'$unplus' /!d;s/.* //' .temp-alpps/snapshot.state`
package_found=yes
break ; fi ; done ; fi
if [[ -z $dlfile ]] ; then
bugspray "Exact match not found -> looking for replacements." 2
if ! [[ -z `grep $1 .temp-alpps/*.db/*/depends` ]] ; then
local provisional=`grep $1 .temp-alpps/*.db/*/depends|sed -r 's/\/depends.*//'`
for package in $provisional ; do
local providence=`sed -r '/%PROVIDES%/,/^$/!d;/%PROVIDES%/d;/^$/d;s/>.*//;s/=.*//' $package/depends`
for y in $providence ; do
if [[ j$y == j$1 ]] ; then
# But what about when several packages provide the same thing and ALPPS picks the wrong one? Can it happen?
local newdep=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $package/desc`
bugspray " -> Package \"$newdep\" provides \"$1\"." 1
find_dependencies $newdep
break 2 ; fi ; done ; done
if [[ -z $newdep ]] ; then
bugspray "${warn}Warning:${dull} package \"$1\" not found in database." 0 ; fi ; fi ; fi
bugspray "package: $1 | package_found = $package_found" 2
# Add file to download_list if not up to date and if not already present
if [[ j$package_found == jyes ]] ; then
local already_got_one=no
unplus=`echo $dlfile|sed 's/\+/\\\+/g'`
[[ `echo $download_files|grep $unplus` ]] && already_got_one="yes" && bugspray "${green}Package in queue${dull}" 1
[[ `ls downloads/$dlfile 2>/dev/null` ]] && already_got_one="yes" && bugspray "${green}Package proxied${dull}" 1
compare_versions $local_version $distantversion
bugspray "compare_versions says: $update" 2
! [[ -z $local_version || $update == yes ]] && already_got_one="yes" && bugspray "${green}Package already installed and up-to-date${dull}" 1
if [[ j$already_got_one != jyes ]] ; then
bugspray "${green}Confirm downloading${dull}" 1
download_files+="$dlfile "
download_array[${dlfile}]=$the_repo
bugspray "Checking for further dependencies" 2
if [[ -a $the_path/depends && `grep -E '^%DEPENDS%$' $the_path/depends` ]] ; then
local dependency=`sed -r '/%DEPENDS%/d;/^$/q' $the_path/depends`
bugspray "Dependencies of \"$packagename\":$dependency" 3
for x in $dependency ; do
# Is this dependency already installed? Sort-of the same as higher up; it just saves time here.
local depname=`echo $x|sed -r 's/>.*//;s/=.*//'`
local depminver=`echo $x|sed -r 's/.*>//'`
bugspray "Dependency name: \"$depname\"" 2
if ! [[ `grep -E '^$depname ' .temp-alpps/snapshot.state` ]] ; then
find_dependencies $depname ; fi ; done
else
bugspray "${lblue}End of the line${dull}: package \"$packagename\" has no dependencies." 2
true ; fi ; fi ; fi ; }
function failover_fetch {
echo "Downloading `echo $1|sed 's/.*\///'`"
[[ -d log-alpps/ ]] || mkdir log-alpps/
[[ -z $success ]] || unset success
for mirror in $(<.temp-alpps/snapshot.mirrorlist) ; do
# If DEBUG>0, shouldn't redirect output
url=`echo $mirror|sed 's/$arch/'$arch'/;s/$repo/'${download_array[$1]}'/'`/$1
bugspray "Connecting to $url" 2
wget -o .temp-alpps/very-temp-log -U "Arch Linux Pacman Proxy Script version $VER / $wgetVER" -P downloads/ $url && success=true
cat .temp-alpps/very-temp-log>>log-alpps/download.log
rm -f .temp-alpps/very-temp-log
if [[ -n $success ]] ; then
bugspray "Download: \$success = true" 2
break ; fi ; done
if [[ -z $success ]] ; then
bugspray "${warn}FAIL:${dull} $1 not accessible on known mirrors." 0 ; fi ; }
case $1 in
warranty)
echo
echo -e " ${green}Warranty${dull}"
echo -e " ${green}========${dull}"
echo " This program is free software. It comes without any warranty, to"
echo " the extent permitted by applicable law. You can redistribute it"
echo " and/or modify it under the terms of the Do What The Fuck You Want"
echo " To Public License, Version 2, as published by Sam Hocevar. See"
echo " http://sam.zoy.org/wtfpl/COPYING for more details."
echo
howto)
echo
echo -e " ${green}How to use ALPPS${dull}"
echo -e " ${green}================${dull}"
echo -e " ${yellow}+ Step 0${dull}: prime the engine"
echo " On your offline box, copy the ALPPS script onto a removable medium, cd into"
echo " it's directory, then run it with the \"init\" option. This essentially"
echo " takes a snapshot of your system, package-wise. Your removable medium is"
echo " now ready for use!"
echo -e " ${yellow}+ Step 1${dull}:"
echo " On the proxy box the first order of business is to download and decompress"
echo " the current package lists. You can do this with the \"fetchdb\" option."
echo -e " ${yellow}+ Step 1 alt${dull}:"
echo " If you want to download the package lists without decompressing them,"
echo " \"fetchdb simple\" will do this. It's a lot quicker, but please keep"
echo " in mind that you cannot then do anything in step 2."
echo -e " ${yellow}+ Step 2${dull}:"
echo " If you want to download packages (and why wouldn't you?), the easiest way"
echo " is to prepare a simple text file containing the names of the packages you"
echo " want, one on each line. Run ALPPS with the option \"fetch <filename>\" and"
echo " sit back and wait until it's done. Don't worry about dependencies: ALPPS"
echo " handles them automatically."
echo -e " ${yellow}+ Step 2 alt${dull}:"
echo " As a convenience, \"fetch full\" will download all the packages needed to"
echo " update the offline box."
echo -e " ${yellow}+ Step 3${dull}:"
echo " Finally, back on your offline box, run ALPPS again with the \"install\""
echo " option. This will update the package list and copy the package files into"
echo " local cache. You can now run \"pacman -S <package names>\" to finish"
echo " installing the packages."
# ALPPS no longer installs the packages, just caches them locally.
# Not entirely sure why; it just felt too klutzy.
echo -e " ${yellow}+ Step 4${dull}:"
echo " You will now probably want to delete all the stuff you no longer need. Run"
echo " ALPPS with the option \"clean\". This won't touch your request file(s). It"
echo -e " ${red}WILL${dull} delete log files, so if you want to keep them, back them up first."
echo " Next time you do this, don't forget to run ALPPS with \"init\" again."
echo
bugs)
echo
echo -e " ${green}Where this goes wrong${dull}"
echo -e " ${green}=====================${dull}"
echo " + ALPPS is a bit slow when packages have many dependencies. It's a recursive"
echo " shell script: what did you expect?"
echo " + It only uses the settings in /etc/pacman.conf. If your conf file is"
echo " elsewhere, you're SOL. Similarly, the repositories are all taken from"
echo " /etc/pacman.d/mirrorlist. If you added any custom repositories in"
echo " /etc/pacman.conf (or any other file), ALPPS ignores them."
echo " + As it stands, ALPPS only works when the proxy box has bash, wget, sed,"
echo " grep and tar installed. The offline box needs bash, pacman and sed (in"
echo " theory, this shouldn't be a problem...)."
echo " + There is as yet no way of handling package groups, short of listing every"
echo " member of the group."
echo " + I don't think ALPPS will ever be able to handle AUR packages. Of course, if"
echo " you're compiling AUR packages, you probably won't need something like this!"
echo
faq)
echo
echo -e " ${green}Frequently Asked Questions${dull}"
echo -e " ${green}==========================${dull}"
echo
echo -e " ${red}Q:${dull} Can I run the whole thing off a USB stick?"
echo -e " ${lblue}A:${dull} Certainly."
echo
echo -e " ${red}Q:${dull} Can I use a non-POSIX computer as a proxy (e.g. Windows)?"
echo -e " ${lblue}A:${dull} Probably not, unless that computer has a POSIX-compatibility layer"
echo " installed (such as Cygwin) with bash, wget, tar, sed and grep."
echo
echo -e " ${red}Q:${dull} Do I need to download the package list, waste time updating my computer,"
echo " then go back again to download the packages I want?"
echo -e " ${lblue}A:${dull} Nope! You can update the packagelist database and download piping-hot"
echo " fresh packages, all in one sitting."
echo -e " ${red}Q:${dull} You mean I won't have to futz around with package lists that keep updating"
echo " ten minutes after I download them?"
echo -e " ${lblue}A:${dull} Exactly. Nice, isn't it?"
echo
echo -e " ${red}Q:${dull} Does this thing handle SSL and signed packages?"
echo -e " ${lblue}A:${dull} ALPPS uses SSL if:"
echo " - the mirror has an https address (at present, none do), and"
echo " - wget on the proxy box is compiled with SSL support"
echo " Concerning signed packages: no, but then again, it doesn't need to. ALPPS"
echo " downloads packages; it's pacman's responsibility to verify them. Your"
echo " system remains safe (or as safe as it ever was, at any rate)."
echo -e " ${red}Q:${dull} What about gpg keys? I need to get them."
echo -e " ${lblue}A:${dull} ...maybe later, say, in version 3."
echo
echo -e " ${red}Q:${dull} ALPPS says it \`prepares databases´. Can pacman still use them after this?"
echo -e " ${lblue}A:${dull} Yes, it can. In fact, what ALPPS does is extract the databases into a"
echo " temp directory, without altering the original .db files."
echo
echo -e " ${red}Q:${dull} Where can I contact you?"
echo -e " ${lblue}A:${dull} For constructive, useful questions and comments: [email protected] and"
echo " be sure to mention Arch Linux in the subject."
echo " For flames, trolling, spam and the like, visit your local bitbucket."
echo
todo)
echo
echo -e " ${green}What's next?${dull}"
echo -e " ${green}============${dull}"
echo -e " + I ${red}might${dull} be able to extend the reach of this thing to the AUR."
echo " Yes, I know I said ALPPS couldn't (in \"bugs\"), but I've learned"
echo " something new since then. It'll be tricky, though, since the AUR web"
echo " interface delivers results in python. While this should be a Good Thing,"
echo " bash isn't very good at handling python-format lists and dicts."
echo
-v|ver|version|--ver|--version)
echo -e "${lgreen}Arch Linux pacman proxy script${dull} | ${yellow}version $VER${dull}"
dl_list) # Debugging
(( DEBUG == 0 )) && echo "the \"dl_list\" option is only for debugging" && exit 0
arch=$(<.temp-alpps/snapshot.architecture)
unset download_files
unset download_array
declare -A download_array
find_dependencies $2
bugspray "Download list: $download_files" 3
echo "Download list v2:"
for x in $download_files ; do
bugspray " File \"$x\" from repo \"${download_array[$x]}\"" 3
echo " Full URL: http://mirror.archlinux.org/${download_array[$x]}/os/$arch/$x" ; done
verint) # Debugging
(( DEBUG == 0 )) && echo "the \"verint\" option is only for debugging" && exit 0
for x in `ls .temp-alpps/*/$2-*/desc` ; do
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$2 ]] ; then
bugspray "Unique package-name file found: $packagename=$2" 2
distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
package_full=$packagename-$distantversion
the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
the_path=`echo $x|sed -r 's/desc//'`
local_version=`sed -r '/^'$packagename' /!d;s/.* //' .temp-alpps/snapshot.state`
break ; fi ; done
echo "full package filename: $dlfile"
echo "Comparing local ($local_version) and distant ($distantversion) versions of $2..."
compare_versions $local_version $distantversion
#compare_versions 2.5beta3-2 2.5cvs4-1
echo "...and the verdict is: $update"
init)
x=`uname -m`
if [[ -x /usr/bin/pacman ]] ; then
[[ -d .temp-alpps ]] || mkdir .temp-alpps/
pacman -Q>.temp-alpps/snapshot.state
sed -r '/^Se/!d;s/Server = //' /etc/pacman.d/mirrorlist>.temp-alpps/snapshot.mirrorlist
sed -r '/^\[/!d;/options/d;s/\[(.*)\]/\1/' /etc/pacman.conf>.temp-alpps/snapshot.repositories
sed -r '/^Architecture/!d;s/^.*= //' /etc/pacman.conf>.temp-alpps/snapshot.architecture
[[ ! -s .temp-alpps/snapshot.architecture || auto == $(<.temp-alpps/snapshot.architecture) ]] && $x>.temp-alpps/snapshot.architecture
sed -r '/^SyncFirst/!d;s/.*= //;s/ /\n/g' /etc/pacman.conf>.temp-alpps/snapshot.prioritypackages
echo "Current state recorded."
else
echo "You seem to be running ALPPs on an unsupported system."
echo "ALPPS is the ${lgreen}Arch Linux Pacman Proxy Script${dull} and simply"
echo "won't run properly on a non-pacman OS (except when proxying)."
echo "Aborting. Sorry."
exit 1 ; fi
fetchdb)
[[ -d downloads ]] || mkdir downloads
arch=$(<.temp-alpps/snapshot.architecture)
declare -A download_array
for repo in $(<.temp-alpps/snapshot.repositories) ; do
download_array[${repo}.db]=$repo
location="${repo}.db"
failover_fetch $location ; done
if [[ j$2 != jsimple ]] ; then
[[ -d log-alpps ]] || mkdir log-alpps
[[ -a syncfirst ]] && rm -f syncfirst
echo "Preparing databases for local processing. This might take a while."
for x in $(<.temp-alpps/snapshot.repositories) ; do
echo "Preparing $x.db"
if [[ -a downloads/$x.db ]] ; then
[[ -d .temp-alpps/$x.db ]] || mkdir .temp-alpps/$x.db/
tar -xzC .temp-alpps/$x.db/ -f downloads/$x.db --transform 's/:/§/' --no-same-owner && echo "$x database ready for use."
else
echo -e "Database $x.db is missing. Skipping. This will probably cause problems." ; fi ; done
# SyncFirst package warning
[[ -z $download_list ]] || unset download_list
[[ -a syncfirst ]] && rm -f syncfirst
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
find_dependencies $x ; done
bugspray "download_files: $download_files" 2
if [[ ! -z $download_files ]] ; then
echo "New version(s) of SyncFirst package(s):"
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
[[ ! -z `echo $download_files|grep $x` ]] && echo "- $x" && echo $x>>syncfirst ; done
echo "Package names placed in 'syncfirst'. Don't forget to download them!" ; fi ; fi
fetch)
for x in $(<.temp-alpps/snapshot.repositories) ; do
if ! [[ -d .temp-alpps/$x.db/ ]] ; then
bugspray "You must first download a fresh database with the \"fetchdb\" option" 0
exit 1 ; fi ; done
arch=$(<.temp-alpps/snapshot.architecture)
unset download_array
declare -A download_array
unset download_files
if [[ $2 == full ]] ; then
echo " Building full upgrade list. This will almost certainly take a while."
echo " Please wait..."
for y in `sed -r 's/^(.*) .*/\1/' .temp-alpps/snapshot.state` ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
elif [[ -a $2 ]] ; then
echo " Determining dependencies. This might take a while. Please wait."
for y in $(<$2) ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
else
echo " Error: you should provide a list-file or the keyword \"full\"."
echo " (see 'alpps.sh howto', step 2)"
exit 1 ; fi
if [[ -z $download_files ]] ; then
echo " No files to download: either none found, or all found are up to date."
else
[[ -d downloads ]] || mkdir downloads
for x in $download_files ; do
failover_fetch $x ; done ; fi
install)
dbpath=`sed -r '/^DBPath/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $dbpath ]] && dbpath="/var/lib/pacman/"
bugspray "dbpath: $dbpath" 2
echo " Updating databases"
cp -ft ${dbpath}sync/ downloads/*.db
cachedir=`sed -r '/^CacheDir/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $cachedir ]] && cachedir="/var/cache/pacman/pkg/"
echo " Caching packages"
cp -f downloads/*.pkg.tar.xz $cachedir
echo
echo " Don't forget to install/update your packages."
echo " Exercise proper caution."
echo " Have fun!"
clean)
echo "Cleaning up. This might take a while."
rm -fr .temp-alpps/ && echo "Buffer directory deleted" || echo "Problem deleting buffer directory '.temp-alpps/'"
rm -fr log-alpps/ && echo "Log directory deleted" || echo "Problem deleting 'log-alpps/'"
rm -fr downloads/ && echo "Downloaded packages deleted" || echo "Problem deleting 'downloads/'"
echo
echo -e " ${lgreen}Arch Linux pacman proxy script${dull}"
echo
echo -e " ${green}Description${dull}"
echo -e " ${green}===========${dull}"
echo -e " This is a bash script to fetch and install packages for an offline Arch box"
echo " using another, online box as a proxy of sorts. So far, this only works if"
echo " the proxy box has bash, wget, tar, sed and grep installed."
echo " It's probably also entirely unsafe, incompatible and will destroy your box"
echo " in a fiery blaze if you try to use it (you know the drill)."
echo
echo -e " ${green}Options${dull}"
echo -e " ${green}=======${dull}"
echo " init Step 0 (as it were): take a snapshot of your system"
echo " fetchdb Step 1: download the packagelist database"
echo " fetch <file> Step 2: download requested packages"
echo " install Step 3: update your system"
echo " clean Step 4: delete any unneeded files"
echo
echo " howto More detailed instructions"
echo " bugs Problems and future plans"
echo " faq As it says"
echo " warranty (in case it ever becomes necessary)"
echo " version (to be honest, I wasn't expecting to go beyond v1-rc or so)"
echo " help You're reading it, doofus :^)"
echo
# dl_list Test the find_dependencies function"
# verint Test the compare_versions function"
esacAnimaInvicta wrote:
Since my Arch box has no internet connection (yes, I'm that much of a masochist), I wrote a bash script to act as a proxy of sorts for pacman, at least as regards downloading. It took a while to get it working (intermittent web access and all) but here it finally is, as promised.
It works well for me, and I only hope that it will help anyone else in the same situation (if there is anyone else in the same situation).
The script has various options to explain everything you need to know, but here's a quick word of warning: it only works on POSIX-compatible computers (i.e. no Wintendows, usually) and the proxy box needs to have bash, wget, tar, grep and sed installed. I don't see this as being a problem, but if I'm wrong, tell me all about it.
#!/bin/bash
readonly VER="2.1"
readonly wgetVER=`wget -V|sed '1!d'`
# DEBUG levels:
# Set to 0 for ALERT-level messages only
# Set to 1 for INFO-level messages (I prefer this)
# Set to 2 for DEBUG-level messages
# Set to 3 for all messages
readonly DEBUG=0
# Set DEBUGLOG=1 to print ALERT, INFO and DEBUG messages to DEBUG.log
readonly DEBUGLOG=0
readonly COLOUR=true
if [[ $COLOUR == true ]] ; then
readonly red='\e[31m'
readonly warn='\e[31;7m '
readonly green='\e[32m'
readonly lgreen='\e[32;1m'
readonly yellow='\e[33;1m'
readonly lblue='\e[34;1m'
readonly dull='\e[0m' ; fi
# Sticky details:
# tar seems very slow (vfat? transform? USB?)
function bugspray {
[[ -z $2 ]] && verbosity=1 || verbosity=$2
if (( DEBUG >= verbosity )) ; then
(( $2 == 0 )) && intro="${warn}ALERT${dull} | "
(( $2 == 1 )) && intro=" INFO | "
(( $2 > 1 )) && intro=" ${yellow}DEBUG${dull} | "
echo -e "$intro$1"
(( DEBUGLOG == 1 )) && echo "`date +%F_%T` | $1">>log-alpps/DEBUG.log ; fi ; }
function compare_versions {
# Requires two ordinary, untweaked version strings, first local, second distant
if [[ -z $2 ]] ; then
bugspray "compare_versions didn't receive two variables." 2 ; fi
update='no'
[[ -z $2 ]] && return
local localversion=(`echo $1|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local distantversion=(`echo $2|sed -r 's/([[:alpha:]]+)/ \1 /g;s/[\.:~_-]/ /g'`)
local max=$((${#distantversion[*]}))
bugspray "localversion: ${localversion[*]}; distantversion: ${distantversion[*]}" 2
for (( x=0 ; (( x < $max )) ; $((x++)) )) ; do
bugspray "local version part: `echo ${localversion[$x]}` | distant version part: `echo ${distantversion[$x]}`" 2
if [[ `echo ${localversion[$x]}|grep -E '^[0-9]*$'` && `echo ${distantversion[$x]}|grep -E '^[0-9]*$'` ]] ; then
bugspray "Numerical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): $(( 10#${localversion[$x]} < 10#${distantversion[$x]} ))" 3
# Different compare methods for numbers, single letters and multiple letters.
if (( 10#${localversion[$x]} < 10#${distantversion[$x]} )) ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]$'` ]] ; then # single letter -> compare
bugspray "Lexicographical comparison" 2
bugspray "localver (${localversion[$x]}) less than distantver (${distantversion[$x]}): [[ ${localversion[$x]} < ${distantversion[$x]} ]]" 3
if [[ ${localversion[$x]} < ${distantversion[$x]} ]] ; then
update='yes'
break ; fi ; fi
if [[ `echo ${localversion[$x]}|grep -E '^[[:alpha:]]+$'` && `echo ${distantversion[$x]}|grep -E '^[[:alpha:]]+$'` ]] ; then # string -> drop
# cvs / git / beta -> what are the rules?
bugspray "Sequence of letters. Not treating as version number." 2 ; fi
done ; }
function find_dependencies {
# Determine existence via unique path
bugspray "+ ${lgreen}Building download list for package \"$1\"${dull}" 1
local packagename
local dlfile
local package_found=no
if [[ `ls .temp-alpps/*.db/$1-* 2>/dev/null` ]] ; then
bugspray "Analogous package-name file(s) found" 2
for x in `ls .temp-alpps/*.db/$1-*/desc` ; do
bugspray "Checking $x" 2
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$1 ]] ; then
bugspray "Exact match found: $packagename = $1" 2
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
local distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
local package_full=$packagename-$distantversion
local the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
local the_path=`echo $x|sed -r 's/desc//'`
unplus=`echo $packagename|sed 's/\+/\\\+/g'`
local local_version=`sed -r '/^'$unplus' /!d;s/.* //' .temp-alpps/snapshot.state`
package_found=yes
break ; fi ; done ; fi
if [[ -z $dlfile ]] ; then
bugspray "Exact match not found -> looking for replacements." 2
if ! [[ -z `grep $1 .temp-alpps/*.db/*/depends` ]] ; then
local provisional=`grep $1 .temp-alpps/*.db/*/depends|sed -r 's/\/depends.*//'`
for package in $provisional ; do
local providence=`sed -r '/%PROVIDES%/,/^$/!d;/%PROVIDES%/d;/^$/d;s/>.*//;s/=.*//' $package/depends`
for y in $providence ; do
if [[ j$y == j$1 ]] ; then
# But what about when several packages provide the same thing and ALPPS picks the wrong one? Can it happen?
local newdep=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $package/desc`
bugspray " -> Package \"$newdep\" provides \"$1\"." 1
find_dependencies $newdep
break 2 ; fi ; done ; done
if [[ -z $newdep ]] ; then
bugspray "${warn}Warning:${dull} package \"$1\" not found in database." 0 ; fi ; fi ; fi
bugspray "package: $1 | package_found = $package_found" 2
# Add file to download_list if not up to date and if not already present
if [[ j$package_found == jyes ]] ; then
local already_got_one=no
unplus=`echo $dlfile|sed 's/\+/\\\+/g'`
[[ `echo $download_files|grep $unplus` ]] && already_got_one="yes" && bugspray "${green}Package in queue${dull}" 1
[[ `ls downloads/$dlfile 2>/dev/null` ]] && already_got_one="yes" && bugspray "${green}Package proxied${dull}" 1
compare_versions $local_version $distantversion
bugspray "compare_versions says: $update" 2
! [[ -z $local_version || $update == yes ]] && already_got_one="yes" && bugspray "${green}Package already installed and up-to-date${dull}" 1
if [[ j$already_got_one != jyes ]] ; then
bugspray "${green}Confirm downloading${dull}" 1
download_files+="$dlfile "
download_array[${dlfile}]=$the_repo
bugspray "Checking for further dependencies" 2
if [[ -a $the_path/depends && `grep -E '^%DEPENDS%$' $the_path/depends` ]] ; then
local dependency=`sed -r '/%DEPENDS%/d;/^$/q' $the_path/depends`
bugspray "Dependencies of \"$packagename\":$dependency" 3
for x in $dependency ; do
# Is this dependency already installed? Sort-of the same as higher up; it just saves time here.
local depname=`echo $x|sed -r 's/>.*//;s/=.*//'`
local depminver=`echo $x|sed -r 's/.*>//'`
bugspray "Dependency name: \"$depname\"" 2
if ! [[ `grep -E '^$depname ' .temp-alpps/snapshot.state` ]] ; then
find_dependencies $depname ; fi ; done
else
bugspray "${lblue}End of the line${dull}: package \"$packagename\" has no dependencies." 2
true ; fi ; fi ; fi ; }
function failover_fetch {
echo "Downloading `echo $1|sed 's/.*\///'`"
[[ -d log-alpps/ ]] || mkdir log-alpps/
[[ -z $success ]] || unset success
for mirror in $(<.temp-alpps/snapshot.mirrorlist) ; do
# If DEBUG>0, shouldn't redirect output
url=`echo $mirror|sed 's/$arch/'$arch'/;s/$repo/'${download_array[$1]}'/'`/$1
bugspray "Connecting to $url" 2
wget -o .temp-alpps/very-temp-log -U "Arch Linux Pacman Proxy Script version $VER / $wgetVER" -P downloads/ $url && success=true
cat .temp-alpps/very-temp-log>>log-alpps/download.log
rm -f .temp-alpps/very-temp-log
if [[ -n $success ]] ; then
bugspray "Download: \$success = true" 2
break ; fi ; done
if [[ -z $success ]] ; then
bugspray "${warn}FAIL:${dull} $1 not accessible on known mirrors." 0 ; fi ; }
case $1 in
warranty)
echo
echo -e " ${green}Warranty${dull}"
echo -e " ${green}========${dull}"
echo " This program is free software. It comes without any warranty, to"
echo " the extent permitted by applicable law. You can redistribute it"
echo " and/or modify it under the terms of the Do What The Fuck You Want"
echo " To Public License, Version 2, as published by Sam Hocevar. See"
echo " http://sam.zoy.org/wtfpl/COPYING for more details."
echo
howto)
echo
echo -e " ${green}How to use ALPPS${dull}"
echo -e " ${green}================${dull}"
echo -e " ${yellow}+ Step 0${dull}: prime the engine"
echo " On your offline box, copy the ALPPS script onto a removable medium, cd into"
echo " it's directory, then run it with the \"init\" option. This essentially"
echo " takes a snapshot of your system, package-wise. Your removable medium is"
echo " now ready for use!"
echo -e " ${yellow}+ Step 1${dull}:"
echo " On the proxy box the first order of business is to download and decompress"
echo " the current package lists. You can do this with the \"fetchdb\" option."
echo -e " ${yellow}+ Step 1 alt${dull}:"
echo " If you want to download the package lists without decompressing them,"
echo " \"fetchdb simple\" will do this. It's a lot quicker, but please keep"
echo " in mind that you cannot then do anything in step 2."
echo -e " ${yellow}+ Step 2${dull}:"
echo " If you want to download packages (and why wouldn't you?), the easiest way"
echo " is to prepare a simple text file containing the names of the packages you"
echo " want, one on each line. Run ALPPS with the option \"fetch <filename>\" and"
echo " sit back and wait until it's done. Don't worry about dependencies: ALPPS"
echo " handles them automatically."
echo -e " ${yellow}+ Step 2 alt${dull}:"
echo " As a convenience, \"fetch full\" will download all the packages needed to"
echo " update the offline box."
echo -e " ${yellow}+ Step 3${dull}:"
echo " Finally, back on your offline box, run ALPPS again with the \"install\""
echo " option. This will update the package list and copy the package files into"
echo " local cache. You can now run \"pacman -S <package names>\" to finish"
echo " installing the packages."
# ALPPS no longer installs the packages, just caches them locally.
# Not entirely sure why; it just felt too klutzy.
echo -e " ${yellow}+ Step 4${dull}:"
echo " You will now probably want to delete all the stuff you no longer need. Run"
echo " ALPPS with the option \"clean\". This won't touch your request file(s). It"
echo -e " ${red}WILL${dull} delete log files, so if you want to keep them, back them up first."
echo " Next time you do this, don't forget to run ALPPS with \"init\" again."
echo
bugs)
echo
echo -e " ${green}Where this goes wrong${dull}"
echo -e " ${green}=====================${dull}"
echo " + ALPPS is a bit slow when packages have many dependencies. It's a recursive"
echo " shell script: what did you expect?"
echo " + It only uses the settings in /etc/pacman.conf. If your conf file is"
echo " elsewhere, you're SOL. Similarly, the repositories are all taken from"
echo " /etc/pacman.d/mirrorlist. If you added any custom repositories in"
echo " /etc/pacman.conf (or any other file), ALPPS ignores them."
echo " + As it stands, ALPPS only works when the proxy box has bash, wget, sed,"
echo " grep and tar installed. The offline box needs bash, pacman and sed (in"
echo " theory, this shouldn't be a problem...)."
echo " + There is as yet no way of handling package groups, short of listing every"
echo " member of the group."
echo " + I don't think ALPPS will ever be able to handle AUR packages. Of course, if"
echo " you're compiling AUR packages, you probably won't need something like this!"
echo
faq)
echo
echo -e " ${green}Frequently Asked Questions${dull}"
echo -e " ${green}==========================${dull}"
echo
echo -e " ${red}Q:${dull} Can I run the whole thing off a USB stick?"
echo -e " ${lblue}A:${dull} Certainly."
echo
echo -e " ${red}Q:${dull} Can I use a non-POSIX computer as a proxy (e.g. Windows)?"
echo -e " ${lblue}A:${dull} Probably not, unless that computer has a POSIX-compatibility layer"
echo " installed (such as Cygwin) with bash, wget, tar, sed and grep."
echo
echo -e " ${red}Q:${dull} Do I need to download the package list, waste time updating my computer,"
echo " then go back again to download the packages I want?"
echo -e " ${lblue}A:${dull} Nope! You can update the packagelist database and download piping-hot"
echo " fresh packages, all in one sitting."
echo -e " ${red}Q:${dull} You mean I won't have to futz around with package lists that keep updating"
echo " ten minutes after I download them?"
echo -e " ${lblue}A:${dull} Exactly. Nice, isn't it?"
echo
echo -e " ${red}Q:${dull} Does this thing handle SSL and signed packages?"
echo -e " ${lblue}A:${dull} ALPPS uses SSL if:"
echo " - the mirror has an https address (at present, none do), and"
echo " - wget on the proxy box is compiled with SSL support"
echo " Concerning signed packages: no, but then again, it doesn't need to. ALPPS"
echo " downloads packages; it's pacman's responsibility to verify them. Your"
echo " system remains safe (or as safe as it ever was, at any rate)."
echo -e " ${red}Q:${dull} What about gpg keys? I need to get them."
echo -e " ${lblue}A:${dull} ...maybe later, say, in version 3."
echo
echo -e " ${red}Q:${dull} ALPPS says it \`prepares databases´. Can pacman still use them after this?"
echo -e " ${lblue}A:${dull} Yes, it can. In fact, what ALPPS does is extract the databases into a"
echo " temp directory, without altering the original .db files."
echo
echo -e " ${red}Q:${dull} Where can I contact you?"
echo -e " ${lblue}A:${dull} For constructive, useful questions and comments: [email protected] and"
echo " be sure to mention Arch Linux in the subject."
echo " For flames, trolling, spam and the like, visit your local bitbucket."
echo
todo)
echo
echo -e " ${green}What's next?${dull}"
echo -e " ${green}============${dull}"
echo -e " + I ${red}might${dull} be able to extend the reach of this thing to the AUR."
echo " Yes, I know I said ALPPS couldn't (in \"bugs\"), but I've learned"
echo " something new since then. It'll be tricky, though, since the AUR web"
echo " interface delivers results in python. While this should be a Good Thing,"
echo " bash isn't very good at handling python-format lists and dicts."
echo
-v|ver|version|--ver|--version)
echo -e "${lgreen}Arch Linux pacman proxy script${dull} | ${yellow}version $VER${dull}"
dl_list) # Debugging
(( DEBUG == 0 )) && echo "the \"dl_list\" option is only for debugging" && exit 0
arch=$(<.temp-alpps/snapshot.architecture)
unset download_files
unset download_array
declare -A download_array
find_dependencies $2
bugspray "Download list: $download_files" 3
echo "Download list v2:"
for x in $download_files ; do
bugspray " File \"$x\" from repo \"${download_array[$x]}\"" 3
echo " Full URL: http://mirror.archlinux.org/${download_array[$x]}/os/$arch/$x" ; done
verint) # Debugging
(( DEBUG == 0 )) && echo "the \"verint\" option is only for debugging" && exit 0
for x in `ls .temp-alpps/*/$2-*/desc` ; do
packagename=`sed -r '/%NAME%/,+1!d;/%NAME%/d' $x`
if [[ j$packagename == j$2 ]] ; then
bugspray "Unique package-name file found: $packagename=$2" 2
distantversion=`sed '/%VERSION%/,+1!d;/%VERSION%/d' $x`
dlfile=`sed '/%FILENAME%/,+1!d;/%FILENAME%/d' $x`
package_full=$packagename-$distantversion
the_repo=`echo $x|sed -r 's/.temp-alpps\/(.*)\.db.*/\1/'`
the_path=`echo $x|sed -r 's/desc//'`
local_version=`sed -r '/^'$packagename' /!d;s/.* //' .temp-alpps/snapshot.state`
break ; fi ; done
echo "full package filename: $dlfile"
echo "Comparing local ($local_version) and distant ($distantversion) versions of $2..."
compare_versions $local_version $distantversion
#compare_versions 2.5beta3-2 2.5cvs4-1
echo "...and the verdict is: $update"
init)
x=`uname -m`
if [[ -x /usr/bin/pacman ]] ; then
[[ -d .temp-alpps ]] || mkdir .temp-alpps/
pacman -Q>.temp-alpps/snapshot.state
sed -r '/^Se/!d;s/Server = //' /etc/pacman.d/mirrorlist>.temp-alpps/snapshot.mirrorlist
sed -r '/^\[/!d;/options/d;s/\[(.*)\]/\1/' /etc/pacman.conf>.temp-alpps/snapshot.repositories
sed -r '/^Architecture/!d;s/^.*= //' /etc/pacman.conf>.temp-alpps/snapshot.architecture
[[ ! -s .temp-alpps/snapshot.architecture || auto == $(<.temp-alpps/snapshot.architecture) ]] && $x>.temp-alpps/snapshot.architecture
sed -r '/^SyncFirst/!d;s/.*= //;s/ /\n/g' /etc/pacman.conf>.temp-alpps/snapshot.prioritypackages
echo "Current state recorded."
else
echo "You seem to be running ALPPs on an unsupported system."
echo "ALPPS is the ${lgreen}Arch Linux Pacman Proxy Script${dull} and simply"
echo "won't run properly on a non-pacman OS (except when proxying)."
echo "Aborting. Sorry."
exit 1 ; fi
fetchdb)
[[ -d downloads ]] || mkdir downloads
arch=$(<.temp-alpps/snapshot.architecture)
declare -A download_array
for repo in $(<.temp-alpps/snapshot.repositories) ; do
download_array[${repo}.db]=$repo
location="${repo}.db"
failover_fetch $location ; done
if [[ j$2 != jsimple ]] ; then
[[ -d log-alpps ]] || mkdir log-alpps
[[ -a syncfirst ]] && rm -f syncfirst
echo "Preparing databases for local processing. This might take a while."
for x in $(<.temp-alpps/snapshot.repositories) ; do
echo "Preparing $x.db"
if [[ -a downloads/$x.db ]] ; then
[[ -d .temp-alpps/$x.db ]] || mkdir .temp-alpps/$x.db/
tar -xzC .temp-alpps/$x.db/ -f downloads/$x.db --transform 's/:/§/' --no-same-owner && echo "$x database ready for use."
else
echo -e "Database $x.db is missing. Skipping. This will probably cause problems." ; fi ; done
# SyncFirst package warning
[[ -z $download_list ]] || unset download_list
[[ -a syncfirst ]] && rm -f syncfirst
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
find_dependencies $x ; done
bugspray "download_files: $download_files" 2
if [[ ! -z $download_files ]] ; then
echo "New version(s) of SyncFirst package(s):"
for x in $(<.temp-alpps/snapshot.prioritypackages) ; do
[[ ! -z `echo $download_files|grep $x` ]] && echo "- $x" && echo $x>>syncfirst ; done
echo "Package names placed in 'syncfirst'. Don't forget to download them!" ; fi ; fi
fetch)
for x in $(<.temp-alpps/snapshot.repositories) ; do
if ! [[ -d .temp-alpps/$x.db/ ]] ; then
bugspray "You must first download a fresh database with the \"fetchdb\" option" 0
exit 1 ; fi ; done
arch=$(<.temp-alpps/snapshot.architecture)
unset download_array
declare -A download_array
unset download_files
if [[ $2 == full ]] ; then
echo " Building full upgrade list. This will almost certainly take a while."
echo " Please wait..."
for y in `sed -r 's/^(.*) .*/\1/' .temp-alpps/snapshot.state` ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
elif [[ -a $2 ]] ; then
echo " Determining dependencies. This might take a while. Please wait."
for y in $(<$2) ; do
bugspray "Examining $y" 1
find_dependencies $y ; done
else
echo " Error: you should provide a list-file or the keyword \"full\"."
echo " (see 'alpps.sh howto', step 2)"
exit 1 ; fi
if [[ -z $download_files ]] ; then
echo " No files to download: either none found, or all found are up to date."
else
[[ -d downloads ]] || mkdir downloads
for x in $download_files ; do
failover_fetch $x ; done ; fi
install)
dbpath=`sed -r '/^DBPath/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $dbpath ]] && dbpath="/var/lib/pacman/"
bugspray "dbpath: $dbpath" 2
echo " Updating databases"
cp -ft ${dbpath}sync/ downloads/*.db
cachedir=`sed -r '/^CacheDir/!d;s/^.*= //' /etc/pacman.conf`
[[ -z $cachedir ]] && cachedir="/var/cache/pacman/pkg/"
echo " Caching packages"
cp -f downloads/*.pkg.tar.xz $cachedir
echo
echo " Don't forget to install/update your packages."
echo " Exercise proper caution."
echo " Have fun!"
clean)
echo "Cleaning up. This might take a while."
rm -fr .temp-alpps/ && echo "Buffer directory deleted" || echo "Problem deleting buffer directory '.temp-alpps/'"
rm -fr log-alpps/ && echo "Log directory deleted" || echo "Problem deleting 'log-alpps/'"
rm -fr downloads/ && echo "Downloaded packages deleted" || echo "Problem deleting 'downloads/'"
echo
echo -e " ${lgreen}Arch Linux pacman proxy script${dull}"
echo
echo -e " ${green}Description${dull}"
echo -e " ${green}===========${dull}"
echo -e " This is a bash script to fetch and install packages for an offline Arch box"
echo " using another, online box as a proxy of sorts. So far, this only works if"
echo " the proxy box has bash, wget, tar, sed and grep installed."
echo " It's probably also entirely unsafe, incompatible and will destroy your box"
echo " in a fiery blaze if you try to use it (you know the drill)."
echo
echo -e " ${green}Options${dull}"
echo -e " ${green}=======${dull}"
echo " init Step 0 (as it were): take a snapshot of your system"
echo " fetchdb Step 1: download the packagelist database"
echo " fetch <file> Step 2: download requested packages"
echo " install Step 3: update your system"
echo " clean Step 4: delete any unneeded files"
echo
echo " howto More detailed instructions"
echo " bugs Problems and future plans"
echo " faq As it says"
echo " warranty (in case it ever becomes necessary)"
echo " version (to be honest, I wasn't expecting to go beyond v1-rc or so)"
echo " help You're reading it, doofus :^)"
echo
# dl_list Test the find_dependencies function"
# verint Test the compare_versions function"
esac
I've always resorted to use VPN, then I started using cntlm, this looks very useful (and a lot of work on your part!) Thanks alot!
DoctorZeus -
JRE proxy bypass for local addresses always bypasses proxy
Hi all,
I'm currently dealing with an issue with the proxy configuration in java.
Situation: I need a proxy server to connect to the internet, and I have some addresses configured in Internet Explorer that bypass the proxy.
example of the way I configured it : *.google.com;212.115.*;62.69.179.198
The address that I am trying to reach is not in the bypass list, or in any of the excluded ranges in the bypass list.
Initially I had java configured using browser settings. I thought it did not pick up the browser settings at all.
However after configuring the proxy manually in java it was still not working.
During the research I came to the conclusion that as soon as I enable the "bypass proxy server for local addresses" in Internet Explorer, or manually in java.
The JRE client automatically bypasses the proxy and is always using "proxy=direct" . As soon as I disable that feature it starts using the proxy server.
I have no idea why this is happening ?Your message was an eye opener for me. Thanks!
You were right, that option shouldn't be enabled. During testing I got confused and was told that option needed to be enabled to enable the exception list.
But that was a stupid assumption.
I disabled the option bypass proxy for local addresses and just filled in the exception list and now it works again. -
Hi all,
Basically we have users that will use dongles to work from home when they are not in one of our offices. We need the proxy settings to be disabled when they are not on the network and we dont really want the users having to change the setting themselves.
The website
PeteNetLive - KB0000181 - Defining / Locking and Managing Proxy Settings gave me this which basically will ping the proxy, If it responds it turns the proxy on, If it doesnt it turns it off. The script doesnt seem to work though, i get a Microsoft VBScript
Compilation error. This is before and after i put my settings in. I unfortunatly am not very good a VBS scripts. Can anyone assist?
Thanks
::-----------------------Begin Script------------------------------------ @echo OFF
:: Check LAN connectivity
PING 192.168.99.254 | FIND "TTL" > NUL
IF NOT ERRORLEVEL 1 GOTO ON_LAN
GOTO OFF_LAN
:ON_LAN
::**************Proxy ON**************
::Enable the Proxy Server (ticks the box "user a proxy server for your LAN...")
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
:: SET the proxy (fills in the Address and port values)
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings" /v ProxyServer /t REG_SZ /d "192.168.99.1:808" /f
:: Set the bypass proxy server for local addresses option - <local> ticks the box each subsequent entry is additional domains to bypass for
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings" /v ProxyOverride /t REG_SZ /d "<local>;*.local;www.dontproxy.com" /f
GOTO END
:OFF_LAN
::**************Proxy OFF**************
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\In ternet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
:END
::-----------------------End Script------------------------------------
Can anyone help?Hi,
That's not VBScript, that's batch. Save it with a .bat extension and try it.
Don't retire TechNet! -
(Don't give up yet - 12,700+ strong and growing) -
Quicktime X: proxy problems (waiting time)
Hello everyone,
I am having a problem which bothers me now for some time. My current university uses a proxy (http + https only). If I use safari for watching html5 videos or apple trailers in quicktime, the movie itself won't load for some time (sometimes 3min) and then start. If I use the internet without the proxy at another place, the loading starts instantaneous.
Besides this, if I use chrome and watch html5 videos or use flash (in any browser), I won't have this lag...
The proxy settings were set manually and also via the pac file my university provides, Perian is installed as a plugin for Quicktime X.
Any ideas?I reported this to Apple and after a lengthy wait they finally got back to me with something along the lines of "this has now been fixed in a future version of the OS". So basically they break things in new releases and make you pay for the fix (and probably call it a new feature in the process). Apple seems to be very fond of doing this.
-
WLC guest wireless proxy script for Apple iPhone
I have guest wireless setup on a 4402 WLC. I am using a wpad.dat (proxy.pac) proxy auto-config script to ensure guest traffic passes through a proxy. After a few attempts at creating a working proxy.pac file, Cisco TAC provided one that worked successfully for IE and Firefox (I realise only IE is offically supported by the WLC however my issue is not with an issue of browser-WLC compatibility).
I am after a proxy.pac proxy auto-config file that will work with Apple iPhone Safari browser (the script below does not). Manually specifying the proxy is not an option as Sarafi on the iPhone does not allow "proxy exceptions" to be specified.
The script I use which works fine with IE and Firefox is below:
function FindProxyForURL(url, host)
// variable strings to return
var proxy_yes = "PROXY 10.23.16.20:80";
var proxy_no = "DIRECT";
if (shExpMatch(url, "http://1.1.1.1*")) { return proxy_no; }
if (shExpMatch(url, "https://1.1.1.1*")) { return proxy_no; }
// Proxy anything else
return proxy_yes;Here is the Deployment Guide for Cisco Guest Access Using the Cisco Wireless LAN Controller, Release 4.0
http://www.cisco.com/en/US/docs/wireless/technology/guest_access/technical/reference/4.0/GAccess.html#wp1167844 -
How-To changing QuickTime setting by script
Hi There,
I'm a newbie of QuickTime, and I'm looking for a script that can change the QuickTime preferences on Windows.
If no script are already available it'll be nice even a link to documenation.
Thank you,
Stefano Lenzi
P.S.: If the answer is on a old thread please forgive me, I've searched but with no luckHi,
The following Adobe guide is very useful for scripting against objects:
http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
For example, chaning the colour of the caption to red would be:
Text1.caption.font.fill.color.value = "255,0,0"
Good luck,
Niall -
Quicktime auto record script?
I've been stuck on a few scripts lately, so I figured I could get some help here.
I'm trying to write a script for Quicktime Pro (7.0.3) that will automatically open quicktime, create a new video recording window, and then start that recording. I've got it to open quicktime, and thats about it. I usually don't have this much trouble with applescripting.
Is there some sort of applescript guide that someone could point me towards? or know the script commands to get it to work?
thanks.tell application "QuickTime Player"
activate
new audio recording
start
end tell
thats what I got so far. no luck. it'll open a new audio recording but it wont start it. the dictionary says that i should have a reference, but i don't know how to make it know that I'm telling it to start recording. I tried -start "untitled"- or -start "new audio recording"- and they don't seem to work.
next I tried
tell window "untitled"
start
end tell
still no luck. -
Trying to work on a script for QuickTime X, need help
So, I've been working on scripts to restore some functionality back to QuickTime X (mainly the preferences part of QuickTime).
http://web.me.com/celebi23/QuickTimeXScripts/Main.html
http://discussions.apple.com/thread.jspa?threadID=2135161
I'm now trying to implement the "Recent Items" selection.
I almost have it all set up. It still won't make the selection though >_< The script won't open when I'm in QuickTime (via the script menu. all of the others open just fine. Have to run it from the AppleScript Editor to test it out). All of the individual Terminal commands work just fine though. Oh & there's an invalid connection with QuickTime apparently >_<
<a class="jive-link-external-small" href="http://">http://i23.photobucket.com/albums/b355/eisnerguy1/Recent_Items.p ng
"set recentItems to {"None", "5", "10", "15", "20", "30", "50"}
display dialog (choose from list recentItems with prompt "Select the amount of Recent Items.")
if recentItems is "None" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 0"
else if recentItems is "5" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 5"
else if recentItems is "10" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 10"
else if recentItems is "15" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 15"
else if recentItems is "20" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 20"
else if recentItems is "30" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 30"
else if recentItems is "50" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 50"
end if
display dialog "Please restart QuickTime Player for the preference changes to take effect." & return buttons {"Restart QuickTime Player"} default button 1 with icon alias ((path to me) & "Contents:Resources:QuickTimePlayerX_128.icns" as string)
copy the result as list to {restartButton}
if restartButton is "Restart QuickTime Player" then
tell application "QuickTime Player" to quit
tell application "QuickTime Player" to open
end if"
Still trying to figure out how to include the "Restore Defaults" button. The code would be something like this. It would go before the restart dialog. Not sure where in the code to include the "Restore Defaults" button though >_<
"defaults delete com.apple.QuickTimePlayerX NSRecentDocumentsLimit"
end if"
Any help would be greatly appreciatedThank you. The script now loads but, the preference never stays set. I chose "5" & the recent items still continue to be added to the recent items list. I've got 10 items in my "recent items" list even though I chose "5". The Terminal commands themselves work fine though
set recentItems to {"None", "5", "10", "15", "20", "30", "50"}
display dialog (choose from list recentItems with prompt "Select the amount of Recent Items.")
if recentItems is "None" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 0"
else if recentItems is "5" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 5"
else if recentItems is "10" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 10"
else if recentItems is "15" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 15"
else if recentItems is "20" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 20"
else if recentItems is "30" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 30"
else if recentItems is "50" then
do shell script "defaults write com.apple.QuickTimePlayerX NSRecentDocumentsLimit 50"
end if
set buttonClicked to button returned of (display dialog "Please restart QuickTime Player for the preference changes to take effect." & return buttons {"Restart QuickTime Player"} default button 1 with icon alias ((path to me) & "Contents:Resources:QuickTimePlayerX_128.icns" as text))
if buttonClicked is "Restart QuickTime Player" then
tell application "QuickTime Player" to quit
delay 3 -- give the app time to quit, otherwise the next command may fail
tell application "QuickTime Player" to activate
end if
I took out the "Restore Defaults" because, according to the Terminal
There is no (NSRecentDocumentsLimit) default for the (com.apple.QuickTimePlayerX) domain.
Defaults have not been changed.
Message was edited by: Alex Brofsky
Message was edited by: Alex Brofsky
Message was edited by: Alex Brofsky -
Anyway to run etester scripts in proxy mode thru eME?
Our E-tester scripts were recorded thru proxy. Is there a way to have eME run these tests, but in navigation editor mode? The tests are failing when I kick the off in eME because they are playing back in Etester mode.
Hi Jim,
Interesting question! You're right that we will always try to use e-Tester to play back the scripts in eMe and that Navigation Editor playback is not a supported feature. I got together last night with some of our developers and kicked around some ideas about getting to the point you need to be at. That is, playing proxy based scripts back in eMe. One idea we came up with was to use a "Third Party Test" in eMe to kick of a java agent playback of a script. This would play back the proxy script in a thin client mode using Java agent (meaning that you would need to turn on the generate java agent script option in e-Tester and re-save the file). Before I get to the specifics of how this may be done, let me ask a couple questions:
1.) The first natural question is "Why is there a need to play proxy based scripts in eMe"? I would think for regression testing there would be more of a need for event based automation rather than http playback
2.) What level of detail are you looking for in the results reporting?
The answer to those questions will certainly help us here at Empirix understand some of the requirements that are out in the market.
OK, so let's get to the details of how to do the thin client playback. Remember also that just because we can do something doesn't mean we should and also remember that what I am about to discuss is not an "officially supported" feature so the correct forum for troubleshooting will be here on QAZone and not in the support call center. Also take note that if the following details look too involved that we can always do the work for you in a consulting engagement. Please discuss that with your Account Manager.
I created a basic script against one of our demo applications and called it "script2". I saved this script in my "User_Day" workspace. My options were set to create a java agent thin client script (script2.jwg) in addition to the standard thin client script (script2.wg). I can now do a command line playback of this script by going to the c:\empirix\etest directory and typing the following line at the command prompt:
C:\Empirix\eTEST>c:\empirix\empappserver\jre\bin\java -cp c:\empirix\etest\jagen
t\jars\EntryPointWrapper.jar com.empirix.jagent.EntryPointWrapper com.empirix.jw
gPro.JWGLauncherEntryPoint -jwg c:\empirix\etest\User_Day!\script2.jwg
By incorporating this command into a batch file we can now set up a "Third Party Test" for execution. Now this will only execute the test but will not tell you if the test passed or failed. In order to get the pass/fail condition we need to modify some of the property files of the java agent to create a log file that we can also type to the command line output in our batch file or parse in some other way. To do that we need to edit the log4jJavaAgentDebug.xml file:
We need to change the entry: "<category name="com.empirix.lbrowser.http.RSyncConnection.Socket.ResponseContent">
<priority value="warn"/>"
to read: " <category name="com.empirix.lbrowser.http.RSyncConnection.Socket.ResponseContent">
<priority value="DEBUG">"
and change the entry: "<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="INFO"/>"
to read: " <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Threshold" value="DEBUG"/>"
The warning here is that you don?t want to do this on a machine that would be acting as a load testing agent as the debug logging will cause load performance problems and generate a ton of data. The changes will result in an "agent.log" file being created. If playback goes well and everything passes then the result will be a blank file. If there are problems on playback then there will be exceptions listed in the log file.
There are ways to change the pass condition to create something other than a blank file for successful playback but it would require edits to the scriptCallback.java file ... something along the lines of:
Logger log=Logger.getLogger("myScriptCallback);
log.info("EverythingPassed")
Let's not worry about that for now. The bottom line is that there are ways to get around the playback problems you are seeing in eMe. This is just one approach ... As I mentioned before another approach, and maybe better approach would be to determine why the scripts are proxy based scripts and not standard e-Tester automation based scripts.
Let me know what you think or if you have any questions or comments ....
-Rick -
Proxy Settings Issue Adobe Creative Cloud
Hello,
I am running the Adobe Creative Cloud Desktop App for Windows 7 and it cannot connect to the Internet when my IE proxy settings are set to "automatically detect"
The isssue can be allieveiated if I manually enter in the proxy server and port as stated in http://forums.adobe.com/thread/1264828
This does not pwork well in my environment because we use a proxy script to send web traffice to other proxies
Is there any other way to get the Adobe Creative Cloud Desktop App to connect to the Internet?[email protected] I would recommend reviewing the Adobe Creative Cloud Service Access Documentation for IT section of http://www.adobe.com/devnet/creativesuite/enterprisedeployment.html. In particular the Network Endpoint documentation maybe useful to help ensure requests to those addresses are handled properly.
-
Like the title says, im downloading itunes or even the quicktime update, just as its about to be finished a mssg pops up saying the older version of quicktime cant be removed. Ive tried to remove it through the control panel and in the drop down menu for quicktime itself. Any help would be greatly appreciated!
follow support article 2738 remove all old install files with VB script tool. However, after seperate installs of Safari, I tunes or Quicktime, run VB script tool 5.6 . Error 2738 does not show up on my PC it simply says location is only a network resourse.
-
Quicktime X exports do not play correctly in Firefox
Get a movie and export it to 'save for web' option 'Computer. Quicktime X will make a folder on your destkop or movie folder. Now open the index file with firefox. click on the movie to play it.
BROKEN
On the other end if you drag the movie to the screen it will play in firefox with the quicktim 7 interface...huh?Here is my two cents on this subject.
1) If you follow the direction here (http://www.creativetechs.com/iq/embediphone_friendly_videos_on_yourwebsite.html) at this website using Quicktime 7 it works just fine after you make the necessary changes to the html(i.e. the correct path to your movie/poster image). But if you follow what is essentially the same steps with Quicktime X (where Export for web is now called saved for web instead) I dont get it to work. One major difference is the code that is generated. The scrip that goes in the <head> section if slightly different as they seem to use different java.
see below
<head> script with Quick7
<script src="http://www.apple.com/library/quicktime/scripts/ac_quicktime.js" language="JavaScript" type="text/javascript"></script>
<script src="http://www.apple.com/library/quicktime/scripts/qtp_library.js" language="JavaScript" type="text/javascript"></script>
<link href="http://www.apple.com/library/quicktime/stylesheets/qtp_library.css" rel="StyleSheet" type="text/css" />
<head> script with Quick X
<script src="http://www.apple.com/library/quicktime/2.0/scripts/prototype.js" language="JavaScript" type="text/javascript"></script>
<script src="http://www.apple.com/library/quicktime/2.0/scripts/qtp_poster.js" language="JavaScript" type="text/javascript"></script>
<link href="http://www.apple.com/library/quicktime/2.0/stylesheets/qtp_poster.css" rel="StyleSheet" type="text/css" />
The other major difference is the <body> code that is generated between the two versions. See below
Quick7
<script type="text/javascript"><!--
QTWritePosterXHTML('Click to Play', 'Amusing-poster.jpg',
'Amusing.mov',
'455', '357', '',
'controller', 'true',
'autoplay', 'true',
'bgcolor', 'black',
'scale', 'aspect');
//-->
</script>
<noscript>
<object width="455" height="357" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="Amusing-poster.jpg" />
<param name="href" value="Amusing.mov" />
<param name="target" value="myself" />
<param name="controller" value="false" />
<param name="autoplay" value="false" />
<param name="scale" value="aspect" />
<embed width="455" height="357" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"
src="Amusing-poster.jpg"
href="Amusing.mov"
target="myself"
controller="false"
autoplay="false"
scale="aspect">
</embed>
</object>
</noscript>
Quick X
Now I'm more of designer than a coder, but even I see the huge difference between the two. With Quick X the body code is way less and is a link.
This would be cool if it worked perfectly, as less code is good with me, but it doesn't. It wont play in Firefox. It works for the most browsers, especially safari.
When I tried to get to work in Firefox locally on my Mac, I was able to make it play after correcting the html, but it would open in a new page and center the movie all by itself. Not exactly the results I wanted.
Does anyone have a solution to this problem.
The new interface with Quick7 looks slick and I would like to use it,but not if its going to be this broken. -
Does icloud notes synchronization work behind a proxy
Basically all icloud syncing works with the exception of notes behind our corporate proxy server.
Reminders, contacts, calendar all work fine.
Just notes that doesn't, if I turn off proxy and go on to guest wirless which has direct connection it works fine.
Has anyone else got the same issue?
Have tired using http web proxy settings and proxy script as wellSimilar problem: I noticed Notes is not updating to the iCloud properly. Are there any additional ports (TCP/UDP?) that need to be open to sync Notes to iCloud. I would welcome a technical answer to this problem that I can relay to our network people.
-
QuickTime 7 error: changes duration when performing Add and Scale
Sometimes, when using "Edit - Add to Selection & Scale" to place an image over a portion of a movie, QuickTime Player 7 will incorrectly change the duration of the movie, sometimes increasing the time by HOURS!
This may be an old problem, but I couldn't find any mention of it in the past year on the forum.
To make it easy to reproduce, I created the following AppleScript. Usually I can only get 5 to 10 iterations before failure.
(* Demonstrate QuickTime bug
This script demonstrates an error that QuickTime Player 7 commits when adding an image to a movie.
(This error also occurs when performing this operation manually, but it's faster to use AppleScript to demonstrate it.)
R. Lougheed, December 2010
set maxTestCount to 90 -- QuickTime has a limit of 99 tracks
set sampleMovie to (choose file with prompt "Select a movie" default location (path to movies folder) without invisibles)
tell application "QuickTime Player 7"
activate
close every document saving ask
open sampleMovie
set movieRef to (a reference to document 1)
-- get a frame to paste in
tell movieRef
set movieDuration to duration
tell me to set midTime to round (movieDuration / 2)
set current time to midTime
copy
end tell
end tell
set inTime to round (movieDuration / 3)
set outTime to 2 * inTime
set successCount to 0
set newMovieDuration to movieDuration
repeat until ((newMovieDuration ≠ movieDuration) or (successCount > maxTestCount))
with timeout of (1 * hours) seconds -- default timeout is 2 minutes
tell application "QuickTime Player 7"
activate
tell movieRef
select at inTime to outTime
add with scaled -- this should NOT change the duration of the movie
set newMovieDuration to duration
if newMovieDuration = movieDuration then set successCount to successCount + 1
end tell
end tell
end timeout
end repeat
activate
if newMovieDuration = movieDuration then
display dialog ("QuickTime Player successfully ran " & successCount & " Add-with-scale operations.") buttons {"Great!"} default button 1
else
display dialog ("QuickTime Player erroneously changed the movie duration after " & successCount & " successful operations.") buttons {"Bummer"} default button 1
end ifThank you very much Hiroto !! But I've still some issue that I can't resolve by my self...
I don't understand how to take this script (who works very well) and to use it in a different file. Actually, I wanna ask this script by 6 different other applescript file with a different movie (one in English, one in French, one in German, one in Dutch, one in Spanish and one in Italian). So I try an applescript like this :
set FR to LancerFilm()
tell FR
quitQT()
set x to "/Desktop/Robin.des.bois.2010.DVDrip.VF.XVid.avi"
setFilm(x)
startFilm()
end tell
I tried this code at the end of the file who contains the main script and in an other file. For the first one, I receive an error message who says me : +Can't find the file /Desktop/Robin.des.bois.2010.DVDrip.VF.XVid.avi+. And for the second one (wich is the solution that I wanna have for the final script), the system says me : +<<scrip>> doesn't understand the message LancerFilm+.
If somebody can help me it will be awesome.
I have an other question. At the end of the movie what must I do to launch another movie, automatically (so in the same script) in loop ?
PS: Sorry for my pour English
Maybe you are looking for
-
Laptop screen just goes dark and i have to cold boot
Hello. My Macbook Pro 2.66Ghz i7, running 10.8 keeps crashing, in various programmes and its getting annoying. The screen just goes dark but the lights stay on on the keyboard (if thats any help) and i have to cold boot. Ive got a crash log from cons
-
How to display multiple clocks in menu bar?
Is there an app that can display multiple clocks in different time zones, side by side, like the regular system clock? http://d.pr/i/P6Zr
-
HTML tags not displayed when using Data Template
Hi All... I'm developing a BI Publisher report in which one of the columns is a clob data type. I'm using an xsl stylesheet to format the data present in the clob column. I've developed the report using data template as the data set. The problem is t
-
This is being a pain in the but that i have to wait evertime i go to a video so plz help me
-
Button issues after deployment
We are having a problem with some buttons after importing an application from another workspace. The issue that we are seeing is that some of our processes and branches that are conditional based on "When Button Pressed" are being changed from a name