Skip to content

Instantly share code, notes, and snippets.

@JimiC
JimiC / pulseaudio-module-xrdp-setup.sh
Last active January 17, 2023 16:57
Build and setup PulseAudio module for XRDP on MX Linux
#!/bin/sh
###############################################################################
#
# Build and setup PulseAudio module for XRDP on MX Linux
#
###############################################################################
pulsever=$(pulseaudio --version | awk '{print $2}')
@QuiltMeow
QuiltMeow / install-pulseaudio-module-xrdp.sh
Created September 26, 2022 20:05
Pulse Audio Module XRDP 安裝腳本
#!/bin/bash
# 請以 Root 使用者執行 (sudo su -)
apt-get update
apt-get dist-upgrade -y
apt-get install xrdp build-essential git autoconf libtool pkg-config libpulse-dev -y
adduser xrdp ssl-cert
systemctl restart xrdp
cd /root
@ANRCorleone
ANRCorleone / readme.txt
Last active April 29, 2024 10:19 — forked from krisalyssa/readme.txt
Ubuntu 22.04 + Hyper V + Enhanced Session mode + XRDP PulseAudio
Credits
# https://c-nergy.be/blog/?p=13655
# https://askubuntu.com/questions/844245/how-to-compile-latest-pulseaudio-with-webrtc-in-ubuntu-16-04
# https://askubuntu.com/questions/496549/error-you-must-put-some-source-uris-in-your-sources-list
# https://unix.stackexchange.com/questions/65167/enable-udev-and-speex-support-for-pulseaudio
# https://rudd-o.com/linux-and-free-software/how-to-make-pulseaudio-run-once-at-boot-for-all-your-users
# https://gist.github.com/rkttu/35ecab5604c9ddc356b0af4644d5a226
# Installation and Enhanced session
# follow steps on the post below, I installed Ubuntu 22.04 on a Windows 11 machine
@karanlyons
karanlyons / log4shell_regexes.py
Last active March 7, 2022 03:49
log4shell Regexes
import re
from urllib.parse import unquote
FLAGS = re.IGNORECASE | re.DOTALL
ESC_DOLLAR = r'(?:\$|[\\%]u0024||\\x24|\\0?44|%24)'
ESC_LCURLY = r'(?:\{|[\\%]u007B|\\x7B|\\173|%7B)'
ESC_RCURLY = r'(?:\}|[\\%]u007D|\\x7D|\\175|%7D)'
_U_PERCENT_ESCAPE_RE = re.compile(r'%(u[0-9a-f]{4})', flags=FLAGS)
_PERCENT_ESCAPE_RE = re.compile(r'%[0-9a-f]{2}', flags=FLAGS)
@Neo23x0
Neo23x0 / log4j_rce_detection.md
Last active January 28, 2024 08:19
Log4j RCE CVE-2021-44228 Exploitation Detection

log4j RCE Exploitation Detection

You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228

Grep / Zgrep

This command searches for exploitation attempts in uncompressed files in folder /var/log and all sub folders

sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
@milnak
milnak / ubuntu20-hyperv-enhanced-session.md
Last active April 24, 2024 20:24
[Enabling enhanced session in Hyper-V for Ubuntu 20] This works for me, although it seems that Hyper-V quick create now supports enhanced session by default. #ubuntu #hyperv

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20 desktop

DO NOT create the VM by choosing Quick Create in Hyper-V Manager. Follow these instructions exactly.

@jbesw
jbesw / gist:f9401b4c52a7446ef1bb71ceea8cc3e8
Created August 4, 2020 11:39
AWS CloudFormation template to create public/private subnets in a VPC with a NAT Gateway.
# This creates a VPC with two public subnets and two private subnets in two Availability Zones,
# together with a NAT Gateway and associated routing. Change the Availability Zone locations as needed.
# Important: this configures various AWS services and there are costs associated with these services after the Free Tier usage.
# Please see the AWS Pricing pages for details. You are responsible for any AWS costs incurred.
# No warranty is implied in this example.
# Usage from command line:
# aws cloudformation --region <<YOUR-REGION>> create-stack --stack-name vpc- --template-body file://vpc-setup.yaml
@quiye
quiye / yjy.md
Last active April 21, 2024 23:25
yaml to jsonnet to yaml
@dideler
dideler / bot.rb
Last active May 17, 2024 15:33
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@nqbao
nqbao / ssm_parameter_store.py
Last active March 21, 2024 00:15
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
# Copyright (c) 2018 Bao Nguyen <b@nqbao.com>
#
# 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:
#
# The above copyright notice and this permission notice shall be included in all