Skip to content

Instantly share code, notes, and snippets.

View willemnviljoen's full-sized avatar

willemnviljoen

View GitHub Profile
If you are having trouble following along on an M1 Mac, it's because the versions of the packages included
in the environment for the course do not play nicely with ARM64 processors.
After much rending of shirts, I have come up with an environment which works.
To set it up, follow the steps below exactly:
1) If not already done, remove the existing `conda` environment you were using for the course, we have to rebuild it.
2) Remove any existing installation of Anaconda or Miniconda.
@willemnviljoen
willemnviljoen / assign-ntp-servers-to-local-default-route.sh
Created August 30, 2017 06:01
On OpenWRT routers configured to route all traffic through VPN by default, force NTP to be routed via the local default gateway
#!/bin/sh
DEFAULTROUTE=`/sbin/route | /bin/grep -v '*' | /bin/grep eth0 | /usr/bin/awk '{print $2}' | /usr/bin/head -n1`
NTPSERVERS=`/bin/grep 'list server' /etc/config/system | /usr/bin/awk '{print $3}' | /bin/sed "s/'//g"`
for HOST in $NTPSERVERS; do /sbin/route add $HOST gw $DEFAULTROUTE; done
@willemnviljoen
willemnviljoen / intelliLangSqlInjectionWithoutDoctrineDql.xml
Created August 17, 2017 07:20
SQL language injection for PHPStorm which specifically ignores the Doctrine DQL language
<LanguageInjectionConfiguration>
<injection language="SQL" injector-id="php">
<display-name>&quot;SQL select/delete/insert/update/create&quot; Excluding Doctrine DQL</display-name>
<place><![CDATA[and(not(phpLiteralMatchesBrics(".*:.*")), phpLiteralMatchesBrics(" *(((SELECT|DELETE) .*FROM)|((INSERT|REPLACE) .*INTO)|(UPDATE .* SET)|((CREATE|DROP|ALTER) +((TEMPORARY )?TABLE|(UNIQUE )?INDEX))) .*"))]]></place>
</injection>
</LanguageInjectionConfiguration>