# 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| for n in {1..100}; do | |
| dd if=/dev/urandom of=file$( printf %d "$n" ).bin bs=1 count=$(( RANDOM + 1024 )) | |
| done |
- http://stackoverflow.com/questions/804115 (
rebasevsmerge). - https://www.atlassian.com/git/tutorials/merging-vs-rebasing (
rebasevsmerge) - https://www.atlassian.com/git/tutorials/undoing-changes/ (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/2221658 (HEAD^ vs HEAD~) (See
git rev-parse) - http://stackoverflow.com/questions/292357 (
pullvsfetch) - http://stackoverflow.com/questions/39651 (
stashvsbranch) - http://stackoverflow.com/questions/8358035 (
resetvscheckoutvsrevert) - http://stackoverflow.com/questions/5798930 (
git resetvsgit rm --cached)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Django Config | |
| server { | |
| server_name domain.com; | |
| access_log on; | |
| location / { | |
| proxy_pass http://127.0.0.1:8001; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . | |
| ├── deploy.py | |
| ├── deploy.py~ | |
| ├── design | |
| │ └── main.html | |
| ├── fdk | |
| │ ├── application.py | |
| │ ├── apps | |
| │ │ ├── articles | |
| │ │ │ ├── forms.py |
NewerOlder