Skip to content

Instantly share code, notes, and snippets.

@jinyu121
jinyu121 / NetAuth.py
Last active November 14, 2024 05:21
复旦大学网络自动认证脚本
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import requests
import logging
import socket
@marnix
marnix / Remove-File-Eventually.ps1
Created November 20, 2013 15:47
PowerShell command to delete a file, if possible immediately, and if it is in use at the next boot.
param(
[parameter(Mandatory=$true)]
[string] $path
)
# the code below has been used from
# https://blogs.technet.com/b/heyscriptingguy/archive/2013/10/19/weekend-scripter-use-powershell-and-pinvoke-to-remove-stubborn-files.aspx
# with inspiration from
# http://www.leeholmes.com/blog/2009/02/17/moving-and-deleting-really-locked-files-in-powershell/
# and error handling from