Skip to content

Instantly share code, notes, and snippets.

@superkojiman
superkojiman / namemash.py
Last active May 10, 2024 15:59
Creating a user name list for brute force attacks.
#!/usr/bin/env python3
'''
NameMash by superkojiman
Generate a list of possible usernames from a person's first and last name.
https://blog.techorganic.com/2011/07/17/creating-a-user-name-list-for-brute-force-attacks/
'''
@Composable
fun BottomSheet(
isShown: Boolean,
modifier: Modifier = Modifier,
onDismissRequest: () -> Unit = {},
shape: Shape = BottomSheetDefaults.ExpandedShape,
sheetGesturesEnabled: Boolean = true,
dismissOnBack: Boolean = sheetGesturesEnabled,
windowInsets: WindowInsets = WindowInsets(0), // This is a nice default if the app is edge to edge
content: @Composable ColumnScope.() -> Unit,
@lopspower
lopspower / README.md
Last active May 10, 2024 15:59
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@cnlohr
cnlohr / forgot_to_check_out_with_recurse_submodules.md
Last active May 10, 2024 15:59
Git forgot to clone recursively (forgot to check out with recurse submodules)
@casperghst42
casperghst42 / create-cloud-init.sh
Last active May 10, 2024 15:58
Create a cloud-init Debian 12 image on proxmox
#!/bin/bash
# Author: Casper Pedersen (github.com/casperghst42)
# License: GPL2
wget https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2
virt-customize -a debian-12-generic-amd64.qcow2 --install qemu-guest-agent --install resolvconf --install systemd-resolved --update --run-command 'mkdir -p /etc/network/interfaces.d' --run-command 'echo "auto ens18" >> /etc/network/interfaces.d/ens18' --run-command 'echo "iface ens18 inet manual" >> /etc/network/interfaces.d/ens18'
qm create 100000 --name "debian12-cloudinit-template" --memory 2048 --net0 virtio,bridge=vmbr0
qm importdisk 100000 debian-12-generic-amd64.qcow2 local-lvm -format qcow2
@mosquito
mosquito / README.md
Last active May 10, 2024 15:57
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@stefanthoss
stefanthoss / export-pyspark-schema-to-json.py
Created June 19, 2019 22:16
Export/import a PySpark schema to/from a JSON file
import json
from pyspark.sql.types import *
# Define the schema
schema = StructType(
[StructField("name", StringType(), True), StructField("age", IntegerType(), True)]
)
# Write the schema
with open("schema.json", "w") as f:
@panzi
panzi / pil2cv.py
Created July 5, 2021 16:00
Python: Convert PIL.Image to OpenCV BGR(A)/grayscale image (NumPy array). This supports the most common image modes, but there are more! Patches for those are welcome.
from PIL import Image
import numpy as np
import cv2
def pil2cv(image: Image) -> np.ndarray:
mode = image.mode
new_image: np.ndarray
if mode == '1':
new_image = np.array(image, dtype=np.uint8)
@edokeh
edokeh / index.js
Last active May 10, 2024 15:55
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \