Skip to content

Instantly share code, notes, and snippets.

View QuentinPerez's full-sized avatar
🧨
throwing dynamite

Quentin Perez QuentinPerez

🧨
throwing dynamite
View GitHub Profile
@QuentinPerez
QuentinPerez / split.rs
Created February 21, 2023 09:58
split
#[derive(Debug)]
pub struct Split {
// TODO
}
impl Split {
pub fn new(input: &str, delimiter: char) -> Self {
// TODO
}
}
[ 15.457408] ------------[ cut here ]------------
[ 15.457409] Kernel BUG at ffffffff81530b1e [verbose debug info unavailable]
[ 15.457412] invalid opcode: 0000 [#1] SMP
[ 15.457413] Modules linked in:
[ 15.457416] CPU: 4 PID: 0 Comm: swapper/4 Not tainted 4.4.34-std-1 #1
[ 15.457417] Hardware name: Online Labs SR/SR, BIOS 00.00.00.0007 03/04/2016
[ 15.457418] task: ffff88085c1f9540 ti: ffff88085c1fc000 task.ti: ffff88085c1fc000
[ 15.457425] RIP: 0010:[<ffffffff81530b1e>] [<ffffffff81530b1e>] eth_type_trans+0xbe/0x110
[ 15.457426] RSP: 0000:ffff88087fd03df8 EFLAGS: 00010297
[ 15.457427] RAX: 0000000000000153 RBX: ffff880859d86a00 RCX: 0000000000001073
#cloud-config
write_files:
- path: /root/nbd-setup.sh
permissions: "0700"
content: |
#!/bin/bash
set -x
modprobe nbd
#!/bin/bash
set -x
set -e
metadata_json=$(curl -f -s http://169.254.42.42/conf?format=json)
ssh_authorized_keys=$(echo $metadata_json | jq -r ".ssh_public_keys" | jq -r ".[]")
hostname=$(echo $metadata_json | jq -r ".hostname")
cat > /tmp/scw-cloud-init <<EOF
#cloud-config
coreos:
units:
- name: var-lib-docker.mount
command: start
content: |
[Unit]
Description=Mount ephemeral vda to /var/lib/docker
Requires=format-ephemeral-vda.service
@QuentinPerez
QuentinPerez / sb.sh
Last active September 23, 2016 08:40
#!/bin/bash
# Copyright (C) 2012 Crowd9 Pty Ltd
echo "
###############################################################################
# ServerBear (http://serverbear.com) benchmarker #
###############################################################################
This script will:
#!/bin/sh
set -e
#
# This script is meant for quick & easy install via:
# 'curl -sSL https://get.docker.com/ | sh'
# or:
# 'wget -qO- https://get.docker.com/ | sh'
#
# For test builds (ie. release candidates):
# 'curl -fsSL https://test.docker.com/ | sh'
@QuentinPerez
QuentinPerez / docker-arm.sh
Created May 27, 2016 12:47
docker-arm.sh
#!/bin/sh
exit 0

Keybase proof

I hereby claim:

  • I am QuentinPerez on github.
  • I am quentinperez (https://keybase.io/quentinperez) on keybase.
  • I have a public key whose fingerprint is 3528 6B56 3DD3 DDBA 3102 9D98 B7A9 8DB4 FFDD ECB4

To claim this, I am signing this object:

@QuentinPerez
QuentinPerez / bash
Created December 12, 2015 23:18
Random address MAC on OS X
pip install SpoofMAC
curl https://raw.githubusercontent.com/feross/SpoofMAC/master/misc/local.macspoof.plist > /tmp/local.macspoof.plist
#
# Hack spoof-mac path into /tmp/local.macspoof.plist
#
sudo cp /tmp/local.macspoof.plist /Library/LaunchDaemons
sudo chown root:wheel /Library/LaunchDaemons/local.macspoof.plist
sudo chmod 0644 /Library/LaunchDaemons/local.macspoof.plist