Skip to content

Instantly share code, notes, and snippets.

View NiKiZe's full-sized avatar

Christian I. Nilsson NiKiZe

View GitHub Profile
@NiKiZe
NiKiZe / sign.csproj
Created January 18, 2024 12:32
Sign msbuild properly
<Target Name="_SignAssemblies" AfterTargets="Compile" DependsOnTargets="CreateSatelliteAssemblies;$(RazorCompileDependsOn)" Condition="'$(CertificateThumbprint)' != ''">
<ItemGroup>
<_AssembliesToSign Include="$(IntermediateOutputPath)$(TargetFileName)" />
<_AssembliesToSign Include="@(IntermediateSatelliteAssembliesWithTargetPath)" />
<_AssembliesToSign Include="@(RazorIntermediateAssembly)" />
</ItemGroup>
<Message Importance="high" Text="Signing assemblies: @(_AssembliesToSign)" />
<SignFile SigningTarget="%(_AssembliesToSign.Identity)" CertificateThumbprint="$(CertificateThumbprint)" TimestampUrl="$(TimestampUrl)"/>
</Target>
@NiKiZe
NiKiZe / readme.md
Created June 25, 2023 08:03
Upsales widget documentation
@NiKiZe
NiKiZe / restartwwan.sh
Created December 29, 2022 14:54
mbimcli restart script
#!/bin/sh -e
#
#Disable wwan
#echo 1-1 | sudo tee /sys/bus/usb/drivers/usb/unbind
uhubctl -l 1-1 -a 0
rmmod cdc_mbim
rmmod cdc_wdm
rmmod cdc_ncm
@NiKiZe
NiKiZe / start.sh
Created January 16, 2022 22:32
Filter and route on hostname using SNI
#!/bin/bash
# Filter and route on hostname using SNI
# https://github.com/Lochnair/xt_tls/issues/52
# This creates iptables rules and ip rules to filter and route HTTPS traffic based on hostname in SNI field
# Some links on why packets might be droped, see rp_filter below
# https://serverfault.com/questions/934848/ip-rule-to-works-but-ip-rule-fwmark-fails-why
# https://serverfault.com/questions/932205/advanced-routing-with-firewall-marks-and-rp-filter
# https://serverfault.com/questions/816393/disabling-rp-filter-on-one-interface
@NiKiZe
NiKiZe / start_wwan.sh
Created September 2, 2021 19:19
Start MC7700 LTE on Raspberry Pi
#!/bin/bash
# Connect a Raspberry Pi to LTE using MC7700 Mini PCI Modem with adapter to USB-C
sudo qmicli -d /dev/cdc-wdm0 -p --wds-stop-network
sudo cat /sys/class/net/wwan0/qmi/raw_ip
sudo ip link set dev wwan0 down
# Enable OS Raw IP Mode setting (not persistent)
sudo su -c "echo Y > /sys/class/net/wwan0/qmi/raw_ip"
sudo qmicli -d /dev/cdc-wdm0 -p --device-open-net="net-raw-ip|net-no-qos-header" --wds-start-network="ip-type=6" --client-no-release-cid
@NiKiZe
NiKiZe / README.md
Created September 2, 2021 16:51
VB.NET Inheritance default
    public interface IName
    {
        /// <summary>Default property override</summary>
        [System.Runtime.CompilerServices.IndexerName("_Item")]
        object this[string key] { get; }
    }

    public class ImplNameCs : IName
 {
@NiKiZe
NiKiZe / dhcpd.conf
Created August 6, 2021 14:23 — forked from robinsmidsrod/dhcpd.conf
Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
ddns-update-style none;
deny bootp; #default
authoritative;
include "/etc/dhcp/ipxe-option-space.conf";
# GREEN (private network)
subnet 10.1.1.0 netmask 255.255.255.0 {
range 10.1.1.100 10.1.1.199;
option subnet-mask 255.255.255.0;
@NiKiZe
NiKiZe / dnsmasq.conf
Last active January 27, 2024 06:16
Trying to chainload iPXE with full feature set from a lesser featured one. dnsmasq ProxyDHCP edition
# Known working dnsmasq version 2.85 config for iPXE proxydhcp usage
# things to replace:
# * 10.1.1.0 - your subnet
# * eth0 - interface to listen on, or switch to bind-dynamic
# * 10.1.1.2 - your tftp server ip
# * http://gentoo.ipxe.se/boot.ipxe - script to run once inside iPXE
# Debug logging
log-debug
@NiKiZe
NiKiZe / backup.sh
Last active June 30, 2022 21:44
Linux system backup
# from https://wiki.archlinux.org/title/Full_system_backup_with_tar
# -p, --acls and --xattrs store all permissions, ACLs and extended attributes.
# Without both of these, many programs will stop working!
# It is safe to remove the verbose (-v) flag. If you are using a
# slow terminal, this can greatly speed up the backup process.
#--exclude-from=$exclude_file
tar --exclude=/tmp/* --exclude=/var/tmp/* --exclude=/usr/portage/* --acls --xattrs --one-file-system -cpvf - . | xz -zvv -T3 -0 > file.xz
restore:
xz | tar --acls --xattrs --numeric-owner -xpf -