The intended use-case for BaseDirectories is to query the paths of user-invisible standard directories that have been defined according to the conventions of the operating system the library is running on.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIT License | |
# | |
# Copyright (c) 2023 Neil Webber | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// Windows pty example | |
// https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/ | |
import ( | |
"io" | |
"os" | |
"fmt" | |
"log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Very basic Windows Service template - maybe not fully correct/complete but it works. | |
// x86_64-w64-mingw32-gcc -mwindows -municode -O2 -s -o TempLoggerService.exe TempLoggerService.c | |
// SC create TempLoggerService binpath="C:\Temp\TempLoggerService.exe" | |
// SC delete TempLoggerService | |
#include <windows.h> | |
#include <stdio.h> | |
#define SERVICE_NAME L"TempLoggerService" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import network | |
import socket | |
sta = network.WLAN(network.STA_IF) | |
sta.active(True) | |
sta.connect('ESSID', 'key') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
iatest=$(expr index "$-" i) | |
####################################################### | |
# SOURCED ALIAS'S AND SCRIPTS BY zachbrowne.me | |
####################################################### | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adapated from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate seperate key+crt files, make sure common name (CN) == ip or hostname | |
# openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout newkey.key -out newkey.crt | |
# run as follows: | |
# python simple-https-server.py | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl | |
# 0.0.0.0 allows connections from anywhere |
(Serial port or com port? - Serial ports are often refered as COM ports. It is the same to be short. You can read abut it in the Wiki article )
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Poor version of checksec.sh script for PE (checks for ASLR, NX, Integrity, SEH flags) | |
* | |
* Copy/Paste commands | |
* c:\> dir /s /b *.dll > DllList.txt | |
* c:\> checksec.exe -f DllList.txt > DllList_checksec.txt | |
* | |
* @ref | |
* https://msdn.microsoft.com/en-us/library/windows/desktop/ms680339(v=vs.85).aspx | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes, sys | |
from ctypes import windll, wintypes | |
from uuid import UUID | |
class GUID(ctypes.Structure): # [1] | |
_fields_ = [ | |
("Data1", wintypes.DWORD), | |
("Data2", wintypes.WORD), | |
("Data3", wintypes.WORD), | |
("Data4", wintypes.BYTE * 8) |
NewerOlder