This file contains hidden or 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
# syntax=docker/dockerfile:experimental | |
FROM fedora:31 as builder | |
ARG METASHELL_REV=16a3d5cd2352f28a6e505ad71b69e59ffb765775 | |
RUN \ | |
dnf install -y git gcc gcc-c++ cmake readline-devel rpm-build python python2 ninja-build && \ | |
git clone --depth=10 https://github.com/metashell/metashell.git /usr/src/metashell && \ | |
cd /usr/src/metashell && \ | |
git checkout $METASHELL_REV && \ |
This file contains hidden or 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
memfd: memfd.o binary.o | |
binary.o: sc | |
$(LD) -r -b binary -o $@ $^ | |
sc: sc.S | |
$(CC) -no-pie -nostdlib -s $< -o $@ | |
.PHONY: clean | |
clean: |
This file contains hidden or 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
use std::collections::VecDeque; | |
use std::io::Read; | |
struct Emitter { | |
variable_idx: u32, | |
label_idx: u32, | |
loop_stack: VecDeque<u32>, | |
} | |
impl Emitter { |
This file contains hidden or 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
fn binary_sqrt(n: f64, tol: f64) -> f64 { | |
let mut s = 1.0f64; | |
let mut e = n; | |
while (s.powi(2) - n).abs() > tol { | |
let m = (s + e) / 2.0; | |
if m.powi(2) > n { | |
e = m; | |
} else { | |
s = m; | |
} |
This file contains hidden or 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
#![allow(unused_imports)] | |
use std::cmp::{max, min, Reverse}; | |
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque}; | |
use itertools::Itertools; | |
use nyan::*; | |
fn main() -> Result<(), Box<dyn std::error::Error>> { | |
let stdin = std::io::stdin(); |
This file contains hidden or 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 <algorithm> | |
#include <array> | |
#include <bitset> | |
#include <cstdint> | |
#include <deque> | |
#include <functional> | |
#include <iostream> | |
#include <limits> | |
#include <memory> | |
#include <queue> |
This file contains hidden or 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
use std::f32; | |
use num_complex::Complex; | |
// http://linas.org/art-gallery/escape/smooth.html | |
fn smooth_iter(i: u32, z: Complex<f32>) -> f32 { | |
i as f32 - z.norm().ln().ln() / 2.0f32.ln() | |
} | |
// https://github.com/Nuke928/mandelbrot-opengl/blob/039fe9213c01992584f7b391da49bdeeb8d259e2/shader.glsl#L10-L16 |
This file contains hidden or 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
[Trigger] | |
Type = Package | |
Operation = Upgrade | |
Target = systemd | |
[Action] | |
Description = Updating systemd-boot | |
When = PostTransaction | |
Exec = /usr/bin/sh -c '/usr/bin/bootctl update && for f in $(/usr/bin/bootctl -p)/EFI/{BOOT/BOOTX64.EFI,systemd/systemd-bootx64.efi}; do /usr/bin/sbsign --key /root/secure-boot/db.key --cert /root/secure-boot/db.crt --output "$f" "$f"; done' |
This file contains hidden or 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
EXTRA_CFLAGS = -Wall -g | |
obj-m = hello.o |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
-- Google CTF 2018 Quals: sftp | |
import Control.Monad | |
import Control.Monad.IO.Class (liftIO) | |
import Data.Bits | |
import qualified Data.ByteString.Char8 as BS | |
import Data.List | |
import Data.Maybe |