Skip to content

Instantly share code, notes, and snippets.

View caio-vinicius's full-sized avatar

Caio Souza | csouza-f caio-vinicius

View GitHub Profile
DJANGO_API_URL=https://127.0.0.1
DJANGO_WS_URL=wss://127.0.0.1
DJANGO_ALLOWED_HOSTS="*"
DJANGO_JWT_SECRET_KEY=mysecretkey
DJANGO_DEBUG=False
DB_NAME=mydb
POSTGRES_DB=mydb
DB_USER=myuser
POSTGRES_USER=myuser
DB_PASSWORD=mypassword
@caio-vinicius
caio-vinicius / killbutmakeitlooklikeanaccident.sh
Created July 17, 2022 13:54 — forked from moyix/killbutmakeitlooklikeanaccident.sh
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@caio-vinicius
caio-vinicius / xcbuild-debugging-tricks.md
Created July 11, 2022 22:12 — forked from ddunbar/xcbuild-debugging-tricks.md
Xcode new build system debugging tricks

New Build System Tricks

Command Line

alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole  # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]
@caio-vinicius
caio-vinicius / dhcpd.conf
Created July 5, 2022 17:21 — forked from TyrfingMjolnir/dhcpd.conf
Host Apple's netboot images from ISC DHCPD
class "Apple-Intel-Netboot" {
# Limit this class to only Intel Apple machines
match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386";
option dhcp-parameter-request-list 1,3,17,43,60; # Send these options to the client (possibly forcing it, if the client didn't request it)
# From: http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml
# 1 - Subnet Mask
# 3 - Router
# 17 - Root Path
# 43 - Vendor Specific
# 60 - Class ID
@caio-vinicius
caio-vinicius / build_wireshark.sh
Created May 30, 2022 17:04 — forked from syneart/build_wireshark.sh
BUILD WIRESHARK ON UBUNTU OR DEBIAN
#!/bin/sh
# This shell script is made by SyneArt <[email protected]>
#######################################
# BUILD WIRESHARK ON UBUNTU OR DEBIAN #
#######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |------------------------------------------------------|
# | OS | Wireshark | Test | Last test |
# |----------------|----------------|------|-------------|
@caio-vinicius
caio-vinicius / list.h
Created March 18, 2022 13:14 — forked from gmcclure/list.h
Simple doubly linked list implementation, from the Linux kernel
#ifndef __LIST_H
#define __LIST_H
/* This file is from Linux Kernel (include/linux/list.h)
* and modified by simply removing hardware prefetching of list items.
* Here by copyright, credits attributed to wherever they belong.
* Kulesh Shanmugasundaram (kulesh [squiggly] isis.poly.edu)
*/
/*
@caio-vinicius
caio-vinicius / readme.md
Created February 7, 2022 16:23 — forked from Startouf/readme.md
Update CRD for helm traefik migration from 2.4 to 2.5
@caio-vinicius
caio-vinicius / ubuntu-focal-autoinstall-virtualbox.md
Created January 13, 2022 12:09 — forked from bitsandbooks/ubuntu-focal-autoinstall-virtualbox.md
Ubuntu 20.04 with Autoinstall using VirtualBox [DRAFT]

Ubuntu 20.04 + Autoinstall + VirtualBox

Intro

This guide will explain how to set up a [VirtualBox][] VM running [Ubuntu 20.04][] and, using the new [autoinstall][] tool and cloud-init, install OpenSSH server, add a group and a user, who can then connect to the machine via SSH. This was done on a 2016 MacBook Pro running macOS 10.15 "Catalina" and VirtualBox 6.1.6 (with the VirtualBox Guest Additions installed).

You will also need a group name, a username, a password hash and an SSH key pair.

How Autoinstall Works

@caio-vinicius
caio-vinicius / chill-zoom.sh
Created December 17, 2021 18:49 — forked from abraithwaite/chill-zoom.sh
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"