Skip to content

Instantly share code, notes, and snippets.

@chadaustin
chadaustin / .tmux.conf
Last active April 28, 2024 05:36
my tmux config
# Detect the correct TERM value for new sessions.
# if-shell uses /bin/sh, so bashisms like [[ do not work.
if "[ $(tput colors) = 16777216 ]" {
set -g default-terminal "tmux-direct"
} {
if "[ $(tput colors) = 256 ]" {
set -g default-terminal "tmux-256color"
} {
set -g default-terminal "tmux"
}
@vgmoose
vgmoose / a_readme.md
Last active April 28, 2024 05:30
Yet another How to Create a Windows 11 Install USB from Ubuntu Linux or Mac

Creating a Windows 11 Install USB in 2022

I have been installing Windows for a long time. Does it get easier? I want to say it gets easier, but it seems like there's always some new wrinkle! These instructions are as much a note to my future self as they may be useful to anyone else.

For me, I was not able to get any exfat-based installs, or even any of the GUI helpers to make this process any more straightforward. Maybe on your target Windows / host OS those helpers will work, but the below process (as of current year) is consistent, and not overly complicated.

Overview:

  1. Downloading an official ISO image from MS:
  2. Formatting the drive (at least 8GB) as GPT, and one FAT-format partition (aka MS-DOS)
@amir-saniyan
amir-saniyan / OpenSSL Server Example.md
Last active April 28, 2024 05:17
OpenSSL Server Example

OpenSSL Server Example

This sample code shows how to create an OpenSSL server application.

Compilation

Prerequisites:

$ sudo apt-get install gcc pkg-config libssl-dev openssl
@cupdike
cupdike / gist.customattributes.py
Created January 10, 2023 16:30
Multiprocessing Pool Using Process Subclass with Custom Attributes
import multiprocessing as mp
from multiprocessing.pool import Pool
# GOAL IN CONTEXT:
# Simulate using a multiprocessing pool to download a list of files synchronously
# from a set of servers where each worker in the pool targets a specific
# download server.
# Our Worker subclasses Process so the target server can be added as an attribute.
# A CustPool subclasses Pool so our Worker subclass is used instead of Process.
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 05:12
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@aduzsardi
aduzsardi / dhcp_119_dns.ps1
Created July 25, 2017 07:51
generate dhcp option 119 (DNS Search Suffix) powershell script
# ----------------------------------------------------------------------------------------------------------
# PURPOSE: Creates a byte array for use with DHCP Option 119
#
# VERSION DATE USER DETAILS
# 1 07/03/2016 Craig Tolley First version
# 1.1 08/03/2016 Craig Tolley Fixed issue where if the whole domain matched the pointer was incorrect
# 1.2 08/03/2017 Craig Tolley Fixed further issues where the whole domain was matched the pointers are incorrect
# Modified outputs and tidied some formatting
# Convert-StringToOpt119Hex option fixed to not return values for null/empty strings
#
@nstarke
nstarke / find-entropy.py
Created August 25, 2019 17:42
Find Entropy of Strings
#!/usr/bin/env python
#
# find-entropy.py
#
# A simple Utility to measure entropy of strings.
# Usage should be something like this:
#
# $ strings file.txt | python find-entropy.py
#
@bmaupin
bmaupin / free-database-hosting.md
Last active April 28, 2024 05:01
Free database hosting
@orestesgaolin
orestesgaolin / http_upload_with_progress.dart
Last active April 28, 2024 05:00
How to upload file to S3 with http library and progress updates (Flutter/Dart)
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:meta/meta.dart';
import 'package:mime/mime.dart';
import 'package:path/path.dart';
import 'package:http/http.dart' as http;
abstract class ApiClient {
@keharriso
keharriso / FindZIP.cmake
Created November 19, 2016 21:57
CMake module for packing and unpacking ZIP files
# FindZIP.cmake - Pack and unpack ZIP files as custom targets
# ------------------------------------------------------------------------------
# Provides:
#
# ZIP_PACK_TARGET TARGET WORKING_DIRECTORY ARCHIVE FILES...
# TARGET - The name of the custom target
# WORKING_DIRECTORY - The working directory for the zip command
# ARCHIVE - The full archive path
# FILES... - The files and directories to include in the archive
# (relative to WORKING_DIRECTORY)