Skip to content

Instantly share code, notes, and snippets.

$ cd /var/run/secrets/kubernetes.io/serviceaccount/
$ curl --cacert ca.crt -H "Authorization: Bearer `cat token`" https://kubernetes.default/api/v1/pods?watch=1
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="dpi" mode="assign"> <double>75</double> </edit>
<edit name="pixelsize" mode="assign"> <double>12.5</double> </edit>
<edit name="hintstyle" mode="assign"> <const>vrgb</const> </edit>
<edit name="hinting" mode="assign"> <bool>true</bool> </edit>
<edit name="autohint" mode="assign"> <bool>false</bool> </edit>
<edit name="lcdfilter" mode="assign"> <const>lcddefault</const> </edit>
@ayosec
ayosec / foo-4e0928.c
Last active July 7, 2017 05:42
LLVM Bug, BPF Target
# 1 "<built-in>"
# 1 "foo.c"
int do_request(long i) {
char buf[100];
int j;
for(j = 0; j < i; j++) {
buf[j] = 1;
}
return buf[j-1];
@ayosec
ayosec / try-with-panic.rs
Created May 9, 2016 14:30
Replace try! with panic!
macro_rules! try {
( $expr : expr) => {
match $expr {
Ok(v) => v,
Err(e) => panic!("Err {}: {:?}", stringify!($expr), e),
}
}
}
@ayosec
ayosec / mpv-best.rb
Last active January 16, 2016 02:54
mpv with bestaudio/bestvideo
#!/usr/bin/env ruby
URL = ARGV.first || raise("Missing video URL")
audio = IO.popen(["youtube-dl", "-f", "bestaudio", "-g", URL])
video = IO.popen(["youtube-dl", "-f", "bestvideo", "-g", URL])
title = IO.popen(["youtube-dl", "-e", URL])
audio_url = audio.read.chomp
video_url = video.read.chomp
@ayosec
ayosec / struct-closure.rs
Created December 18, 2015 15:53
Rust: Closure in a struct
trait Separator {
fn is_sep(&self, c: char) -> bool;
}
struct ClosureSeparator<F: Fn(char) -> bool>(F);
impl<F> Separator for ClosureSeparator<F> where F: Fn(char) -> bool {
#[inline]
fn is_sep(&self, c: char) -> bool {
@ayosec
ayosec / idonethis.rb
Created November 29, 2015 22:04
Simple client for idonethis API
#!/usr/bin/ruby
require "json"
team = nil
token = nil
if ARGV.size != 1 or ARGV[0] =~ /^-/
STDERR.puts "Usage #$0 'raw text'"
exit 1
@ayosec
ayosec / Dockerfile
Created October 27, 2015 00:18
Use azure-cli in a Docker image
FROM node:4.2
RUN npm install --global azure-cli
@ayosec
ayosec / README - Neo4j Shell client.md
Last active October 15, 2015 05:14
Neo4j Shell client

Neo4j Shell Client

Launch Neo4j shell commands through the HTTP REST interface.

You have to set the environment variable GRAPHENEDB_URL with the URL of your Neo4j database. For example:

$ export GRAPHENEDB_URL="http://MyUser:[email protected]:12345"

Now, you can launch commands: