After that, it obtains the name servers for that TLD, and queries the glue records there, both using dig.
Here is a little shell script which implements Alnitak’sanswer:
#!/bin/sh
S=${IFS}
IFS=.
for P in $1; do
TLD=${P}
done
IFS=${S}
echo "TLD: ${TLD}"
DNSLIST=$(dig +short ${TLD}. NS)
for DNS in ${DNSLIST}; do
echo "Checking ${DNS}"
dig +norec +nocomments +noquestion +nostats +nocmd @${DNS} $1 NS
done
Sometimes you want to run a batch file from a Task Scheduler task. For that, the user under which the task runs needs to Logon as a batch job right. If it hasn’t, you get this nice error message:
As ntrights uses a hard to remember SeBatchLogonRight name for it and I tend to forget the ntrights syntax, I wrote two batch files to grant or revoke the Logon as Batch Job rights for the specified user:
It also requires language-restructuredtext (which is convenient anyway as it adds reStructuredText syntax highlighting to Atom)
Pandoc is an almost universal converter between various file formats (input/output including reStructuredText, Markdown, LaTeX, docx, html, docbook, epub, etc. PDF output requires LaTeX)
Tables are always a hard thing in any markup. Luckily truben.no/table/ has a good table editor (it’s the same as table-editor.com) and can emit reStructuredText, Markdown, HTML and other formats.
More in the future
Give me some time, and I will post more about using the format and how it compares to my Markdown past.
Note that pandoc does not fully support reStructuredText (for instance not all table features are supported), but docutils rst2html.py does and also gives better warning/error information when parsing.
Here are some links about the reStructured syntax and how they can be rendered by rst2html.py:
Usually I use the old Borland grep.exe that still ships with Delphi. Too bad it is 16-bit app which does not recognise Unicode.
FindStr does. Though much slower and with limited regular expression capabilities, can do recursive searches too:
findstr /spin /c:"string to find" *.*
The /spin is a shortcut for these case insensitive command-line options (the full list of possible options is below):
/S Searches for matching files in the current directory and all
subdirectories.
/I Specifies that the search is not to be case-sensitive.
/N Prints the line number before each line that matches.
/P Skip files with non-printable characters.
Sometimes I leave out the /P to include binary files.
Copying skeleton files.
These files are for the users to personalise their cygwin experience.
They will never be overwritten nor automatically updated.
'./.bashrc' -> '/home/jeroenp//.bashrc'
'./.bash_profile' -> '/home/jeroenp//.bash_profile'
'./.inputrc' -> '/home/jeroenp//.inputrc'
'./.profile' -> '/home/jeroenp//.profile'
jeroenp@msmxp ~
$
It will copy some default files to your profile so you can modify them.
Since Cygwin will run ~/.bash_profile on logon, and that in turn starts ~/.bashrc (see below), I’ve modified the latter to run ~/.bash_aliases and bring those a bit in sync with my regular Mac machine:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
alias lsmod='ls -al|awk '\''{k=0;s=0;for(i=0;i<=8;i++){;k+=((substr($1,i+2,1)~/[rwxst]/)*2^(8-i));};j=4;for(i=4;i<=10;i+=3){;s+=((substr($1,i,1)~/[stST]/)*j);j/=2;};if(k){;printf("%0o%0o ",s,k);};print;}'\'''
cURL has some idiosyncrasies, for instance Cygwin shows the progress meter by default, but Mac OS X does not. I wanted to disable the cURL progress meter and you heed -sS for that.
ls doesn’t show you octal file modes by default, but chown and umask use them, so I’ve got the lsmod alias through stack-overflow.
I know, old knowledge, but I only recently added the below batch files to file collection.
Why? Because since a few Windows versions, the System process uses port 80 because IIS is installed by default in many configurations. And recently I had to do quote a bit of http communication work against a local machine outside the IIS realm.
:: http://stackoverflow.com/questions/22084561/difference-between-iisreset-and-iis-stop-start-command
:checkPrivileges
net file 1>nul 2>nul
if '%errorlevel%' == '0' ( goto :gotPrivileges ) else ( goto :getPrivileges )
:isNotAdmin
:getPrivileges
echo You need to be admin running with an elevated security token to run %0
goto :exit
:isAdmin
:gotPrivileges
:: net stop w3svc
:: net stop iisadmin
iisreset /stop
:exit
::pause
exit /b
Start IIS:
:: http://stackoverflow.com/questions/22084561/difference-between-iisreset-and-iis-stop-start-command
:checkPrivileges
net file 1>nul 2>nul
if '%errorlevel%' == '0' ( goto :gotPrivileges ) else ( goto :getPrivileges )
:isNotAdmin
:getPrivileges
echo You need to be admin running with an elevated security token to run %0
goto :exit
:isAdmin
:gotPrivileges
:: net start w3svc
:: net start iisadmin
iisreset /start
:exit
::pause
exit /b