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
| from random import randint | |
| i = 0 | |
| # count of wins without switching choice, with switching | |
| without_switching = 0 | |
| with_switching = 0 | |
| iterations = 100000 | |
| while i <iterations: |
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
| # 1. Change the URL to the url of the site to be archived | |
| # 2. run this script and pipe to an output text file FILENAME | |
| # 3. Download the URLs via wget -i FILENAME | |
| import json | |
| from urllib.parse import urlencode, quote_plus | |
| URL = "https://www.url.com" |
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 os | |
| import subprocess | |
| for top, dirs, files in os.walk('/my/pdf/folder'): | |
| for filename in files: | |
| if filename.endswith('.pdf'): | |
| abspath = os.path.join(top, filename) | |
| subprocess.call('lowriter --invisible --convert-to doc "{}"' | |
| .format(abspath), shell=True) |
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
| CREATE TABLE calendar_table ( | |
| dt DATE NOT NULL PRIMARY KEY, | |
| y SMALLINT NULL, | |
| q tinyint NULL, | |
| m tinyint NULL, | |
| d tinyint NULL, | |
| dw tinyint NULL, | |
| monthName VARCHAR(9) NULL, | |
| dayName VARCHAR(9) NULL, | |
| w tinyint NULL, |
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
| #installation | |
| yum update | |
| yum install gcc mysql-devel python-devel mariadb-server mysql MySQL-python git | |
| yum install epel-release | |
| yum install nginx | |
| easy_install Django pip uwsgi |
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
| export CLICOLOR=1 | |
| function settitle() { echo -ne "\033]0;$@\007";} | |
| alias untar=’tar xvzf’ | |
| alias push='git push origin' | |
| alias pull='git pull origin' | |
| alias restart='sudo /usr/local/apache2/bin/apachectl restart' | |
| alias stop='sudo /usr/local/apache2/bin/apachectl stop' | |
| alias pkill='~/pkill.sh' |
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/sh | |
| ADDRESS='127.0.0.1' | |
| PYTHON="/opt/django/bin/python" | |
| GUNICORN="/opt/django/bin/gunicorn_django" | |
| PROJECTLOC="/opt/django/project" | |
| MANAGELOC="$PROJECTLOC/manage.py" | |
| DEFAULT_ARGS="--workers=3 --daemon --bind=$ADDRESS:" | |
| BASE_CMD="$GUNICORN $DEFAULT_ARGS" |
NewerOlder