Skip to content

Instantly share code, notes, and snippets.

@mattifestation
mattifestation / AMSIScriptContentRetrieval.ps1
Created June 18, 2018 00:47
PoC code used to demonstrate extracting script contents using the AMSI ETW provider
# Script author: Matt Graeber (@mattifestation)
# logman start AMSITrace -p Microsoft-Antimalware-Scan-Interface Event1 -o AMSITrace.etl -ets
# Do your malicious things here that would be logged by AMSI
# logman stop AMSITrace -ets
$OSArchProperty = Get-CimInstance -ClassName Win32_OperatingSystem -Property OSArchitecture
$OSArch = $OSArchProperty.OSArchitecture
$OSPointerSize = 32
if ($OSArch -eq '64-bit') { $OSPointerSize = 64 }
@janoskk
janoskk / couchclone.sh
Created May 28, 2014 22:27
Create (if necessary) and replicate all databases from a couchdb server to another one
#!/bin/sh
#
# Janos Kasza (@janoskk)
#
# Creates (if necessary) and replicates all databases from a couchdb server to another one
#
if [ -z "$2" ]; then
cat <<EOF
Usage: $0 <sourceUrl> <targetUrl>
@jamesmacwhite
jamesmacwhite / ffmpeg_mkv_mp4_conversion.md
Last active May 5, 2024 15:42
Easy way to convert MKV to MP4 with ffmpeg

Converting mkv to mp4 with ffmpeg

Essentially just copy the existing video and audio stream as is into a new container, no funny business!

The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.

With ffmpeg this can be achieved with -c copy. Older examples may use -vcodec copy -acodec copy which does the same thing.

These examples assume ffmpeg is in your PATH. If not just substitute with the full path to your ffmpeg binary.

Single file conversion example

@ityonemo
ityonemo / test.md
Last active May 5, 2024 15:42
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@knbr13
knbr13 / types.md
Created May 5, 2024 13:26
Data Types in Go

Data Types in Go

Go is a statically-typed language, which means that every variable has a specific data type that determines the kind of value it can hold. Go has several built-in data types that are categorized into four main groups: basic types, aggregate types, reference types, and interface types.

Basic Types

Basic types are the primitive data types in Go. They include:

  1. bool: Represents a boolean value, either true or false.
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 5, 2024 15:39
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sumonst21
sumonst21 / Remove YT Shorts | AdGuard.md
Created June 23, 2023 09:48
Remove YT Shorts | AdGuard

https://www.reddit.com/r/uBlockOrigin/wiki/solutions/youtube/#wiki_shorts

! YT Homepage - Hide the Shorts section
youtube.com##[is-shorts]
! YT Menu - Hide the Shorts button
www.youtube.com###guide [title="Shorts"], .ytd-mini-guide-entry-renderer[title="Shorts"]
! YT Search - Hide Shorts
www.youtube.com##ytd-search ytd-video-renderer [overlay-style="SHORTS"]:upward(ytd-video-renderer)
! YT Search and Channels - Hide the Shorts sections
www.youtube.com##ytd-reel-shelf-renderer
@vuon9
vuon9 / README.md
Last active May 5, 2024 15:39
Powertoys - Keyboard Manager - Common macOS keys mapping

How to install

  • cd C:\Users\${username}\AppData\Local\Microsoft\PowerToys\Keyboard Manager
  • Backup file existing one of default.json
  • Download default.json and add it to the current folder

Mapped keys

key
Esc
@sharbel93
sharbel93 / How to solve this problem of "! [rejected] master -> master (fetch first)"
Created January 19, 2019 10:09
How to solve this problem of "! [rejected] master -> master (fetch first)"
First Do this ...
git fetch origin master
git merge master
Then, do this ...
git fetch origin master:tmp
git rebase tmp
git push origin HEAD:master
@RakaDoank
RakaDoank / seo-meta-in-spa.md
Last active May 5, 2024 15:37
How do i achieve SEO Meta in Server While The Web Project is Single Page Application (SPA)?

Are you having a trouble about SEO Meta in server while your project is SPA only like React Router or Vue Router?

Can i guess you also don't have so much time for migration on the new framework that can handle server side rendering out of the box like Next.js, Nuxt.js, Gatsby, etc.

Setting the SEO meta in server like <title>, <meta name="description"/> are actually useful for search engine, and also good for showing your summary content in social media app by pasted the full url in Whatsapp, IG, Twitter, etc.

Enough the intermezzo, here we go.

The concept is actually simple, modify the index.html (from bundled source) before it served to the client.