Skip to content

Instantly share code, notes, and snippets.

View jrelo's full-sized avatar

hed0rah jrelo

View GitHub Profile
@jrelo
jrelo / gist:3af2cd727c4118b3d9875deaf1978e13
Created May 9, 2019 20:16
vzprocess: ps with CTID filtration for OpenVZ
#!/usr/bin/perl
use strict;
use warnings;
unless (scalar @ARGV == 1) {
die "Parameter needed, please pass ctid as parameter";
}
my $ctid = $ARGV[0];
@jrelo
jrelo / aes.py
Created August 27, 2018 20:35 — forked from tryone144/aes.py
Implementation of AES as used by https://aesencryption.net
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# implementation of AES as used by https://aesencryption.net
#
# (c) 2018 Bernd Busse
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.modes import CBC
@jrelo
jrelo / killcx
Created July 21, 2018 19:35 — forked from kisel/killcx
killcx
#!/usr/bin/perl
######################################################################
# killcx :
#
# Close a TCP connection under Linux.
#
# (c) Jerome Bruandet - <floodmon@spamcleaner.org>
#
# version 1.0.3 - 18-May-2011
#
@jrelo
jrelo / start_stop_memcached_script.sh
Created July 7, 2018 23:11 — forked from tinogomes/start_stop_memcached_script.sh
Script sample to start/stop for linux with nohup
#!/bin/bash
#
BASE=/tmp
PID=$BASE/app.pid
LOG=$BASE/app.log
ERROR=$BASE/app-error.log
PORT=11211
LISTEN_IP='0.0.0.0'
MEM_SIZE=4
@jrelo
jrelo / linux-explorer.sh
Created June 30, 2018 20:42 — forked from chrisfu/linux-explorer.sh
Linux Explorer system information script
#!/bin/bash
##############################################################################
#
#
# FILE : linux-explorer.sh
# Last Change Date : 04-07-2016
# Author(s) : Joe Santoro
# Date Started : 15th April, 2004
# Email : linuxexplo [ at ] unix-consultants.com
# Web : http://www.unix-consultants.com/examples/scripts/linux/linux-explorer

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@jrelo
jrelo / memory_layout.md
Created May 5, 2018 15:04 — forked from CMCDragonkai/memory_layout.md
Linux: Understanding the Memory Layout of Linux Executables

Understanding the Memory Layout of Linux Executables

Required tools for playing around with memory:

  • hexdump
  • objdump
  • readelf
  • xxd
  • gcore
@jrelo
jrelo / Compile to .deb
Created May 1, 2018 14:45 — forked from Avyd/Compile to .deb
Compile kernel to installable .deb package
#Install necessary things
apt-get update
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential -y
#Get the kernel
cd /usr/src
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.xz
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.sign
gpg --verify linux-3.13.tar.sign
tar xpvf linux-3.13.tar.xz
@jrelo
jrelo / curl.md
Created May 1, 2018 14:30 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jrelo
jrelo / itoa.sh
Created March 23, 2018 19:23 — forked from jjarmoc/itoa.sh
IP to Integer and Integer to IP conversions in bash.
#Handy functions for .bashrc loading.
#
# $ atoi 192.168.1.1
# 3232235777
# $ itoa 3232235777
# 192.168.1.1
function atoi
{