Skip to content

Instantly share code, notes, and snippets.

@ArcherN9
ArcherN9 / nft.rules
Last active September 22, 2021 06:46
An NFTables rule set with ipv6 and ipv4 to support Wireguard NAT
#!/sbin/nft -f
# Flushing means to empty; the flush command here empties the entire
# nftable ruleset. Since this is the primary file that is loaded onto the
# chronology of nf configurations, it is safe to flush the entire rulset first.
flush ruleset
# I tried segregating my configuration into multiple tables for comprehension
# But was unable to. If you have a better understanding of nftables and
# comprehend how this configuration can be broken apart into multiple tables,
@ArcherN9
ArcherN9 / primary.rules
Created September 19, 2021 09:18
ArcherN9 primary NFRule file to be loaded permanently on the system
flush ruleset
table ip pinhole_filter {
# allow all packets sent by Pi itself
chain output {
type filter hook output priority 100; policy accept;
}
# allow LAN to firewall, disallow WAN to firewall
chain input {
# This script file handles the creation and deployment of a new Azure App Service web app.
echo "" # Blank space for formatting
echo "This script will attempt to create a new Azure App Service WebApp and return the configuration created"
echo "" # Blank space for formatting
echo "Please enter the name of the Web Application (name entered will form a unique FQDN ex: mysampleapp.azurewebsites.net): "
# Accept an application name. Prompt if not entered correctly.
while [ ${#applicationName} -eq 0 ]
do
read applicationName
@ArcherN9
ArcherN9 / ReadMap.cs
Created March 2, 2019 14:59
Placenote SDK - Unity - ARKit
/// code here
private LibPlacenote.MapMetadataSettable mCurrMapDetails;
/// code here
// Executed when the scene comes back to the forescreen.
// Think of this as onResume of the Android activity lifecycle
private void OnEnable()
{
//Creation of ViewRenderable
val shareButton = ViewRenderable.builder()
.setVerticalAlignment(ViewRenderable.VerticalAlignment.TOP)
.setHorizontalAlignment(ViewRenderable.HorizontalAlignment.RIGHT)
.setView(view.getARFragment().context, R.layout.share)
.build()
//Creation of ModelRenderable
val video = ModelRenderable.builder()
.setSource(view.getARFragment().context, Uri.parse("chroma_key_video.sfb"))
@Override
protected void onResume() {
super.onResume();
//Register broadcast receiver to receive changes in connectivity
registerReceiver(brConnectivityChangeReceiver, new IntentFilter(
"android.net.conn.CONNECTIVITY_CHANGE" //Ideally, put this in the strings.xml file
));
}
private BroadcastReceiver brConnectivityChangeReceiver = new BroadcastReceiver() {