Wrote a small script that goes into my monthly crontab.
It gets ftp://ftp.internic.net/domain/named.cache into /var/lib/named/named.cache.new, and logs when you need to copy it over into /var/lib/named/root.hint
Posted by jpluimers on 2013/07/31
Wrote a small script that goes into my monthly crontab.
It gets ftp://ftp.internic.net/domain/named.cache into /var/lib/named/named.cache.new, and logs when you need to copy it over into /var/lib/named/root.hint
Posted in *nix, Development, Linux, Power User, Scripting, Sh Shell, Software Development, SuSE Linux, wget | Leave a Comment »
Posted by jpluimers on 2011/05/30
When using wget for downloading from the command-line, sometimes you need cookies in netscape file format.
There is a Chrome cookie.txt export extension that makes exporting your cookies in that format easy.
It opens a window that contains the cookies relevant to the domain of the currently opened web-page. You copy/paste your cookies in format like this:
# Cookies for domains related to wordpress.com.
# This content may be pasted into a cookies.txt file and used by wget
# Example: wget -x --load-cookies cookies.txt https://wiert.wordpress.com/wp-admin/post.php?post=5767&action=edit
#
en.forums.wordpress.com FALSE / FALSE 1304919940 TESTCOOKIE home
en.support.wordpress.com FALSE / FALSE 1304920249 TESTCOOKIE home
wiert.wordpress.com FALSE / FALSE 1304920561 TESTCOOKIE home
en.wordpress.com FALSE / FALSE 1304920572 TESTCOOKIE home
It even includes the wget command-line example for loading the cookies using the –load-cookies option :)
–jeroen
Posted in *nix, Chrome, Power User, Web Browsers, wget | 3 Comments »
Posted by jpluimers on 2010/10/06
Thanks to an excellent post by Peter Sebastian from Jargon Technology, it was a breeze to upgrade.
I did the upgrade using Using the vMA virtual appliance, the statements are these:
After bringing the ESXi 4.0 box into maintenance mode, I performed these steps on an SSH connection to the vMA virtual appliance: Read the rest of this entry »
Posted in *nix, ESXi4, Power User, VMware, VMware ESXi, wget | Leave a Comment »
Posted by jpluimers on 2010/09/02
I needed a quick means to download the latest 7-zip from the command-line in Windows.
This batchfile makes use of these tools:
7-zip has a download page that contains lines like these:
<TD class="Item" align="center"><A href="http://downloads.sourceforge.net/sevenzip/7z465.exe">Download</A></TD>
Posted in *nix, 7zip, Batch-Files, Compression, Development, Power User, Scripting, Software Development, wget | Leave a Comment »
Posted by jpluimers on 2010/06/11
wget is a great tool for downloading from http, https or ftp.
It works on many platforms, and there is a win32 build of wget.
wget usually works, but when a website requires a referer (lots of them seem to), you need to add the referer option like this:
wget -m -np –referer=http://almico.com/sfdownload.php http://www.almico.com/installspeedfan440.exe
The -m -np part creates an on-disk structure for the url, which you need when downloading a complete tree.
I often find that practical even for single files too.
–jeroen
Posted in *nix, Power User, wget | Tagged: wget speedfan | 1 Comment »
Posted by jpluimers on 2010/04/09
A while ago, I asked a question on percentage expansion in batch-files on superuser.com: a great site with great answers, similar to stackoverflow.com and serverfault.com , but now for asking “Power User” kind of questions.
The percentage sign (%) in URL‘s is to escape (or URLencode) characters that should not be in a URL itself.
(Note that the old new thing had a very interesting article on URL encoding: there are many different opinions on how to to this ‘right’, and a few of these ‘right’ opinions are not always compatible with each other).
In Windows batch-files and the command-line, the percentage sign is used to expand environment variables, arguments and for loop indexes.
To make life ‘easier’, inside a batch-file, the percentage sign has a slightly different meaning than on the command-line itself.
This can break your batch-files when you use URL encoded parameters.
It does not matter if these parameters are quoted or not: cmd.exe expands them, unless you escape them properly.
So, the command for downloading the URL with wget (similar to curl) differs from running it on the plain command-line or in a batch-file.
So the best way to escape percentages in batch files is to double them: each % becomes %%.
There is even a very old (MS-DOS era!) knowledge base article about this topic, that I just found when doing the research for this blog article :-)
As a sidenote: manually decode thesed escaped URL’s is always a pain.
There are many sites that can do URL decoding on-line.
PS: This was the original question: How can I stop percentage expansion in a batch file? – Super User.
Posted in *nix, Batch-Files, CommandLine, Development, Encoding, Power User, Scripting, Software Development, URL Encoding, wget | 3 Comments »