[Archive.is] How is JavaScript used within the Spotify desktop application? Is it packaged up and run locally only retrieving the assets as and when needed? What JavaScript VM is used? – Quora
For my archive via a private share.
–jeroen
Posted by jpluimers on 2018/11/22
[Archive.is] How is JavaScript used within the Spotify desktop application? Is it packaged up and run locally only retrieving the assets as and when needed? What JavaScript VM is used? – Quora
For my archive via a private share.
–jeroen
Posted in Development, JavaScript/ECMAScript, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/11/15
Lets find the authoritative name server and TTL (time to live) for the example.org domain and www.example.org subdomain.
Notes:
- you can also do this using the web-page wrapper around dig [WayBack] Dig web interface
- web-pages return most information in one go are [WayBack] intodns.com/example.org and [WayBack] dnsinspect.com: Report for example.org.
- the steps below are partially based on a more in depth domain consistency check at [WayBack] Debugging nameservers using dig +norec
First start with a root server (dig: getting the list of root servers) to get parents of the name servers for example.org (don’t you love indirection!):
$ dig +norecurse +noall +authority @f.root-servers.net. example.org. org. 172800 IN NS a0.org.afilias-nst.info. org. 172800 IN NS a2.org.afilias-nst.info. org. 172800 IN NS b0.org.afilias-nst.org. org. 172800 IN NS b2.org.afilias-nst.org. org. 172800 IN NS c0.org.afilias-nst.info. org. 172800 IN NS d0.org.afilias-nst.org.
You can repeat this query for 2 more root servers to ensure they are in sync.
Now repeat with at least 3 of these to ensure they give matching results for the name servers for example.org:
$ dig +norecurse +noall +authority @b0.org.afilias-nst.info. example.org. example.org. 86400 IN NS b.iana-servers.net. example.org. 86400 IN NS a.iana-servers.net. $ dig +norecurse +noall +authority @c0.org.afilias-nst.info. example.org. example.org. 86400 IN NS a.iana-servers.net. example.org. 86400 IN NS b.iana-servers.net. $ dig +norecurse +noall +authority @a0.org.afilias-nst.info. example.org. example.org. 86400 IN NS a.iana-servers.net. example.org. 86400 IN NS b.iana-servers.net.
A query to a public DNS server will also return a name server list, but then you would need to know that name server first. In addition, you can not ask for +authority; you have to ask for +answer NS in stead:
$ dig +norecurse +noall +answer NS @8.8.8.8 example.org. example.org. 55312 IN NS a.iana-servers.net. example.org. 55312 IN NS b.iana-servers.net.
The name servers on the list are not guaranteed to be authoritative, as this query returns an empty result:
$ dig +norecurse +noall +authority @8.8.8.8 example.org.
From the name servers returned, you can now check if the servers themselves return the same name servers. If so, then you are sure they are authoritative:
$ dig +norecurse +noall +authority @a.iana-servers.net. example.org. example.org. 86400 IN NS a.iana-servers.net. example.org. 86400 IN NS b.iana-servers.net. $ dig +norecurse +noall +authority @b.iana-servers.net. example.org. example.org. 86400 IN NS b.iana-servers.net. example.org. 86400 IN NS a.iana-servers.net.
With the authoritative name servers, you can get the actual TTL:
$ dig +norecurse +noall +answer SOA @a.iana-servers.net. example.org.
example.org. 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600
$ dig +norecurse +noall +multiline +answer SOA @a.iana-servers.net. example.org.
example.org. 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
2017042729 ; serial
7200 ; refresh (2 hours)
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
I got the +multiline trick from [WayBack] HOWTO: Using dig(1) to Find DNS Time to Live (TTL) Values – A-Team Systems.
You can repeat the above process with a non-authoritative name server a few times to see the TTL decrease:
$ dig +norecurse +noall +answer SOA example.org. example.org. 322 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600 $ dig +norecurse +noall +answer SOA example.org. example.org. 321 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600
This is for instance what is returned by [WayBack] example.org DNS information – who.is example.org DNS information. DNS records such SOA, TTL, MX, TXT and more.
Public DNS servers having multiple servers per IP can even run disperse TTL numbers, for instance Google DNS at 8.8.8.8 does this:
$ dig +norecurse +noall +answer SOA @8.8.8.8 example.org. example.org. 13 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600 $ dig +norecurse +noall +answer SOA @8.8.8.8 example.org. example.org. 1388 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600 $ dig +norecurse +noall +answer SOA @8.8.8.8 example.org. example.org. 10 IN SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600
+nssearch does not work for meUsing +nssearch as per [WayBack] How to find what Authoritative Name Server provided the answer using dig? – Server Fault fails for me:
$ dig +nssearch example.org SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600 from server 199.43.135.53 in 83 ms. SOA sns.dns.icann.org. noc.dns.icann.org. 2017042729 7200 3600 1209600 3600 from server 199.43.133.53 in 144 ms. ;; connection timed out; no servers could be reached
This reveals this in the bold values:
sns.dns.icann.org is not publicly accessible.7200 (7200 seconds is 2 hours).Authoritative answers might not be present in dig queries on some platforms. I need to dig deeper into [WayBack] terminal – Dig not returning authority section? – Ask Different to see why.
Glue records are always tricky to get right: [WayBack] How to check domain NS glue records using dig « Admins eHow
–jeroen
Posted in *nix, *nix-tools, bash, Development, dig, DNS, Internet, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/11/14
I needed this during logon on Windows machines to set the sound volume: [WayBack] NirCmd – Windows command line tool set-soundvolume-25-percent.bat:
:: requires https://www.nirsoft.net/utils/nircmd.html
:: 100% = 65535
nircmd setsysvolume 16000
Works on all Windows versions (7-10) I tested so far.
Via
There are way sexier ways to do this, but they were all too convoluted for the time I had to get this to work.
For the future:
–jeroen
Posted in Batch-Files, Development, Power User, Scripting, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2018/11/13
Since ping has a more predictible output over Windows versions than ipconfig, I use this in a batch file:
for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a
echo Network IP: %NetworkIP%
Source: [WayBack] How do I get the IP address into a batch-file variable? – Stack Overflow
–jeroen
Posted in Batch-Files, Development, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/11/07
I need to script this one day: [WayBack] How to Setup Chroot SFTP in Linux (Allow Only SFTP, not SSH)
–jeroen
Posted in *nix, Awk, bash, Communications Development, Development, Internet protocol suite, Power User, Scripting, Software Development, SSH, TCP | Leave a Comment »
Posted by jpluimers on 2018/11/06
Most you probably know [WayBack] Professor Brian Kernighan or the YouTube channel Computerphile (sister channel of Numberphile).
He stars in about half a dozen of their videos giving a nice insight in his contributions to the field and how well he can explain things.
Full videos are below; these are the titles:
BTW: If you like those youtube channels, check out [WayBack] Brady Haran – Video Journalist who produces similar channels as well.
–jeroen
Posted in *nix, Awk, C, Development, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/11/01
On my research list: [WayBack] Passive Spam Block List:
PSBL is an easy-on, easy-off blacklist that does not rely on testing and should reduce false positives because any user can remove their ISP’s mail server from the list.
The idea is that 99% of the hosts that send me spam never send me legitimate email, but that people whose mail server was used by spammers should still be able to send me email.
This results in a simple listing policy: an IP address gets added to the PSBL when it sends email to a spamtrap, that email is not identified as non-spam and the IP address is not a known mail server.
Via: Hans Wolters commenting at [WayBack] For my research list: Source: Bruteforce login prevention… – Jeroen Wiert Pluimers – Google+
References:
–jeroen
Posted in *nix, *nix-tools, Development, Perl, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/10/31
Answering [WayBack] delphi – post-build event with multiple if/copy combinations only execute if first file does not exist – Stack Overflow made me do a quick search for parentheses handling in batch files. TL;DR: it is a mess.
But it reveals some interesting links:
–jeroen
Posted in Batch-Files, Conference Topics, Conferences, Development, Event, Scripting, Software Development, Windows Development | Leave a Comment »
Posted by jpluimers on 2018/10/23
For my archive bc.bat it finds Beyond Compare, then starts it with the given command line parameters. It prefers version 4 over version 3 and user settings over system settings:
:begin
@echo off
setlocal
IF /I %PROCESSOR_ARCHITECTURE% == amd64 goto :x64
IF /I %PROCESSOR_ARCHITEW6432% == amd64 goto :x64
goto :x86
:x64
:: OS is 64bit
set hkcuBaseKey=HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare
set hklmBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Scooter Software\Beyond Compare
goto :findBC
:x86
:: OS is 32bit
set hkcuBaseKey=HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare
set hklmBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Scooter Software\Beyond Compare
goto :findBC
:findBC
:: https://gist.github.com/rojepp/634908
:: http://stackoverflow.com/questions/5369528/windows-batch-reg-query-key-value-to-a-variable-but-do-not-display-error-if-key
set SupportedBeyondCompareVersions=3, 4
for %%v in (%SupportedBeyondCompareVersions%) do (
for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hkcuBaseKey% %%v" /v ExePath 2^>NUL`) do (
call :do set bcExe="%%d"
)
)
if not [%bcExe%]==[] goto :foundBC
for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hkcuBaseKey%" /v ExePath 2^>NUL`) do (
call :do set bcExe="%%d"
)
if not [%bcExe%]==[] goto :foundBC
for %%v in (%SupportedBeyondCompareVersions%) do (
for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hklmBaseKey% %%v" /v ExePath 2^>NUL`) do (
call :do set bcExe="%%d"
)
)
if not [%bcExe%]==[] goto :foundBC
for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hklmBaseKey%" /v ExePath 2^>NUL`) do (
call :do set bcExe="%%d"
)
:foundBC
if [%bcExe%]==[] ( echo no bc.exe found in registry) else (
echo bcExe=%bcExe%
if exist %bcExe% start "Beyond Compare" %bcExe% %*
if not exist %bcExe% echo not found: [%bcExe%]
)
:exit
endlocal
:end
goto :eof
:do
::echo %*
call %*
goto :eof
–jeroen
Posted in Batch-Files, Beyond Compare, Development, Power User, Scripting, Software Development | Leave a Comment »
Posted by jpluimers on 2018/10/16
tl;dr: Finding event handlers registered using jQuery can be tricky. findHandlersJS makes finding them easy, all you need is the event type and a jQuery selector for the elements where the events might originate.
I need to invest some time in using this: [WayBack] Quickly finding and debugging jQuery event handlers with findHandlersJS – The Blinking Caret
Sourcecode: [WayBack] raw.githubusercontent.com/ruidfigueiredo/findHandlersJS/master/findEventHandlers.js
References:
Via: [WayBack] javascript – Chrome Dev Tools : view all event listeners used in the page – Stack Overflow
–jeroen
Posted in Chrome, Development, Google, JavaScript/ECMAScript, jQuery, Power User, Scripting, Software Development, Web Browsers, Web Development | Leave a Comment »