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
import redis | |
r = redis.StrictRedis(host='localhost') | |
r.delete('queue') | |
# Add work into queue | |
print r.hset('queue', 'file1.mp4', 'will be processed on machine A') | |
# return value will be 1 - a new value | |
# Another machine tries to add same work |
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
import pytz | |
import datetime | |
import time | |
s = "2015-01-01 12:34:56" | |
local = pytz.timezone("Asia/Seoul") | |
begin = datetime.datetime.now() | |
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 dateutil import parser | |
from datetime import datetime | |
s = "2015-01-01 12:34:56" | |
begin = datetime.now() | |
for _ in xrange(10000): | |
p = parser.parse(s) | |
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
find -E <path> ".*\.(avi|mp4|mov)" -exec sh -c "echo '\"{}\",\c' && ffprobe -i '{}' -show_format -v quiet | sed -n 's/duration=//p'" \; |
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 random import shuffle | |
s = list('typewriter') | |
tried = 0 | |
while(True): | |
tried += 1 | |
shuffle(s) |
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
.landing header .top-social { | |
margin-top: 10px; | |
margin-right: 0; | |
width: 320px; | |
} | |
.landing header .fb-like-wrap, .landing header .tw-like-wrap, .landing header .gp-like-wrap { | |
/* display: inline-block; */ | |
float: left; | |
} |
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
# changes from http://www.cyberciti.biz/faq/linux-kernel-etcsysctl-conf-security-hardening/ | |
# Protect ICMP attacks | |
net.ipv4.icmp_echo_ignore_broadcasts = 1 | |
# Turn on protection for bad icmp error messages | |
net.ipv4.icmp_ignore_bogus_error_responses = 1 | |
# Turn on syncookies for SYN flood attack protection | |
net.ipv4.tcp_syncookies = 1 |
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
10:35 You have joined the channel | |
10:35 lqez has joined ([email protected]) | |
10:36 aronze has joined (01de1216@web/1.222.18.22) | |
10:36 aronze: 계세요? | |
10:38 lqez: aronze: 안녕하세요 ㅎㅎ | |
10:39 aronze: 핫 네네 안녕하세요. 다른 분들도 들어오시면 좋은데 들어오기 힘드신가바여 | |
10:39 aronze: 방가워요^^ lqez 님 | |
10:39 ohyecloudy has joined (dda32704@web/221.163.39.4) | |
10:39 lqez: 안녕하세요- | |
10:39 ohyecloudy: 안녕하세요 |
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.contrib.flatpages.models import FlatPage | |
from django_summernote.admin import SummernoteModelAdmin | |
class FlatPageAdmin(SummernoteModelAdmin): | |
pass | |
admin.site.unregister(FlatPage) | |
admin.site.register(FlatPage, FlatPageAdmin) |
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.contrib import admin | |
from django.contrib.flatpages.models import FlatPage | |
# Note: we are renaming the original Admin and Form as we import them! | |
from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld | |
from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld | |
from django import forms | |
from django_summernote.widgets import SummernoteWidget | |