View main.c
#include <stdio.h>
int main(int argc, char** argv) {
// argc is live
printf("hello world\n");
// argc was overwritten by &"hello world"
}
View shell.nix
{ pkgs ? import <nixpkgs> {} }:
let
fixWrapper = pkgs.runCommand "fix-wrapper" {} ''
mkdir -p $out/bin
for i in ${pkgs.gcc.cc}/bin/*-gnu-gcc*; do
ln -s ${pkgs.gcc}/bin/gcc $out/bin/$(basename "$i")
done
for i in ${pkgs.gcc.cc}/bin/*-gnu-{g++,c++}*; do
ln -s ${pkgs.gcc}/bin/g++ $out/bin/$(basename "$i")
View musl.nix
(musl.overrideAttrs (old: {
configureFlags = (old.configureFlags or []) ++ ["--enable-wrapper=all"];
preFixup = (old.preFixup or "") + ''
for i in bin/{musl-gcc,musl-clang,ld.musl-clang}; do
moveToOutput $i $dev
done
moveToOutput lib/musl-gcc.specs $dev
substituteInPlace $dev/bin/musl-gcc \
--replace $out/lib/musl-gcc.specs $dev/lib/musl-gcc.specs
'';
View default.nix
# Nix is a powerful package manager for Linux and other Unix systems that makes
# package management reliable and reproducible: https://nixos.org/nix/.
# This file is intended to be used with `nix-shell`
# (https://nixos.org/nix/manual/#sec-nix-shell) to setup a fully-functional
# LEDE build environment by installing all required dependencies.
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "openwrt-dev-env";
buildInputs = [
# This list is more explicit then it have to be: it also includes utils
View gist:ac06994b212d37b5220c61d7452ba663
{config,...}:
{
services.tor = {
enable = true;
extraConfig = ''
SocksPort 0
HiddenServiceNonAnonymousMode 1
HiddenServiceSingleHopMode 1
ExitNodes {de}
NewCircuitPeriod 120
View 0_README.md
$ nix-shell 'https://gist.github.com/Mic92/93f65c4d42ac72c8d64397258cada90c/archive/0159f2d6894ea2928e0b05d6ee46349be81681d6.tar.gz' --command 'studio-link'
View performance-graph.py
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python3 python3Packages.seaborn python3Packages.natsort
from plot import sns, plt
import matplotlib
from collections import defaultdict
from lxml import etree
import natsort
import pandas as pd
import re
View verify-github-webhooks.pl
use Digest::HMAC_SHA1;
# nix-shell -p perlPackages.DigestHMAC
# @body: full http post body
# @signature: value of X-Hub-Signature header field
# @secret_key: value configured in https://developer.github.com/v3/repos/hooks/#create-hook-config-params
# return: 1 if signature is correct
sub verify_signature {
my ($body, $signature, $secret_key) = (@_);
View default.nix
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "env";
buildInputs = [
bashInteractive
gcc5
];
}
View mkdir_p.rs
use std::io;
use std::path::Path;
use std::fs::create_dir_all;
fn mkdir_p<P: AsRef<Path>>(path: &P) -> io::Result<()> {
if let Err(e) = create_dir_all(path) {
if e.kind() != io::ErrorKind::AlreadyExists {
return Err(e)
}
}