Skip to content

Instantly share code, notes, and snippets.

@alexanderadam
alexanderadam / macOS_launcher.sh
Created August 14, 2020 13:07 — forked from StefanoBelli/macOS_launcher.sh
Fast OS X launch on QEMU with KVM support enabled. Credits to: https://github.com/kholia, original repository: https://github.com/kholia/OSX-KVM
#!/bin/sh
# qemu-img create -f qcow2 mac_hdd.img 64G
# echo 1 > /sys/module/kvm/parameters/ignore_msrs
#
# Type the following after boot,
# -v "KernelBooter_kexts"="Yes" "CsrActiveConfig"="103"
#
# printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
#
@dcode
dcode / filter-flatten-nested.conf
Last active March 26, 2024 08:49
Logstash ruby filter to flatten nested fields to dotted names. I don't recommend this for many reaons (performance, json parsing pain, elasticsearch indexing problems, etc), but sometimes your data pipeline requires this sort of silliness.
filter {
ruby {
path => 'flatten_nested_field.rb'
script_params => {
"source" => "observer"
"delimiter" => "."
}
}
}
@dreamer2908
dreamer2908 / register_baidu.md
Last active March 31, 2025 17:15
Register a Baidu account to download stuff???

Idea from ShinyMarusu @ Reddit:

  • https://www.reddit.com/r/Piracy/comments/auhyxk/how_do_i_download_from_panbaidu/eovyg8g/
  • I just unintentionally discovered how to do it after searching how to create an account for day and a half. LOL hope it works for you too.
  • First go to this link (baidu cloud app) to register. Use your phone number to get the verification code and enter. For the rest, use google to translate the page and put your email adress, name, etc. and you're good to go. This method logs you to the cloud directly so you just step over the problematic pan,baidu registration which rejects non-chinese phone numbers for some reason. After registering I refreshed the page of the file I was trying to download and it showed me as already logged in, then I FINALLY could download the mod. It's sad this method isn't listed anywhere, I really searched a lot... Anyways, good luck!

More notes:

  • It's a pain in the rear. It took me an hour, but at least it worked.
  • Get an Chinese email. You will use it as yo
@ljjjustin
ljjjustin / README-setup-socket-activated-systemd-service.md
Created December 18, 2019 14:23 — forked from drmalex07/README-setup-socket-activated-systemd-service.md
An example inetd-like socket-activated service. #systemd #inetd #systemd.socket

README

This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.

Define a socket unit

The key point here is to specify Accept=yes, which will make the socket accept connections (behaving like inetd) and pass only the resulting connection socket to the service handler.

@bmatcuk
bmatcuk / create-usb.sh
Created May 30, 2019 04:38
Creating a Bootable Windows USB from ISO on a Mac
# First, we need to find our device. BEFORE inserting your USB drive, run the
# following:
diskutil list
# This will output a bunch of info about all of the disk drives connected to
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is
# some number starting at 0. Now, insert your USB drive and run the command
# again. You should see a new entry. Make note of the name (ie, /dev/diskX).
diskutil list
@tuxfight3r
tuxfight3r / 01.bash_containers.sh
Last active October 27, 2020 08:40
container basics cgroups namespaces
# Prepare a hash. We need it to identify our container.
$ uuid="ps_$(shuf -i 42002-42254 -n 1)"
# Prepare a root dir for all the containers.
$ btrfs_path='/var/bocker' && cgroups='cpu,cpuacct,memory';
# Prepare root filesystem based on the given `$image`.
$ btrfs subvolume snapshot "$btrfs_path/$image" "$btrfs_path/$uuid" > /dev/null
# Create a cgroup
@lifehome
lifehome / README.md
Last active February 25, 2024 06:34 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

Look out!

A newer version is available!

This gist will no longer update, instead please go to https://github.com/lifehome/systemd-cfddns for more updated versions.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
@githubfoam
githubfoam / pentest cheat sheet
Last active March 9, 2025 08:21
pentest cheat sheet
----------------------------------------------------------------------------------------------------
OWASP Top Ten
https://owasp.org/www-project-top-ten/
The CWE Top 25
https://www.sans.org/top25-software-errors/
2022 CWE Top 25 Most Dangerous Software Weaknesses
https://cwe.mitre.org/top25/archive/2022/2022_cwe_top25.html
@steven2358
steven2358 / ffmpeg.md
Last active March 12, 2025 01:04
FFmpeg cheat sheet
@tuxfight3r
tuxfight3r / slapd
Last active January 27, 2025 03:58
openldap proxy to AD with TLS
#file /etc/sysconfig/slapd
# OpenLDAP server configuration
# see 'man slapd' for additional information
# Where the server will run (-h option)
# - ldapi:/// is required for on-the-fly configuration using client tools
# (use SASL with EXTERNAL mechanism for authentication)
# - default: ldapi:/// ldap:///
# - example: ldapi:/// ldap://127.0.0.1/ ldap://10.0.0.1:1389/ ldaps:///
SLAPD_URLS="ldap:/// ldaps:///"