This file contains 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
sudo su | |
apt install -y python-pip | |
git clone https://github.com/google/google-api-python-client | |
cd google-api-python-client | |
python setup.py install install_egg_info | |
pip install gdrivefs | |
cd /sbin | |
ln -s /usr/local/bin/gdfs mount.gdfs | |
echo "/root/.gdfs.creds /mnt/gdrivefs gdfs allow_other,big_writes 0 0" >> /etc/fstab | |
gdfstool auth -u |
This file contains 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
# https://www.erlang-solutions.com/downloads/download-erlang-otp | |
# wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb | |
# sudo dpkg -i erlang-solutions_1.0_all.deb | |
deb http://packages.erlang-solutions.com/ubuntu trusty contrib | |
deb http://packages.erlang-solutions.com/ubuntu saucy contrib | |
deb http://packages.erlang-solutions.com/ubuntu precise contrib | |
wget http://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc | |
sudo apt-key add erlang_solutions.asc |
This file contains 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 totp_auth import TotpAuth | |
def main(secret=None): | |
if not secret: | |
# WHEN SIGN UP | |
ta = TotpAuth() | |
else: | |
# WHEN SIGN IN | |
ta = TotpAuth(secret) |
This file contains 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
""" | |
Time-based One-time Password Algorithm | |
Based on the pyotp: https://github.com/nathforge/pyotp | |
""" | |
import base64 | |
import hashlib | |
import hmac | |
import datetime | |
import random |
This file contains 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
function(url, params) { | |
var parser = document.createElement('a'); | |
parser.href = url; | |
var chunks = []; | |
for(var param in params) { | |
chunks.push(encodeURIComponent(param) + "=" + encodeURIComponent(params[param])); | |
} | |
parser.search = (parser.search ? parser.search + '&' : '?') + chunks.join("&"); | |
return parser.href; | |
} |
This file contains 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 | |
""" | |
Simple sms-sender via LittleSMS | |
--------------------------------- | |
You must specify your ``USER_EMAIL`` and ``USER_APIKEY`` below. | |
Examples:: | |
$ sendsms.py --recipients=79117654321,79317654321 --message="Some message" |
This file contains 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 | |
# | |
# Copyright 2012 Patrick Hetu <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains 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 | |
# PROVIDE: supervisord | |
# REQUIRE: DAEMON | |
# KEYWORD: shutdown | |
# | |
# Add the following line to /etc/rc.conf.local or /etc/rc.conf | |
# to enable supervisord: | |
# | |
# supervisord_enable="YES" |
This file contains 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 django.db import connection | |
exclude_tables = ("example", ) | |
c = connection.cursor() | |
c.execute("SHOW TABLE STATUS WHERE ENGINE='MyISAM'") | |
for line in c.fetchall(): | |
table_name = line[0] | |
if table_name in exclude_tables: |
This file contains 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
[user] | |
name = <SOME USERNAME> | |
email = <SOME EMAIL> | |
[github] | |
user = <SOME USERNAME> | |
token = <SOME TOKEN> | |
[core] | |
whitespace = trailing-space, space-before-tab, cr-at-eol |