🔴 Note: this article is obsolete. This cross-compilation direction may just work out of the box. 🔴
Let's create a dummy project for a test.
$ cargo new test
// rendered: http://vi-server.org/pub/rustfeat.png | |
digraph G { | |
rankdir=TD; | |
node [shape=rect fontsize=16 margin=0.06 style=filled fillcolor="white"]; | |
edge [fontsize=14 arrowsize=0.5 style=bold]; | |
ranksep=0.17; | |
T [label="Thinking, discussions, etc" fillcolor="#fff8e8"] | |
T -> PR; | |
PR [label="optional pre-RFC\npost on internals.rust-lang.org" fillcolor="#fff8e8"]; |
// This code demonstrates that with OS's external help | |
// one can crash even Safe Rust's code | |
// Implemented by Vitaly "_Vi" Shukela | |
use std::process::Command; | |
fn getpid() -> i32 { | |
let so = Command::new("sh") | |
.arg("-c") |
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "Usage: disque-call queue-name < input > output" >&2 | |
exit 1 | |
fi | |
QN="$1"; | |
set -e |
#!/bin/bash | |
# git wrapper, to auto-supply --reference to `git clone` | |
# edit the table below to suit your setup | |
LOG=/tmp/git.log | |
echo git: "$@" >> "$LOG" | |
CLONE=0 |
From fd121ea3730530289422566bdae6e77a45402e34 Mon Sep 17 00:00:00 2001 | |
From: Vitaly _Vi Shukela <vi0oss@gmail.com> | |
Date: Wed, 26 Aug 2015 02:22:50 +0300 | |
Subject: [PATCH] libbpg: Implement -noalpha option to skip PNG's alpha channel | |
pngenc command line tool loves PNG. | |
Sometimes users need to convert the picture to png in order | |
to feed it to pngenc. | |
While converting to png, alpha channel may creep in. | |
This makes bpgenc to fail to work in x265 mode and also produce |
// Pre-built static i386 version: http://vi-server.org/pub/no_new_privs | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <sys/prctl.h> | |
int main(int argc, char* argv[]) | |
{ | |
if (argc == 1 || !strcmp(argv[1], "--help")) { |
#!/bin/bash | |
INS=("$@") | |
OUTNAME="${INS}_${INS[${#INS[@]}-1]}.png" | |
# 1. Sort images in order of increasing brightness | |
declare -a LEVS | |
for i in "${INS[@]}"; do | |
LEVS+=($( |
#define _GNU_SOURCE 1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dlfcn.h> | |
#include <errno.h> | |
static int (*orig_llseek)( | |
unsigned int fd, unsigned long offset_high, |
#define _GNU_SOURCE 1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dlfcn.h> | |
#include <sys/time.h> | |
#include <sys/select.h> | |
#include <time.h> | |
#include <sys/stat.h> |