Skip to content

Instantly share code, notes, and snippets.

{
"workbench.editor.enablePreviewFromQuickOpen": false,
"workbench.colorTheme": "GitHub Dark",
"rust-analyzer.checkOnSave.command": "clippy",
"workbench.editor.enablePreview": false,
"editor.minimap.enabled": false,
"[rust]": {
"editor.formatOnSave": true,
"editor.tabSize": 4
},
#define _GNU_SOURCE
#include <errno.h>
#include <sched.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/types.h>
@romainl
romainl / macros.md
Last active May 15, 2023 07:33
What to do with macros?

What to do with macros?

"Macro", you say? Or is that "recording"?

What people refer to as a "macro" is often actually a "recording".

You press qa to start recording your commands into register a, you do your thing, you stop your recording with q, and you play that recording back with @a.

Yes, what you just recorded is a macro, but macros are not necessarily recorded or even stored in registers.

C:\Program Files\Notepad++\notepad++.exe -n%line% "%path%"
@ku1ik
ku1ik / asciinema-upload.sh
Last active January 30, 2024 08:26
Upload local recording to asciinema.org with curl
curl -v -u $USER:$(cat ~/.config/asciinema/install-id) https://asciinema.org/api/asciicasts -F asciicast=@/path/to/demo.cast
@SimplGy
SimplGy / renameToHash.sh
Last active July 27, 2023 07:30
Rename files with a hash based on their contents. eg: `abc.jpg` to `3101ace8db9f.jpg`. Useful for detecting duplicates.
#!/bin/bash
# TODO: skip tiny files (so small they couldn't be photos)
# TODO: make sure sym links and other file system oddities are handled
# TODO: look at paralellization for perf boost
#
# Constants
#
CHAR_COUNT=12
BLOCK_COUNT=6
@Integralist
Integralist / C vs System Calls.md
Last active January 30, 2023 05:08
C vs System Calls and where to find documentation?

What's the issue?

It can be confusing sometimes knowing where to look for documentation when dealing with C †

† that is if you're not a systems engineer, and have no CS degree, nor learnt C

As an example, you might learn about the strace command and start investigating what your Ruby application is up to. In doing so you'll see lots of calls to different functions and you might decide you want to look up the documentation for those functions.

This could be where your first problem arises. You might think "Ruby is written in C, so I'll look at the C documentation" and then come up with nothing.

@Arinerron
Arinerron / root.sh
Last active June 10, 2024 17:35
"Root" via dirtyc0w privilege escalation exploit (automation script) / Android (32 bit)
#!/bin/bash
# Give the usual warning.
clear;
echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds...";
sleep 10;
clear;
# Download and extract exploit files.
echo "[INFO] Downloading exploit files from GitHub...";
@marty-wang
marty-wang / gist:5a71e9d0a6a2c6d6263c
Last active June 27, 2024 13:34
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}