This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local fn = vim.fn | |
local api = vim.api | |
local executable = function(e) | |
return fn.executable(e) > 0 | |
end | |
local opts_info = vim.api.nvim_get_all_options_info() | |
local opt = setmetatable( | |
{}, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2020 Andrew G Morgan <[email protected]> | |
* | |
* This program exploit demonstrates why libcap alone in a | |
* multithreaded C/C++ program is inherently vulnerable to privilege | |
* escalation. | |
* | |
* The code also serves as a demonstration of how linking with libpsx | |
* can eliminate this vulnerability by maintaining a process wide | |
* common security state. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ clang -lcap -Wall -O2 ./setuidgid.c | |
#include <getopt.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <pwd.h> | |
#include <grp.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <errno.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _MULTI_THREADED | |
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <stdlib.h> | |
#include <cstring> | |
#define SQLOK(line) do { \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/7272558/can-we-define-a-new-data-type-in-a-gdb-session | |
// sample.c | |
#include "sample.h" | |
struct sample foo; | |
gcc -g -c sample.c | |
(gdb) add-symbol-file sample.o 0 | |
add symbol table from file "sample.o" at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _MULTI_THREADED | |
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <stdlib.h> | |
int print_row_cb(void *NotUsed, int argc, char **argv, char **azColName) { | |
NotUsed = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _MULTI_THREADED | |
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
int callback(void *, int, char **, char **); | |
void check(const char *str, int err); | |
void *threadfunc(void *parm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$stdin.sync = true; | |
$stdout.sync = true; | |
$a = true | |
def handle(id, sig) | |
puts id.to_s + " got " + sig.to_s + " at " + Process.pid.to_s | |
$a = false | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat /etc/systemd/logind.conf | |
# This file is part of systemd. | |
# | |
# systemd is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation; either version 2.1 of the License, or | |
# (at your option) any later version. | |
# | |
# Entries in this file show the compile time defaults. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/prctl.h> | |
int main() { | |
printf("origin: pid=%d, ppid=%d, pgid=%d\n", getpid(), getppid(), getpgid(getpid())); | |
printf("prctl %d\n", prctl(PR_SET_CHILD_SUBREAPER, 1, 0, 0, 0)); | |
pid_t pid = fork(); |
NewerOlder