Skip to content

Instantly share code, notes, and snippets.

View bijenkins's full-sized avatar

William (Billy) Jenkins bijenkins

View GitHub Profile

Find Commands


# Find and zip files newer then 45 days
find . -type f -mtime -45 -print | zip log_support.zip -@

# Fild files by type, older then 2 years, return the file name, the creation date and time, pipe to a log.
find . -ctime +730 -type f -name "*.jpg"  -printf "%p %TY-%Tm-%Td %TH:%TM:%TS %Tz\n" >> ~/delete_list.txt
@bijenkins
bijenkins / files.sh
Created June 7, 2020 19:08 — forked from schollz/files.sh
Go upload/recieve files via POST
#! /bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=file$( printf %d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
done
@bijenkins
bijenkins / nginx_inverse_proxy
Created February 7, 2016 21:04 — forked from osharim/Run django and nodejs running over nginx in the same server
For those people who want django and nodejs running over nginx.
#Django Config
server {
server_name domain.com;
access_log on;
location / {
proxy_pass http://127.0.0.1:8001;
@bijenkins
bijenkins / gunicorn_start.bash
Created November 30, 2015 05:15 — forked from postrational/gunicorn_start.bash
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@bijenkins
bijenkins / celery_email_if_fails.py
Created November 24, 2015 16:40 — forked from alanhamlett/amqp.py
send a traceback to an email address when a Celery worker raises an unhandled exception
import socket
import sys
import traceback
from celery import Celery
from celery.utils.log import get_task_logger
from functools import wraps
from flask import current_app as app
try:
#!/usr/bin/env python
"""
A pure Python "ping" implementation, based on a rewrite by Johannes Meyer,
of a script originally by Matthew Dixon Cowles. Which in turn was derived
from "ping.c", distributed in Linux's netkit. The version this was forked
out of can be found here: https://gist.github.com/pklaus/856268
The versions this script derived from are licensed under GPL v2, this makes
mandatory that this is licensed under the same terms as well. If it were up
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup, element
import urllib2, re
# Read the HTML from the webpage on Wikipedia stats and convert to soup
soup = BeautifulSoup(urllib2.urlopen('http://stats.wikimedia.org/EN/TablesWikipediaEN.htm').read())
# Look for all the paragraphs with 2014
_p = soup.findAll('b',text=re.compile('2014'))
@bijenkins
bijenkins / example.py
Last active August 29, 2015 14:09 — forked from schlamar/example.py
import logging
import multiprocessing
import time
import mplog
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
existing_logger = logging.getLogger('x')
@bijenkins
bijenkins / tree
Last active August 29, 2015 14:08 — forked from efazati/Py Flask Skeleton
.
├── deploy.py
├── deploy.py~
├── design
│   └── main.html
├── fdk
│   ├── application.py
│   ├── apps
│   │   ├── articles
│   │   │   ├── forms.py