Skip to content

Instantly share code, notes, and snippets.

View raleighguevarra's full-sized avatar

Raleigh Guevarra raleighguevarra

View GitHub Profile
@thewickedaxe
thewickedaxe / memeater.py
Created July 7, 2017 17:25
Script to eat memory on python
import argparse
import time
GB = 1024 * 1024 * 1024
def parse_cmd_args():
"""
Parses command line args
"""
parser = argparse.ArgumentParser(description='Memory Eating utility for python')
# kill all of the user processes
ps -u amonagent | grep -v PID | awk '{print $1}' | xargs -i kill {}
sleep 2
ps -u amonagent | grep -v PID | awk '{print $1}' | xargs -i kill {}
# Systemd
if which systemctl > /dev/null 2>&1 ; then
systemctl stop amonagent
# Sysv
else
@cpswan
cpswan / nginx.conf
Last active July 2, 2024 09:43
Using nginx to proxy to an AWS ELB
daemon off;
worker_processes 1;
events { worker_connections 1024; }
http{
sendfile on;
@tahajahangir
tahajahangir / example-mod-wsgi.py
Last active April 22, 2024 00:37 — forked from branneman/example-mod-wsgi.py
Python (2&3 compatible) Equivalent to phpinfo()
def application(environ, start_response):
from pyinfo import pyinfo
output = pyinfo()
# or pyinfo([('custom key', 'custom value'), ...])
start_response('200 OK', [('Content-type', 'text/html')])
return [output]
@duksis
duksis / neighbor_search.py
Last active July 23, 2023 14:40
Script to find running web servers in local network
#!/usr/bin/env python
#########################################################################
# #
# Script for finding neighbor web servers in local network #
# #
# Author: Hugo Duksis <duksis@gmail.com> #
# Usage: python neighbor_search.py
# TODO: move pinging in multiple treads to increase performance #
# #
@originell
originell / extract_exceptions.py
Created February 27, 2012 10:29
Python Traceback Extractor from text/log files.
"""
Extract unique Python-Exceptions with their Traceback from a log/text file.
Usage::
python extract_exceptions.py -f logfile.txt
Furthermore it supports excluding exceptions you don't want to have::
python extract_exceptions.py -f logfile.txt -e ValueError,AttributeError
@larsar
larsar / shared_folder_centos_virtualbox.txt
Created January 27, 2012 08:04
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot